From 6659aad3ef651b714a66d648cef2f25e3fff8516 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 30 May 2015 07:40:57 +0000 Subject: Adds a role setting that viewing all or own time entries (#8929). git-svn-id: http://svn.redmine.org/redmine/trunk@14275 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/issues/show.html.erb | 2 +- app/views/projects/_sidebar.html.erb | 6 ++++-- app/views/roles/_form.html.erb | 4 ++++ app/views/versions/show.html.erb | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 2065ce3b3..b91b512a3 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -62,7 +62,7 @@ rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), :class => 'estimated-hours' end end - if User.current.allowed_to?(:view_time_entries, @project) + if User.current.allowed_to_view_all_time_entries?(@project) if @issue.total_spent_hours > 0 rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time' end diff --git a/app/views/projects/_sidebar.html.erb b/app/views/projects/_sidebar.html.erb index 0f5c24186..803686ae1 100644 --- a/app/views/projects/_sidebar.html.erb +++ b/app/views/projects/_sidebar.html.erb @@ -1,6 +1,8 @@ -<% if @total_hours.present? %> +<% if User.current.allowed_to?(:view_time_entries, @project) %>

<%= l(:label_spent_time) %>

-

<%= l_hours(@total_hours) %>

+ <% if @total_hours.present? %> +

<%= l_hours(@total_hours) %>

+ <% end %>

<% if User.current.allowed_to?(:log_time, @project) %> <%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> | diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 1d4ce3a2a..03cbe58d2 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -10,6 +10,10 @@

<%= f.select :issues_visibility, Role::ISSUES_VISIBILITY_OPTIONS.collect {|v| [l(v.last), v.first]} %>

<% end %> + <% unless @role.anonymous? %> +

<%= f.select :time_entries_visibility, Role::TIME_ENTRIES_VISIBILITY_OPTIONS.collect {|v| [l(v.last), v.first]} %>

+ <% end %> +

<%= f.select :users_visibility, Role::USERS_VISIBILITY_OPTIONS.collect {|v| [l(v.last), v.first]} %>

<% if @role.new_record? && @roles.any? %> diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index d05729e51..0a45b9c84 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -19,7 +19,7 @@ <%= l(:field_estimated_hours) %> <%= html_hours(l_hours(@version.estimated_hours)) %> -<% if User.current.allowed_to?(:view_time_entries, @project) %> +<% if User.current.allowed_to_view_all_time_entries?(@project) %> <%= l(:label_spent_time) %> <%= html_hours(l_hours(@version.spent_hours)) %> -- cgit v1.2.3