<% i = 0 %>
-<% split_on = (@issue.custom_field_values.size / 2.0).ceil - 1 %>
+<% split_on = (@issue.editable_custom_field_values.size / 2.0).ceil - 1 %>
<% @issue.editable_custom_field_values.each do |value| %>
<%= custom_field_tag_with_label :issue, value, :required => @issue.required_attribute?(value.custom_field_id) %>
<% if i == split_on -%>
Index: app/views/issues/_history.html.erb
===================================================================
--- app/views/issues/_history.html.erb (revision 10764)
+++ app/views/issues/_history.html.erb (working copy)
@@ -1,22 +1,24 @@
<% reply_links = authorize_for('issues', 'edit') -%>
<% for journal in journals %>
-
-
-
<%= link_to "##{journal.indice}", {:anchor => "note-#{journal.indice}"}, :class => "journal-link" %>
- <%= avatar(journal.user, :size => "24") %>
- <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
-
- <% if journal.details.any? %>
-
- <% details_to_strings(journal.details).each do |string| %>
- - <%= string %>
+ <% if details_to_strings(journal.details).any? || journal.notes.blank? == false %>
+
+
+
<%= link_to "##{journal.indice}", {:anchor => "note-#{journal.indice}"}, :class => "journal-link" %>
+ <%= avatar(journal.user, :size => "24") %>
+ <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
+
+ <% if journal.details.any? %>
+
+ <% details_to_strings(journal.details).each do |string| %>
+ - <%= string %>
+ <% end %>
+
<% end %>
-
- <% end %>
- <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
+ <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
+
-
- <%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
+ <%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
+ <% end %>
<% end %>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>
Index: app/views/issues/show.html.erb
===================================================================
--- app/views/issues/show.html.erb (revision 10764)
+++ app/views/issues/show.html.erb (working copy)
@@ -33,29 +33,33 @@
<%= issue_fields_rows do |rows|
- rows.left l(:field_status), h(@issue.status.name), :class => 'status'
- rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
+ unless @issue.hidden_attribute?('status')
+ rows.left l(:field_status), h(@issue.status.name), :class => 'status'
+ end
+ unless @issue.hidden_attribute?('priority')
+ rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
+ end
- unless @issue.disabled_core_fields.include?('assigned_to_id')
+ unless @issue.disabled_core_fields.include?('assigned_to_id') || @issue.hidden_attribute?('assigned_to_id')
rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
end
- unless @issue.disabled_core_fields.include?('category_id')
+ unless @issue.disabled_core_fields.include?('category_id') || @issue.hidden_attribute?('category_id')
rows.left l(:field_category), h(@issue.category ? @issue.category.name : "-"), :class => 'category'
end
- unless @issue.disabled_core_fields.include?('fixed_version_id')
+ unless @issue.disabled_core_fields.include?('fixed_version_id') || @issue.hidden_attribute?('fixed_version_id')
rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version'
end
- unless @issue.disabled_core_fields.include?('start_date')
+ unless @issue.disabled_core_fields.include?('start_date') || @issue.hidden_attribute?('start_date')
rows.right l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
end
- unless @issue.disabled_core_fields.include?('due_date')
+ unless @issue.disabled_core_fields.include?('due_date') || @issue.hidden_attribute?('due_date')
rows.right l(:field_due_date), format_date(@issue.due_date), :class => 'due-date'
end
- unless @issue.disabled_core_fields.include?('done_ratio')
+ unless @issue.disabled_core_fields.include?('done_ratio') || @issue.hidden_attribute?('done_ratio')
rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
end
- unless @issue.disabled_core_fields.include?('estimated_hours')
+ unless @issue.disabled_core_fields.include?('estimated_hours') || @issue.hidden_attribute?('estimated_hours')
unless @issue.estimated_hours.nil?
rows.right l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
end
Index: app/views/mailer/_issue.html.erb
===================================================================
--- app/views/mailer/_issue.html.erb (revision 10764)
+++ app/views/mailer/_issue.html.erb (working copy)
@@ -2,13 +2,25 @@
- <%=l(:field_author)%>: <%=h issue.author %>
-- <%=l(:field_status)%>: <%=h issue.status %>
-- <%=l(:field_priority)%>: <%=h issue.priority %>
-- <%=l(:field_assigned_to)%>: <%=h issue.assigned_to %>
-- <%=l(:field_category)%>: <%=h issue.category %>
-- <%=l(:field_fixed_version)%>: <%=h issue.fixed_version %>
+<% unless issue.hidden_attribute?('status', user) %>
+ - <%=l(:field_status)%>: <%=h issue.status %>
+<% end %>
+<% unless issue.hidden_attribute?('priority', user) %>
+ - <%=l(:field_priority)%>: <%=h issue.priority %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('assigned_to_id') || issue.hidden_attribute?('assigned_to_id', user) %>
+ - <%=l(:field_assigned_to)%>: <%=h issue.assigned_to %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('category_id') || issue.hidden_attribute?('category_id', user) %>
+ - <%=l(:field_category)%>: <%=h issue.category %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('fixed_version_id') || issue.hidden_attribute?('fixed_version_id', user) %>
+ - <%=l(:field_fixed_version)%>: <%=h issue.fixed_version %>
+<% end %>
<% issue.custom_field_values.each do |c| %>
- - <%=h c.custom_field.name %>: <%=h show_value(c) %>
+ <% unless issue.hidden_attribute?(c.custom_field.id, user) %>
+ - <%=h c.custom_field.name %>: <%=h show_value(c) %>
+ <% end %>
<% end %>
Index: app/views/mailer/_issue.text.erb
===================================================================
--- app/views/mailer/_issue.text.erb (revision 10764)
+++ app/views/mailer/_issue.text.erb (working copy)
@@ -2,12 +2,25 @@
<%= issue_url %>
* <%=l(:field_author)%>: <%= issue.author %>
+<% unless issue.hidden_attribute?('status', user) %>
* <%=l(:field_status)%>: <%= issue.status %>
+<% end %>
+<% unless issue.hidden_attribute?('priority', user) %>
* <%=l(:field_priority)%>: <%= issue.priority %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('assigned_to_id') || issue.hidden_attribute?('assigned_to_id', user) %>
* <%=l(:field_assigned_to)%>: <%= issue.assigned_to %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('category_id') || issue.hidden_attribute?('category_id', user) %>
* <%=l(:field_category)%>: <%= issue.category %>
+<% end %>
+<% unless issue.disabled_core_fields.include?('fixed_version_id') || issue.hidden_attribute?('fixed_version_id', user) %>
* <%=l(:field_fixed_version)%>: <%= issue.fixed_version %>
-<% issue.custom_field_values.each do |c| %>* <%= c.custom_field.name %>: <%= show_value(c) %>
+<% end %>
+<% issue.custom_field_values.each do |c| %>
+<% unless issue.hidden_attribute?(c.custom_field.id, user) %>
+* <%= c.custom_field.name %>: <%= show_value(c) %>
+<% end %>
<% end -%>
----------------------------------------
<%= issue.description %>
Index: app/views/mailer/issue_add.html.erb
===================================================================
--- app/views/mailer/issue_add.html.erb (revision 10764)
+++ app/views/mailer/issue_add.html.erb (working copy)
@@ -1,3 +1,3 @@
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => h(@issue.author)) %>
-<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
+<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url, :user => @auser } %>
Index: app/views/mailer/issue_add.text.erb
===================================================================
--- app/views/mailer/issue_add.text.erb (revision 10764)
+++ app/views/mailer/issue_add.text.erb (working copy)
@@ -1,4 +1,4 @@
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => @issue.author) %>
----------------------------------------
-<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
+<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url, :user => @auser } %>
Index: app/views/mailer/issue_edit.html.erb
===================================================================
--- app/views/mailer/issue_edit.html.erb (revision 10764)
+++ app/views/mailer/issue_edit.html.erb (working copy)
@@ -1,11 +1,11 @@
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@journal.user)) %>
-<% details_to_strings(@journal.details, false, :only_path => false).each do |string| %>
+<% details_to_strings(@journal.details, false, :only_path => false, :user => @auser).each do |string| %>
- <%= string %>
<% end %>
<%= textilizable(@journal, :notes, :only_path => false) %>
-<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
+<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url, :user => @auser } %>
Index: app/views/mailer/issue_edit.text.erb
===================================================================
--- app/views/mailer/issue_edit.text.erb (revision 10764)
+++ app/views/mailer/issue_edit.text.erb (working copy)
@@ -1,6 +1,6 @@
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
-<% details_to_strings(@journal.details, true).each do |string| -%>
+<% details_to_strings(@journal.details, true, :user => @auser).each do |string| -%>
<%= string %>
<% end -%>
@@ -9,4 +9,4 @@
<% end -%>
----------------------------------------
-<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
+<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url, :user => @auser } %>
Index: config/locales/en.yml
===================================================================
--- config/locales/en.yml (revision 10764)
+++ config/locales/en.yml (working copy)
@@ -879,6 +879,7 @@
label_fields_permissions: Fields permissions
label_readonly: Read-only
label_required: Required
+ label_hidden: " Hidden "
label_attribute_of_project: "Project's %{name}"
label_attribute_of_author: "Author's %{name}"
label_attribute_of_assigned_to: "Assignee's %{name}"
Index: lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
===================================================================
--- lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb (revision 10764)
+++ lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb (working copy)
@@ -78,6 +78,17 @@
notified.collect(&:mail).compact
end
+ # Returns an array of watchers
+ def watcher_recipient_users
+ notified = watcher_users.active
+ notified.reject! {|user| user.mail_notification == 'none'}
+
+ if respond_to?(:visible?)
+ notified.reject! {|user| !visible?(user)}
+ end
+ notified
+ end
+
module ClassMethods; end
end
end
Index: lib/redmine/export/pdf.rb
===================================================================
--- lib/redmine/export/pdf.rb (revision 10764)
+++ lib/redmine/export/pdf.rb (working copy)
@@ -520,17 +520,17 @@
pdf.Ln
left = []
- left << [l(:field_status), issue.status]
- left << [l(:field_priority), issue.priority]
- left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?('assigned_to_id')
- left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?('category_id')
- left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id')
+ left << [l(:field_status), issue.status] unless issue.hidden_attribute?('status')
+ left << [l(:field_priority), issue.priority] unless issue.hidden_attribute?('priority')
+ left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?('assigned_to_id') or issue.hidden_attribute?('assigned_to_id')
+ left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?('category_id') or issue.hidden_attribute?('category_id')
+ left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id') or issue.hidden_attribute?('fixed_version_id')
right = []
- right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date')
- right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?('due_date')
- right << [l(:field_done_ratio), "#{issue.done_ratio}%"] unless issue.disabled_core_fields.include?('done_ratio')
- right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?('estimated_hours')
+ right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date') or issue.hidden_attribute?('start_date')
+ right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?('due_date') or issue.hidden_attribute?('due_date')
+ right << [l(:field_done_ratio), "#{issue.done_ratio}%"] unless issue.disabled_core_fields.include?('done_ratio') or issue.hidden_attribute?('done_ratio')
+ right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?('estimated_hours') or issue.hidden_attribute?('estimated_hours')
right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)
rows = left.size > right.size ? left.size : right.size
@@ -541,9 +541,9 @@
right << nil
end
- half = (issue.custom_field_values.size / 2.0).ceil
- issue.custom_field_values.each_with_index do |custom_value, i|
- (i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value)]
+ half = (issue.viewable_custom_field_values.size / 2.0).ceil
+ issue.viewable_custom_field_values.each_with_index do |custom_value, i|
+ (i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value)] unless issue.hidden_attribute?(custom_value.custom_field.name)
end
rows = left.size > right.size ? left.size : right.size