]> source.dussan.org Git - redmine.git/commitdiff
Add a link to the cross project time entries page to /projects. #4935
authorEric Davis <edavis@littlestreamsoftware.com>
Sun, 20 Jun 2010 16:29:12 +0000 (16:29 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Sun, 20 Jun 2010 16:29:12 +0000 (16:29 +0000)
Contributed by Jan.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3802 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/projects/index.rhtml
config/locales/de.yml
config/locales/en.yml
test/functional/projects_controller_test.rb

index e47e5524359677e568e6504318aee8d1bbc3d0ff..b4952e90563bcacd27c9f4767be4f1f6742c632f 100644 (file)
@@ -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>
 
index 1337eddf83e63e9d6225cdaf5719c63d3c93258b..0e7e4c074eaf46934e43f23c4645d3f5a367d74c 100644 (file)
@@ -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
index c3fc52eca4dd84587025513f50b45218bc2c6be0..91ef3fa976374ed4718e42dd7b05925466b49017 100644 (file)
@@ -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
index ac639d737c8094e8a52ddd765867f731d1dea0f8..988496cec32ad11e6be1aad8fd4489742903241c 100644 (file)
@@ -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