diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-05 13:45:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-05 13:45:10 +0000 |
commit | c4fd1750f703a7649f0b3b52b25cf32fa532b5b3 (patch) | |
tree | f94e5de3b00a6eb8c2b6741f847c2bb8d75625f7 /app/views | |
parent | a23450fe08f367a1d4a03e937c3f8e90f83383fe (diff) | |
download | redmine-c4fd1750f703a7649f0b3b52b25cf32fa532b5b3.tar.gz redmine-c4fd1750f703a7649f0b3b52b25cf32fa532b5b3.zip |
Adds permission to edit and delete issues by role/tracker (#285).
git-svn-id: http://svn.redmine.org/redmine/trunk@15466 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/issues/_action_menu.html.erb | 2 | ||||
-rw-r--r-- | app/views/issues/_edit.html.erb | 29 | ||||
-rw-r--r-- | app/views/issues/_history.html.erb | 2 | ||||
-rw-r--r-- | app/views/issues/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/roles/_form.html.erb | 7 |
5 files changed, 23 insertions, 19 deletions
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index c3304626d..b535faec9 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -3,5 +3,5 @@ <%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %> <%= watcher_link(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %> -<%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> +<%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if @issue.deletable? %> </div> diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index 24a01cad0..67e33246d 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -27,21 +27,22 @@ <% end %> </fieldset> <% end %> - - <fieldset><legend><%= l(:field_notes) %></legend> - <%= f.text_area :notes, :cols => 60, :rows => 10, :class => 'wiki-edit', :no_label => true %> - <%= wikitoolbar_for 'issue_notes' %> - - <% if @issue.safe_attribute? 'private_notes' %> - <%= f.check_box :private_notes, :no_label => true %> <label for="issue_private_notes"><%= l(:field_private_notes) %></label> + <% if @issue.notes_addable? %> + <fieldset><legend><%= l(:field_notes) %></legend> + <%= f.text_area :notes, :cols => 60, :rows => 10, :class => 'wiki-edit', :no_label => true %> + <%= wikitoolbar_for 'issue_notes' %> + + <% if @issue.safe_attribute? 'private_notes' %> + <%= f.check_box :private_notes, :no_label => true %> <label for="issue_private_notes"><%= l(:field_private_notes) %></label> + <% end %> + + <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %> + </fieldset> + + <fieldset><legend><%= l(:label_attachment_plural) %></legend> + <p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p> + </fieldset> <% end %> - - <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %> - </fieldset> - - <fieldset><legend><%= l(:label_attachment_plural) %></legend> - <p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p> - </fieldset> </div> <%= f.hidden_field :lock_version %> diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb index 993dfee3c..307ac909b 100644 --- a/app/views/issues/_history.html.erb +++ b/app/views/issues/_history.html.erb @@ -1,4 +1,4 @@ -<% reply_links = authorize_for('issues', 'edit') -%> +<% reply_links = issue.notes_addable? -%> <% for journal in journals %> <div id="change-<%= journal.id %>" class="<%= journal.css_classes %>"> <div id="note-<%= journal.indice %>"> diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 70a7fe165..2cbff32e5 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -77,7 +77,7 @@ end %> <% if @issue.description? %> <div class="description"> <div class="contextual"> - <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if @issue.notes_addable? %> </div> <p><strong><%=l(:field_description)%></strong></p> diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index c8a3a61cc..8b7b94c73 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -64,7 +64,9 @@ <div id="role-permissions-trackers"> <h3><%= l(:label_issue_tracking) %></h3> -<% permissions = %w(view_issues add_issues) %> +<% permissions = %w(view_issues add_issues edit_issues add_issue_notes delete_issues) %> + +<div class="autoscroll"> <table class="list"> <thead> <tr> @@ -87,7 +89,7 @@ <% end %> </tr> <% Tracker.sorted.all.each do |tracker| %> - <tr> + <tr class="<%= cycle("odd", "even") %>"> <td class="name"><%= tracker.name %></td> <% permissions.each do |permission| %> <td><%= check_box_tag "role[permissions_tracker_ids][#{permission}][]", @@ -100,6 +102,7 @@ <% end %> </tbody> </table> +</div> <% permissions.each do |permission| %> <%= hidden_field_tag "role[permissions_tracker_ids][#{permission}][]", '' %> |