]> source.dussan.org Git - redmine.git/commitdiff
Project activity view now only shows what the user is allowed to view.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 24 Sep 2007 17:33:24 +0000 (17:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 24 Sep 2007 17:33:24 +0000 (17:33 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@757 e93f8b46-1217-0410-a6f0-8f06a7374b81

14 files changed:
app/controllers/projects_controller.rb
lang/bg.yml
lang/de.yml
lang/en.yml
lang/es.yml
lang/fr.yml
lang/it.yml
lang/ja.yml
lang/nl.yml
lang/pl.yml
lang/pt-br.yml
lang/pt.yml
lang/sv.yml
lang/zh.yml

index 2c9a441c9c44612567e2f40386045d8f5ff9d0ca..284ac565562f5335c92a14202e9ee93f6bc33ee5 100644 (file)
@@ -446,13 +446,15 @@ class ProjectsController < ApplicationController
       @date_to = @date_from >> 1
     end
     
-    @event_types = %w(issues news attachments documents wiki_edits revisions)
-    @event_types.delete('wiki_edits') unless @project.wiki
+    @event_types = %w(issues news files documents wiki_pages changesets)
+    @event_types.delete('wiki_pages') unless @project.wiki
     @event_types.delete('changesets') unless @project.repository
+    # only show what the user is allowed to view
+    @event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
     
     @scope = @event_types.select {|t| params["show_#{t}"]}
     # default events if none is specified in parameters
-    @scope = (@event_types - %w(wiki_edits))if @scope.empty?
+    @scope = (@event_types - %w(wiki_pages))if @scope.empty?
     
     @events = []    
     
@@ -464,7 +466,7 @@ class ProjectsController < ApplicationController
       @events += @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author )
     end
     
-    if @scope.include?('attachments')
+    if @scope.include?('files')
       @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
     end
     
@@ -473,7 +475,7 @@ class ProjectsController < ApplicationController
       @events += Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
     end
     
-    if @scope.include?('wiki_edits') && @project.wiki
+    if @scope.include?('wiki_pages')
       select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
                "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title, " +
                "#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
@@ -486,7 +488,7 @@ class ProjectsController < ApplicationController
       @events += WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions)
     end
 
-    if @scope.include?('revisions') && @project.repository
+    if @scope.include?('changesets')
       @events += @project.repository.changesets.find(:all, :conditions => ["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to])
     end
     
index d557f0f6b77d9233089aed76f75af8390e3ffa78..419318604e2e58ce001ccb86ec6831b3a9467abc 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Разработка
 enumeration_issue_priorities: Приоритети на задачи
 enumeration_doc_categories: Категории документи
 enumeration_activities: Дейности (time tracking)
+label_file_plural: Files
+label_changeset_plural: Changesets
index feb004142665bc73b75f797949b85baac2b95fd4..875639e90d9ffe06ca5a6c431f3ec0f3fb133237 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Development
 enumeration_issue_priorities: Ticket-Prioritäten
 enumeration_doc_categories: Dokumentenkategorien
 enumeration_activities: Aktivitäten (Zeiterfassung)
+label_file_plural: Files
+label_changeset_plural: Changesets
index fb7cfb4032cdf7f8241587684ddfd3388a3adbe8..4b3537f0aa8039a505f9738eaee03517ea0d21b7 100644 (file)
@@ -420,6 +420,8 @@ label_module_plural: Modules
 label_added_time_by: Added by %s %s ago
 label_updated_time: Updated %s ago
 label_jump_to_a_project: Jump to a project...
+label_file_plural: Files
+label_changeset_plural: Changesets
 
 button_login: Login
 button_submit: Submit
index 646b35395a545cd6140f1f048986abfa182572d3..7b6253044db3fb4680b4eb7f6128d989facff1c6 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Development
 enumeration_issue_priorities: Prioridad de las peticiones
 enumeration_doc_categories: Categorías del documento
 enumeration_activities: Activities (time tracking)
+label_file_plural: Files
+label_changeset_plural: Changesets
index d98353ef3e08c250f12a6c6a67bff3ae1e6e7dd9..d6b7fb4e7f388a938337431f7eb1e308a0a3c1a5 100644 (file)
@@ -420,6 +420,8 @@ label_module_plural: Modules
 label_added_time_by: Ajouté par %s il y a %s
 label_updated_time: Mis à jour il y a %s
 label_jump_to_a_project: Aller à un projet...
+label_file_plural: Fichiers
+label_changeset_plural: Révisions
 
 button_login: Connexion
 button_submit: Soumettre
index b1d8c85a9231685a073af2db1f353a76bac170d0..09c320cede0e51e180efe065fada84634dc528b1 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Development
 enumeration_issue_priorities: Priorità contesti
 enumeration_doc_categories: Categorie di documenti
 enumeration_activities: Attività (time tracking)
+label_file_plural: Files
+label_changeset_plural: Changesets
index f4f3937602b0be522f282aaed5eaeec0a6bf49fe..c278babafd7bdbad64c62b14d2b18121bcc1c808 100644 (file)
@@ -510,3 +510,5 @@ default_activity_development: 開発作業
 enumeration_issue_priorities: 問題の優先度
 enumeration_doc_categories: 文書カテゴリ
 enumeration_activities: 作業分類 (時間トラッキング)
+label_file_plural: Files
+label_changeset_plural: Changesets
index 623717af93ef75a8c2fd41c5969f5df626d1684f..80c6bd07aa3df9a33ce125b96f2bd0cdc6508eca 100644 (file)
@@ -510,3 +510,5 @@ enumeration_issue_priorities: Issue prioriteiten
 enumeration_doc_categories: Document categorieën
 enumeration_activities: Activiteiten (tijd tracking)
 text_comma_separated: Multiple values allowed (comma separated).
+label_file_plural: Files
+label_changeset_plural: Changesets
index 184e33d252b1d73f7a74b2dd484a94c661a5711e..101e746755e8525ad466624453c5948a4ca05cb5 100644 (file)
@@ -509,3 +509,5 @@ label_send_test_email: Send a test email
 button_reset: Reset
 label_added_time_by: Added by %s %s ago
 field_estimated_hours: Estimated time
+label_file_plural: Files
+label_changeset_plural: Changesets
index b4f7dd3d52fd628ef7c89b5dba5248ee59bc2d33..a260fef83e0061973782b0ba6791ff11829b3c89 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Desenvolvimento
 enumeration_issue_priorities: Prioridade das tarefas\r
 enumeration_doc_categories: Categorias de documento\r
 enumeration_activities: Atividades (time tracking)\r
+label_file_plural: Files\r
+label_changeset_plural: Changesets\r
index f1ba45f6622f57761f40f9bc4fffbce6ae5486bf..370c0255116923401310d5e0f3eb1c0c0e829c87 100644 (file)
@@ -509,3 +509,5 @@ default_activity_development: Desenvolvimento
 enumeration_issue_priorities: Prioridade das tarefas
 enumeration_doc_categories: Categorias de documento
 enumeration_activities: Atividades (time tracking)
+label_file_plural: Files
+label_changeset_plural: Changesets
index e2d86a23d4c5d74a18d79917955cda8f45fd7776..f9dae406624e00352ee1b6e630c01ac01fe5c45c 100644 (file)
@@ -510,3 +510,5 @@ enumeration_issue_priorities: Bristprioriteringar
 enumeration_doc_categories: Dokumentkategorier
 enumeration_activities: Aktiviteter (tidsspårning)
 field_comments: Comment
+label_file_plural: Files
+label_changeset_plural: Changesets
index 0cbd27a83b0328b825674aca4bed6e4d4441db92..b1e62f39d6e6a46e68f34f9910aed81cb104723d 100644 (file)
@@ -512,3 +512,5 @@ enumeration_issue_priorities: 任务优先级
 enumeration_doc_categories: 文档类别
 enumeration_activities: Activities (time tracking)
 label_wiki_page: Wiki page
+label_file_plural: Files
+label_changeset_plural: Changesets