Revision 1297:0a574315af3e .svn/pristine/ad
| .svn/pristine/ad/ad0238c786fdc47f0ed2113b9d3c0fe464953281.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2012 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
module Redmine |
|
| 19 |
module Views |
|
| 20 |
module Builders |
|
| 21 |
def self.for(format, request, response, &block) |
|
| 22 |
builder = case format |
|
| 23 |
when 'xml', :xml; Builders::Xml.new(request, response) |
|
| 24 |
when 'json', :json; Builders::Json.new(request, response) |
|
| 25 |
else; raise "No builder for format #{format}"
|
|
| 26 |
end |
|
| 27 |
if block |
|
| 28 |
block.call(builder) |
|
| 29 |
else |
|
| 30 |
builder |
|
| 31 |
end |
|
| 32 |
end |
|
| 33 |
end |
|
| 34 |
end |
|
| 35 |
end |
|
| .svn/pristine/ad/ad194258daac897f0c8e0281fc155c7b77d1ff1e.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2012 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
require File.expand_path('../../../../test_helper', __FILE__)
|
|
| 19 |
|
|
| 20 |
class Redmine::NotifiableTest < ActiveSupport::TestCase |
|
| 21 |
def setup |
|
| 22 |
end |
|
| 23 |
|
|
| 24 |
def test_all |
|
| 25 |
assert_equal 12, Redmine::Notifiable.all.length |
|
| 26 |
|
|
| 27 |
%w(issue_added issue_updated issue_note_added issue_status_updated issue_priority_updated news_added news_comment_added document_added file_added message_posted wiki_content_added wiki_content_updated).each do |notifiable| |
|
| 28 |
assert Redmine::Notifiable.all.collect(&:name).include?(notifiable), "missing #{notifiable}"
|
|
| 29 |
end |
|
| 30 |
end |
|
| 31 |
end |
|
| .svn/pristine/ad/ad7462fa3902df8825690cb1e165b92bb8407c2c.svn-base | ||
|---|---|---|
| 1 |
<%= form_tag({:action => 'edit', :tab => 'issues'}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
|
|
| 2 |
|
|
| 3 |
<div class="box tabular settings"> |
|
| 4 |
<p><%= setting_check_box :cross_project_issue_relations %></p> |
|
| 5 |
|
|
| 6 |
<p><%= setting_select :cross_project_subtasks, cross_project_subtasks_options %></p> |
|
| 7 |
|
|
| 8 |
<p><%= setting_check_box :issue_group_assignment %></p> |
|
| 9 |
|
|
| 10 |
<p><%= setting_check_box :default_issue_start_date_to_creation_date %></p> |
|
| 11 |
|
|
| 12 |
<p><%= setting_check_box :display_subprojects_issues %></p> |
|
| 13 |
|
|
| 14 |
<p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
|
|
| 15 |
|
|
| 16 |
<p><%= setting_multiselect :non_working_week_days, (1..7).map {|d| [day_name(d), d.to_s]}, :inline => true %></p>
|
|
| 17 |
|
|
| 18 |
<p><%= setting_text_field :issues_export_limit, :size => 6 %></p> |
|
| 19 |
|
|
| 20 |
<p><%= setting_text_field :gantt_items_limit, :size => 6 %></p> |
|
| 21 |
</div> |
|
| 22 |
|
|
| 23 |
<fieldset class="box"> |
|
| 24 |
<legend><%= l(:setting_issue_list_default_columns) %></legend> |
|
| 25 |
<%= render :partial => 'queries/columns', |
|
| 26 |
:locals => {
|
|
| 27 |
:query => Query.new(:column_names => Setting.issue_list_default_columns), |
|
| 28 |
:tag_name => 'settings[issue_list_default_columns][]' |
|
| 29 |
} %> |
|
| 30 |
</fieldset> |
|
| 31 |
|
|
| 32 |
<%= submit_tag l(:button_save) %> |
|
| 33 |
<% end %> |
|
| .svn/pristine/ad/ad978252fc7b241f314071411671880f57777148.svn-base | ||
|---|---|---|
| 1 |
<ul> |
|
| 2 |
<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
|
|
| 3 |
|
|
| 4 |
<% if !@issue.nil? -%> |
|
| 5 |
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
|
|
| 6 |
:class => 'icon-edit', :disabled => !@can[:edit] %></li> |
|
| 7 |
<% else %> |
|
| 8 |
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issue_ids},
|
|
| 9 |
:class => 'icon-edit', :disabled => !@can[:edit] %></li> |
|
| 10 |
<% end %> |
|
| 11 |
|
|
| 12 |
<% if @allowed_statuses.present? %> |
|
| 13 |
<li class="folder"> |
|
| 14 |
<a href="#" class="submenu"><%= l(:field_status) %></a> |
|
| 15 |
<ul> |
|
| 16 |
<% @allowed_statuses.each do |s| -%> |
|
| 17 |
<li><%= context_menu_link h(s.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {:status_id => s}, :back_url => @back}, :method => :post,
|
|
| 18 |
:selected => (@issue && s == @issue.status), :disabled => !@can[:update] %></li> |
|
| 19 |
<% end -%> |
|
| 20 |
</ul> |
|
| 21 |
</li> |
|
| 22 |
<% end %> |
|
| 23 |
|
|
| 24 |
<% unless @trackers.nil? %> |
|
| 25 |
<li class="folder"> |
|
| 26 |
<a href="#" class="submenu"><%= l(:field_tracker) %></a> |
|
| 27 |
<ul> |
|
| 28 |
<% @trackers.each do |t| -%> |
|
| 29 |
<li><%= context_menu_link h(t.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'tracker_id' => t}, :back_url => @back}, :method => :post,
|
|
| 30 |
:selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li> |
|
| 31 |
<% end -%> |
|
| 32 |
</ul> |
|
| 33 |
</li> |
|
| 34 |
<% end %> |
|
| 35 |
|
|
| 36 |
<% if @safe_attributes.include?('priority_id') -%>
|
|
| 37 |
<li class="folder"> |
|
| 38 |
<a href="#" class="submenu"><%= l(:field_priority) %></a> |
|
| 39 |
<ul> |
|
| 40 |
<% @priorities.each do |p| -%> |
|
| 41 |
<li><%= context_menu_link h(p.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'priority_id' => p}, :back_url => @back}, :method => :post,
|
|
| 42 |
:selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
|
| 43 |
<% end -%> |
|
| 44 |
</ul> |
|
| 45 |
</li> |
|
| 46 |
<% end %> |
|
| 47 |
|
|
| 48 |
<% if @safe_attributes.include?('fixed_version_id') && @versions.any? -%>
|
|
| 49 |
<li class="folder"> |
|
| 50 |
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a> |
|
| 51 |
<ul> |
|
| 52 |
<% @versions.sort.each do |v| -%> |
|
| 53 |
<li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'fixed_version_id' => v}, :back_url => @back}, :method => :post,
|
|
| 54 |
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li> |
|
| 55 |
<% end -%> |
|
| 56 |
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'fixed_version_id' => 'none'}, :back_url => @back}, :method => :post,
|
|
| 57 |
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li> |
|
| 58 |
</ul> |
|
| 59 |
</li> |
|
| 60 |
<% end %> |
|
| 61 |
|
|
| 62 |
<% if @safe_attributes.include?('assigned_to_id') && @assignables.present? -%>
|
|
| 63 |
<li class="folder"> |
|
| 64 |
<a href="#" class="submenu"><%= l(:field_assigned_to) %></a> |
|
| 65 |
<ul> |
|
| 66 |
<% if @assignables.include?(User.current) %> |
|
| 67 |
<li><%= context_menu_link "<< #{l(:label_me)} >>", {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back}, :method => :post,
|
|
| 68 |
:disabled => !@can[:update] %></li> |
|
| 69 |
<% end %> |
|
| 70 |
<% @assignables.each do |u| -%> |
|
| 71 |
<li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => u}, :back_url => @back}, :method => :post,
|
|
| 72 |
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li> |
|
| 73 |
<% end -%> |
|
| 74 |
<li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => 'none'}, :back_url => @back}, :method => :post,
|
|
| 75 |
:selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li> |
|
| 76 |
</ul> |
|
| 77 |
</li> |
|
| 78 |
<% end %> |
|
| 79 |
|
|
| 80 |
<% if @safe_attributes.include?('category_id') && @project && @project.issue_categories.any? -%>
|
|
| 81 |
<li class="folder"> |
|
| 82 |
<a href="#" class="submenu"><%= l(:field_category) %></a> |
|
| 83 |
<ul> |
|
| 84 |
<% @project.issue_categories.each do |u| -%> |
|
| 85 |
<li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'category_id' => u}, :back_url => @back}, :method => :post,
|
|
| 86 |
:selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li> |
|
| 87 |
<% end -%> |
|
| 88 |
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'category_id' => 'none'}, :back_url => @back}, :method => :post,
|
|
| 89 |
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li> |
|
| 90 |
</ul> |
|
| 91 |
</li> |
|
| 92 |
<% end -%> |
|
| 93 |
|
|
| 94 |
<% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
|
|
| 95 |
<li class="folder"> |
|
| 96 |
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a> |
|
| 97 |
<ul> |
|
| 98 |
<% (0..10).map{|x|x*10}.each do |p| -%>
|
|
| 99 |
<li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'done_ratio' => p}, :back_url => @back}, :method => :post,
|
|
| 100 |
:selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
|
| 101 |
<% end -%> |
|
| 102 |
</ul> |
|
| 103 |
</li> |
|
| 104 |
<% end %> |
|
| 105 |
|
|
| 106 |
<% @options_by_custom_field.each do |field, options| %> |
|
| 107 |
<li class="folder"> |
|
| 108 |
<a href="#" class="submenu"><%= h(field.name) %></a> |
|
| 109 |
<ul> |
|
| 110 |
<% options.each do |text, value| %> |
|
| 111 |
<li><%= bulk_update_custom_field_context_menu_link(field, text, value || text) %></li> |
|
| 112 |
<% end %> |
|
| 113 |
<% unless field.is_required? %> |
|
| 114 |
<li><%= bulk_update_custom_field_context_menu_link(field, l(:label_none), '') %></li> |
|
| 115 |
<% end %> |
|
| 116 |
</ul> |
|
| 117 |
</li> |
|
| 118 |
<% end %> |
|
| 119 |
|
|
| 120 |
<% if !@issue.nil? %> |
|
| 121 |
<% if @can[:log_time] -%> |
|
| 122 |
<li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue},
|
|
| 123 |
:class => 'icon-time-add' %></li> |
|
| 124 |
<% end %> |
|
| 125 |
<% if User.current.logged? %> |
|
| 126 |
<li><%= watcher_link(@issue, User.current) %></li> |
|
| 127 |
<% end %> |
|
| 128 |
<% end %> |
|
| 129 |
|
|
| 130 |
<% if @issue.present? %> |
|
| 131 |
<li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
|
|
| 132 |
:class => 'icon-copy', :disabled => !@can[:copy] %></li> |
|
| 133 |
<% else %> |
|
| 134 |
<li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'bulk_edit', :ids => @issue_ids, :copy => '1'},
|
|
| 135 |
:class => 'icon-copy', :disabled => !@can[:move] %></li> |
|
| 136 |
<% end %> |
|
| 137 |
<li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back), |
|
| 138 |
:method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon-del', :disabled => !@can[:delete] %></li>
|
|
| 139 |
|
|
| 140 |
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
|
|
| 141 |
</ul> |
|
| .svn/pristine/ad/ada6049cb9e3f42d297d010fa449795702a9f12a.svn-base | ||
|---|---|---|
| 1 |
<h2><%=l(:label_issue_new)%></h2> |
|
| 2 |
|
|
| 3 |
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
|
|
| 4 |
|
|
| 5 |
<%= labelled_form_for @issue, :url => project_issues_path(@project), |
|
| 6 |
:html => {:id => 'issue-form', :multipart => true} do |f| %>
|
|
| 7 |
<%= error_messages_for 'issue' %> |
|
| 8 |
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %> |
|
| 9 |
<div class="box tabular"> |
|
| 10 |
<div id="all_attributes"> |
|
| 11 |
<%= render :partial => 'issues/form', :locals => {:f => f} %>
|
|
| 12 |
</div> |
|
| 13 |
|
|
| 14 |
<% if @copy_from && @copy_from.attachments.any? %> |
|
| 15 |
<p> |
|
| 16 |
<label for="copy_attachments"><%= l(:label_copy_attachments) %></label> |
|
| 17 |
<%= check_box_tag 'copy_attachments', '1', @copy_attachments %> |
|
| 18 |
</p> |
|
| 19 |
<% end %> |
|
| 20 |
<% if @copy_from && !@copy_from.leaf? %> |
|
| 21 |
<p> |
|
| 22 |
<label for="copy_subtasks"><%= l(:label_copy_subtasks) %></label> |
|
| 23 |
<%= check_box_tag 'copy_subtasks', '1', @copy_subtasks %> |
|
| 24 |
</p> |
|
| 25 |
<% end %> |
|
| 26 |
|
|
| 27 |
<p id="attachments_form"><label><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
|
|
| 28 |
|
|
| 29 |
<% if @issue.safe_attribute? 'watcher_user_ids' -%> |
|
| 30 |
<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label> |
|
| 31 |
<span id="watchers_inputs"> |
|
| 32 |
<%= watchers_checkboxes(@issue, @available_watchers) %> |
|
| 33 |
</span> |
|
| 34 |
<span class="search_for_watchers"> |
|
| 35 |
<%= link_to l(:label_search_for_watchers), |
|
| 36 |
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
|
|
| 37 |
:remote => true, |
|
| 38 |
:method => 'get' %> |
|
| 39 |
</span> |
|
| 40 |
</p> |
|
| 41 |
<% end %> |
|
| 42 |
</div> |
|
| 43 |
|
|
| 44 |
<%= submit_tag l(:button_create) %> |
|
| 45 |
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |
|
| 46 |
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %> |
|
| 47 |
|
|
| 48 |
<%= javascript_tag "$('#issue_subject').focus();" %>
|
|
| 49 |
<% end %> |
|
| 50 |
|
|
| 51 |
<div id="preview" class="wiki"></div> |
|
| 52 |
|
|
| 53 |
<% content_for :header_tags do %> |
|
| 54 |
<%= robot_exclusion_tag %> |
|
| 55 |
<% end %> |
|
| .svn/pristine/ad/adb25c6fe998d19f312cf127b845819361f33fb5.svn-base | ||
|---|---|---|
| 1 |
# encoding: utf-8 |
|
| 2 |
# |
|
| 3 |
# Redmine - project management software |
|
| 4 |
# Copyright (C) 2006-2012 Jean-Philippe Lang |
|
| 5 |
# |
|
| 6 |
# This program is free software; you can redistribute it and/or |
|
| 7 |
# modify it under the terms of the GNU General Public License |
|
| 8 |
# as published by the Free Software Foundation; either version 2 |
|
| 9 |
# of the License, or (at your option) any later version. |
|
| 10 |
# |
|
| 11 |
# This program is distributed in the hope that it will be useful, |
|
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 14 |
# GNU General Public License for more details. |
|
| 15 |
# |
|
| 16 |
# You should have received a copy of the GNU General Public License |
|
| 17 |
# along with this program; if not, write to the Free Software |
|
| 18 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 19 |
|
|
| 20 |
module RolesHelper |
|
| 21 |
end |
|
Also available in: Unified diff