summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-06-20 16:29:12 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-06-20 16:29:12 +0000
commit116c7a7964d6bd8842a11d48ec9e7995d931e710 (patch)
tree3c114c4880ac8e0a3ef149f349947888b40da36f
parent4083e7e62270186d61782eec7e5861cee89e2619 (diff)
downloadredmine-116c7a7964d6bd8842a11d48ec9e7995d931e710.tar.gz
redmine-116c7a7964d6bd8842a11d48ec9e7995d931e710.zip
Add a link to the cross project time entries page to /projects. #4935
Contributed by Jan. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3802 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/projects/index.rhtml1
-rw-r--r--config/locales/de.yml1
-rw-r--r--config/locales/en.yml1
-rw-r--r--test/functional/projects_controller_test.rb27
4 files changed, 30 insertions, 0 deletions
diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml
index e47e55243..b4952e905 100644
--- a/app/views/projects/index.rhtml
+++ b/app/views/projects/index.rhtml
@@ -5,6 +5,7 @@
<div class="contextual">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
<%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
+ <%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
<%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%>
</div>
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 1337eddf8..0e7e4c074 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -646,6 +646,7 @@ de:
label_changes_details: Details aller Ă„nderungen
label_issue_tracking: Tickets
label_spent_time: Aufgewendete Zeit
+ label_overall_spent_time: Aufgewendete Zeit aller Projekte anzeigen
label_f_hour: "{{value}} Stunde"
label_f_hour_plural: "{{value}} Stunden"
label_time_tracking: Zeiterfassung
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c3fc52eca..91ef3fa97 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -638,6 +638,7 @@ en:
label_changes_details: Details of all changes
label_issue_tracking: Issue tracking
label_spent_time: Spent time
+ label_overall_spent_time: Overall spent time
label_f_hour: "{{value}} hour"
label_f_hour_plural: "{{value}} hours"
label_time_tracking: Time tracking
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index ac639d737..988496cec 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -60,6 +60,33 @@ class ProjectsControllerTest < ActionController::TestCase
assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_by(User.current))
end
+ context "#index" do
+ context "by non-admin user with view_time_entries permission" do
+ setup do
+ @request.session[:user_id] = 3
+ end
+ should "show overall spent time link" do
+ get :index
+ assert_template 'index'
+ assert_tag :a, :attributes => {:href => '/time_entries'}
+ end
+ end
+
+ context "by non-admin user without view_time_entries permission" do
+ setup do
+ Role.find(2).remove_permission! :view_time_entries
+ Role.non_member.remove_permission! :view_time_entries
+ Role.anonymous.remove_permission! :view_time_entries
+ @request.session[:user_id] = 3
+ end
+ should "not show overall spent time link" do
+ get :index
+ assert_template 'index'
+ assert_no_tag :a, :attributes => {:href => '/time_entries'}
+ end
+ end
+ end
+
context "#add" do
context "by admin user" do
setup do