How to prevent users Log time on closed issues?

Added by Dmitriy Perfilyev about 3 years ago

Hi
How I can prevent users Log time on closed issues?

Replies (11)

RE: How to prevent users Log time on closed issues? - Added by Leonel Iturralde about 3 years ago

Im using redmine-3.0.0 and the default role reporter cannot log time on closed issues.

RE: How to prevent users Log time on closed issues? - Added by Dmitriy Perfilyev about 3 years ago

This is because user under the reporter role can not log time on any issues.

RE: How to prevent users Log time on closed issues? - Added by Leonel Iturralde about 3 years ago

Dmitriy Perfilyev wrote:

This is because user under the reporter role can not log time on any issues.

Thank for telling me. Maybe I changed my config but my reporter can log time.

I wrote:

Im using redmine-3.0.0 and the default role reporter cannot log time on closed issues.

I think I got confused with which role the user had the first time. Sorry.

You are right if user has permission to log time it can log time even after the issued is closed.

RE: How to prevent users Log time on closed issues? - Added by Pavel Potcheptsov about 3 years ago

In my case Closed issue has ID 5. Check in the database what ID in your case.
Hope this help. Restart after edit.

===================================================================
--- app/views/issues/_action_menu.html.erb    (revision 13520)
+++ app/views/issues/_action_menu.html.erb    (working copy)
@@ -1,6 +1,8 @@
 <div class="contextual">
-<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
-<%= 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) %>
+<%= link_to l(:button_update), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
+<%= if @issue.status_id != 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)
+end %>
 <%= 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?(:add_issues, @project) %>
 <%= 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) %>
Index: app/views/issues/_edit.html.erb
===================================================================
--- app/views/issues/_edit.html.erb    (revision 13520)
+++ app/views/issues/_edit.html.erb    (working copy)
@@ -9,7 +9,7 @@
         </div>
         </fieldset>
     <% end %>
-    <% if User.current.allowed_to?(:log_time, @project) %>
+    <% if User.current.allowed_to?(:log_time, @project) && @issue.status_id != 5 %>
         <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
         <%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
         <div class="splitcontentleft">

RE: How to prevent users Log time on closed issues? - Added by Dmitriy Perfilyev about 3 years ago

Thank you. It would be more convenient to restrict Log time on closed issues at the controller level

RE: How to prevent users Log time on closed issues? - Added by Shane Coronado over 1 year ago

I've been looking for a more convenient way to prevent users from logging time to closed issues.

RE: How to prevent users Log time on closed issues? - Added by Shane Coronado over 1 year ago

Pavel Potcheptsov wrote:

In my case Closed issue has ID 5. Check in the database what ID in your case.
Hope this help. Restart after edit.
[...]

Thank you Pavel, works as intended!

RE: How to prevent users Log time on closed issues? - Added by ivan perez about 1 year ago

Sorry... but i tried to apply the changes you suggest and i get an internal error :(... i have redmine 3.2.2-0 in spanish

RE: How to prevent users Log time on closed issues? - Added by Jürgen Depicker 12 months ago

Is this not incorrect? Should the behaviour not be that logging time to closed issues is impossible? When I close an issue, I don't want developers to work on it, nor log time...

RE: How to prevent users Log time on closed issues? - Added by Gabriel Alessandria 14 days ago

Hi @Pavel Potcheptsov

I'm from Argentina .. it is an excelent solution to prevent that logging time on closed issues !!

Thanks a lot !

(1-11/11)