summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-06 10:28:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-06 10:28:20 +0000
commit5f8e9d71182040473d4072241ce81fcadada497f (patch)
tree7701b9fed7aed50afd4dbf7fd34ec5ef08d40e5f /app/views
parente1781235696fe23851154ebbdc913e970d3c0f3a (diff)
downloadredmine-5f8e9d71182040473d4072241ce81fcadada497f.tar.gz
redmine-5f8e9d71182040473d4072241ce81fcadada497f.zip
Version sharing (#465) + optional inclusion of subprojects in the roadmap view (#2666).
Each version of a project can be shared with: * subprojects * projects in the project hierarchy: ancestors + descendants (needs versions management permission on the root project) * projects in the project tree: root project + all its descendants (same as above) * all projects (can be set by admin users only) Notes: * when sharing a version of a private project with others projects, its name will be visible within the other projects * a project with versions used by non descendant projects can not be archived git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3123 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/_attributes.rhtml2
-rw-r--r--app/views/issues/bulk_edit.rhtml2
-rw-r--r--app/views/issues/context_menu.rhtml6
-rw-r--r--app/views/projects/activity.rhtml2
-rw-r--r--app/views/projects/changelog.rhtml16
-rw-r--r--app/views/projects/roadmap.rhtml16
-rw-r--r--app/views/projects/settings/_versions.rhtml2
-rw-r--r--app/views/versions/_form.rhtml2
8 files changed, 27 insertions, 21 deletions
diff --git a/app/views/issues/_attributes.rhtml b/app/views/issues/_attributes.rhtml
index b27c56245..b9d17ac81 100644
--- a/app/views/issues/_attributes.rhtml
+++ b/app/views/issues/_attributes.rhtml
@@ -19,7 +19,7 @@
:tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
<% end %>
<% unless @issue.assignable_versions.empty? %>
-<p><%= f.select :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true %></p>
+<p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), :include_blank => true %></p>
<% end %>
</div>
diff --git a/app/views/issues/bulk_edit.rhtml b/app/views/issues/bulk_edit.rhtml
index de82e18ce..f428566b2 100644
--- a/app/views/issues/bulk_edit.rhtml
+++ b/app/views/issues/bulk_edit.rhtml
@@ -31,7 +31,7 @@
<label><%= l(:field_fixed_version) %>:
<%= select_tag('fixed_version_id', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_none), :value => 'none') +
- options_from_collection_for_select(@project.versions.open.sort, :id, :name)) %></label>
+ version_options_for_select(@project.shared_versions.open)) %></label>
</p>
<p>
diff --git a/app/views/issues/context_menu.rhtml b/app/views/issues/context_menu.rhtml
index c67c1bcd5..e408e3b70 100644
--- a/app/views/issues/context_menu.rhtml
+++ b/app/views/issues/context_menu.rhtml
@@ -38,12 +38,12 @@
<% end -%>
</ul>
</li>
- <% unless @project.nil? || @project.versions.open.empty? -%>
+ <% unless @project.nil? || @project.shared_versions.open.empty? -%>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
<ul>
- <% @project.versions.open.sort.each do |v| -%>
- <li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post,
+ <% @project.shared_versions.open.sort.each do |v| -%>
+ <li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post,
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
<% end -%>
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => 'none', :back_to => @back}, :method => :post,
diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml
index efec01f14..03cc8c681 100644
--- a/app/views/projects/activity.rhtml
+++ b/app/views/projects/activity.rhtml
@@ -50,8 +50,8 @@
<br />
<% end %></p>
<% if @project && @project.descendants.active.any? %>
+ <%= hidden_field_tag 'with_subprojects', 0 %>
<p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
- <%= hidden_field_tag 'with_subprojects', 0 %>
<% end %>
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
diff --git a/app/views/projects/changelog.rhtml b/app/views/projects/changelog.rhtml
index a1cd99b7d..0779e069f 100644
--- a/app/views/projects/changelog.rhtml
+++ b/app/views/projects/changelog.rhtml
@@ -6,15 +6,15 @@
<% @versions.each do |version| %>
<%= tag 'a', :name => version.name %>
- <h3 class="icon22 icon22-package"><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></h3>
+ <h3 class="icon22 icon22-package"><%= link_to_version version %></h3>
<% if version.effective_date %>
<p><%= format_date(version.effective_date) %></p>
<% end %>
<p><%=h version.description %></p>
- <% issues = version.fixed_issues.find(:all,
- :include => [:status, :tracker, :priority],
- :conditions => ["#{IssueStatus.table_name}.is_closed=? AND #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})", true],
- :order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty?
+ <% issues = version.fixed_issues.visible.find(:all,
+ :include => [:status, :tracker, :priority],
+ :conditions => ["#{Issue.table_name}.project_id = ? AND #{IssueStatus.table_name}.is_closed=? AND #{Issue.table_name}.tracker_id in (?)", @project.id, true, @selected_tracker_ids],
+ :order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty?
issues ||= []
%>
<% if !issues.empty? %>
@@ -33,11 +33,15 @@
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
<%= tracker.name %></label><br />
<% end %>
+<% if @project.descendants.active.any? %>
+ <%= hidden_field_tag 'with_subprojects', 0 %>
+ <br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
+<% end %>
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
<% end %>
<h3><%= l(:label_version_plural) %></h3>
<% @versions.each do |version| %>
-<%= link_to version.name, :anchor => version.name %><br />
+<%= link_to format_version_name(version), :anchor => version.name %><br />
<% end %>
<% end %>
diff --git a/app/views/projects/roadmap.rhtml b/app/views/projects/roadmap.rhtml
index 00d4a215c..7b0a11dc6 100644
--- a/app/views/projects/roadmap.rhtml
+++ b/app/views/projects/roadmap.rhtml
@@ -6,17 +6,11 @@
<div id="roadmap">
<% @versions.each do |version| %>
<%= tag 'a', :name => version.name %>
- <h3 class="icon22 icon22-package"><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></h3>
+ <h3 class="icon22 icon22-package"><%= link_to_version version %></h3>
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
- <% issues = version.fixed_issues.find(:all,
- :include => [:status, :tracker, :priority],
- :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"],
- :order => "#{Tracker.table_name}.position, #{Issue.table_name}.id") unless @selected_tracker_ids.empty?
- issues ||= []
- %>
- <% if issues.size > 0 %>
+ <% if (issues = @issues_by_version[version]) && issues.size > 0 %>
<fieldset class="related-issues"><legend><%= l(:label_related_issues) %></legend>
<ul>
<%- issues.each do |issue| -%>
@@ -39,12 +33,16 @@
<% end %>
<br />
<label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label>
+<% if @project.descendants.active.any? %>
+ <%= hidden_field_tag 'with_subprojects', 0 %>
+ <br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
+<% end %>
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
<% end %>
<h3><%= l(:label_version_plural) %></h3>
<% @versions.each do |version| %>
-<%= link_to version.name, "##{version.name}" %><br />
+<%= link_to format_version_name(version), "##{version.name}" %><br />
<% end %>
<% end %>
diff --git a/app/views/projects/settings/_versions.rhtml b/app/views/projects/settings/_versions.rhtml
index 9bca58cf7..4fb5e9375 100644
--- a/app/views/projects/settings/_versions.rhtml
+++ b/app/views/projects/settings/_versions.rhtml
@@ -5,6 +5,7 @@
<th><%= l(:field_effective_date) %></th>
<th><%= l(:field_description) %></th>
<th><%= l(:field_status) %></th>
+ <th><%= l(:field_sharing) %></th>
<th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th>
<th style="width:15%"></th>
</thead>
@@ -15,6 +16,7 @@
<td align="center"><%= format_date(version.effective_date) %></td>
<td><%=h version.description %></td>
<td><%= l("version_status_#{version.status}") %></td>
+ <td><%=h format_version_sharing(version.sharing) %></td>
<td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td>
<td class="buttons">
<%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %>
diff --git a/app/views/versions/_form.rhtml b/app/views/versions/_form.rhtml
index 13579b8b6..b829cf2f8 100644
--- a/app/views/versions/_form.rhtml
+++ b/app/views/versions/_form.rhtml
@@ -6,8 +6,10 @@
<p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p>
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p>
<p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p>
+<p><%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p>
<% @version.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :version, value %></p>
<% end %>
+
</div>