From 3269c10fc6392ff0e6f1d05996ef80309de718ad Mon Sep 17 00:00:00 2001 From: aaronmueller Date: Wed, 3 Mar 2010 15:45:58 +0100 Subject: [PATCH] Add feature to automatically archive old projects * Request /sys/mark_all_inactive_projects and status for all inactive projects (no activity since one month) are changed to STATUS_INACTIVE. * All users which has permissions to reactivate project receive a mail notification with a reactivate URL. * If user clicks link in mail project status changes to active. * Request /sys/archive_inactive_projects and all inactive projects will be archived. (STATUS_ARCHIVED). Exceptions: * projects newer than a month are not affected * if project has activity since mail it will not be archived and will be set as STATUS_ACTIVE. --- app/controllers/projects_controller.rb | 14 ++++++++++- app/controllers/sys_controller.rb | 25 ++++++++++++++++++++ app/models/mailer.rb | 11 ++++++++- app/models/principal.rb | 2 +- app/models/project.rb | 22 +++++++++++------ app/views/mailer/inactive_reminder.text.html.rhtml | 2 + .../mailer/inactive_reminder.text.plain.rhtml | 2 + config/locales/bg.yml | 7 ++++- config/locales/bs.yml | 5 ++++ config/locales/ca.yml | 5 ++++ config/locales/cs.yml | 5 ++++ config/locales/da.yml | 5 ++++ config/locales/de.yml | 9 +++++++ config/locales/el.yml | 5 ++++ config/locales/en.yml | 5 ++++ config/locales/es.yml | 5 ++++ config/locales/fi.yml | 5 ++++ config/locales/fr.yml | 5 ++++ config/locales/gl.yml | 5 ++++ config/locales/he.yml | 5 ++++ config/locales/hr.yml | 5 ++++ config/locales/hu.yml | 5 ++++ config/locales/id.yml | 5 ++++ config/locales/it.yml | 6 ++++- config/locales/ja.yml | 5 ++++ config/locales/ko.yml | 5 ++++ config/locales/lt.yml | 5 ++++ config/locales/nl.yml | 5 ++++ config/locales/no.yml | 5 ++++ config/locales/pl.yml | 5 ++++ config/locales/pt-BR.yml | 5 ++++ config/locales/pt.yml | 5 ++++ config/locales/ro.yml | 5 ++++ config/locales/ru.yml | 5 ++++ config/locales/sk.yml | 5 ++++ config/locales/sl.yml | 5 ++++ config/locales/sr.yml | 5 ++++ config/locales/sv.yml | 5 ++++ config/locales/th.yml | 5 ++++ config/locales/tr.yml | 5 ++++ config/locales/uk.yml | 5 ++++ config/locales/vi.yml | 5 ++++ config/locales/zh-TW.yml | 5 ++++ config/locales/zh.yml | 6 ++++- config/routes.rb | 1 + lib/redmine.rb | 1 + 46 files changed, 259 insertions(+), 14 deletions(-) create mode 100644 app/views/mailer/inactive_reminder.text.html.rhtml create mode 100644 app/views/mailer/inactive_reminder.text.plain.rhtml diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ec22e22..3ea62a5 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -91,7 +91,7 @@ class ProjectsController < ApplicationController @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position") @trackers = Tracker.all @root_projects = Project.find(:all, - :conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}", + :conditions => "parent_id IS NULL AND status < #{Project::STATUS_ARCHIVED}", :order => 'name') @source_project = Project.find(params[:id]) if request.get? @@ -371,6 +371,18 @@ class ProjectsController < ApplicationController rescue ActiveRecord::RecordNotFound render_404 end + + def reactivate + @project = Project.find(params[:id]) + if @project.status == Project::STATUS_INACTIVE + @project.status = Project::STATUS_ACTIVE + @project.save! + flash[:notice] = l(:notice_successful_reactivate) + else + flash[:error] = l(:error_failed_to_reactivate) + end + redirect_to(:controller => 'projects', :action => 'show', :id => @project) + end private # Find project of id params[:id] diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb index be88eb2..5203e22 100644 --- a/app/controllers/sys_controller.rb +++ b/app/controllers/sys_controller.rb @@ -55,6 +55,31 @@ class SysController < ActionController::Base render :nothing => true, :status => 404 end + def mark_all_inactive_projects + date = Time.now.last_month + (Project.active.select { |p| !p.active_since?(date) && p.created_on < date && p.descendants.size == 0 }).each do |p| + p.status = Project::STATUS_INACTIVE + (p.principals.select {|user| user.allowed_to?(:reactivate_project, p)}).each do |u| + Mailer.deliver_inactive_reminder(u, p) + end + p.save + end + render :nothing => true, :status => 200 + end + + def archive_inactive_projects + date = Time.now.last_month + Project.find(:all, :conditions => {:status => Project::STATUS_INACTIVE}).each do |p| + if p.active_since?(date) + p.status = Project::STATUS_ACTIVE + else + p.archive + end + p.save + end + render :nothing => true, :status => 200 + end + protected def check_enabled diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 9c409af..e6ca23b 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -299,7 +299,7 @@ class Mailer < ActionMailer::Base s = ARCondition.new ["#{IssueStatus.table_name}.is_closed = ? AND #{Issue.table_name}.due_date <= ?", false, days.day.from_now.to_date] s << "#{Issue.table_name}.assigned_to_id IS NOT NULL" - s << "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}" + s << "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED}" s << "#{Issue.table_name}.project_id = #{project.id}" if project s << "#{Issue.table_name}.tracker_id = #{tracker.id}" if tracker @@ -311,6 +311,15 @@ class Mailer < ActionMailer::Base end end + def inactive_reminder(user, project) + set_language_if_valid(user.language) + recipients user.mail + subject "[#{Setting.app_title.to_s} - #{l(:mail_subject_project_activity_warning)}] #{project.name}" + body :project => project, + :url => url_for(:controller => 'projects', :action => 'reactivate', :id => project) + render_multipart('inactive_reminder', body) + end + private def initialize_defaults(method_name) super diff --git a/app/models/principal.rb b/app/models/principal.rb index f468542..164d713 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -19,7 +19,7 @@ class Principal < ActiveRecord::Base set_table_name 'users' has_many :members, :foreign_key => 'user_id', :dependent => :destroy - has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name" + has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED}", :order => "#{Project.table_name}.name" has_many :projects, :through => :memberships # Groups and active users diff --git a/app/models/project.rb b/app/models/project.rb index 53b7ee9..b806f52 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -18,6 +18,7 @@ class Project < ActiveRecord::Base # Project statuses STATUS_ACTIVE = 1 + STATUS_INACTIVE = 5 STATUS_ARCHIVED = 9 # Specific overidden Activities @@ -77,7 +78,7 @@ class Project < ActiveRecord::Base before_destroy :delete_all_members, :destroy_children named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } } - named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"} + named_scope :active, { :conditions => "#{Project.table_name}.status < #{STATUS_ARCHIVED}"} named_scope :all_public, { :conditions => { :is_public => true } } named_scope :visible, lambda { { :conditions => Project.visible_by(User.current) } } @@ -103,17 +104,17 @@ class Project < ActiveRecord::Base def self.visible_by(user=nil) user ||= User.current if user && user.admin? - return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}" + return "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED}" elsif user && user.memberships.any? - return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))" + return "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))" else - return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = #{connection.quoted_true}" + return "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED} AND #{Project.table_name}.is_public = #{connection.quoted_true}" end end def self.allowed_to_condition(user, permission, options={}) statements = [] - base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}" + base_statement = "#{Project.table_name}.status < #{Project::STATUS_ARCHIVED}" if perm = Redmine::AccessControl.permission(permission) unless perm.project_module.nil? # If the permission belongs to a project module, make sure the module is enabled @@ -217,7 +218,7 @@ class Project < ActiveRecord::Base end def active? - self.status == STATUS_ACTIVE + self.status < STATUS_ARCHIVED end # Archives the project and its descendants @@ -322,7 +323,7 @@ class Project < ActiveRecord::Base @rolled_up_trackers ||= Tracker.find(:all, :include => :projects, :select => "DISTINCT #{Tracker.table_name}.*", - :conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ? AND #{Project.table_name}.status = #{STATUS_ACTIVE}", lft, rgt], + :conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ? AND #{Project.table_name}.status < #{STATUS_ARCHIVED}", lft, rgt], :order => "#{Tracker.table_name}.position") end @@ -342,7 +343,7 @@ class Project < ActiveRecord::Base @shared_versions ||= Version.scoped(:include => :project, :conditions => "#{Project.table_name}.id = #{id}" + - " OR (#{Project.table_name}.status = #{Project::STATUS_ACTIVE} AND (" + + " OR (#{Project.table_name}.status < #{Project::STATUS_ARCHIVED} AND (" + " #{Version.table_name}.sharing = 'system'" + " OR (#{Project.table_name}.lft >= #{root.lft} AND #{Project.table_name}.rgt <= #{root.rgt} AND #{Version.table_name}.sharing = 'tree')" + " OR (#{Project.table_name}.lft < #{lft} AND #{Project.table_name}.rgt > #{rgt} AND #{Version.table_name}.sharing IN ('hierarchy', 'descendants'))" + @@ -497,6 +498,11 @@ class Project < ActiveRecord::Base end end + def active_since? date + u = User.find(1) + return Redmine::Activity::Fetcher.new(u, :project => self).events(date, Time.now).size > 0 + end + private # Destroys children before destroying self diff --git a/app/views/mailer/inactive_reminder.text.html.rhtml b/app/views/mailer/inactive_reminder.text.html.rhtml new file mode 100644 index 0000000..29b7f18 --- /dev/null +++ b/app/views/mailer/inactive_reminder.text.html.rhtml @@ -0,0 +1,2 @@ +

<%= l(:mail_body_project_activity_warning, :project => @project.name) %>


+<%= @url %> diff --git a/app/views/mailer/inactive_reminder.text.plain.rhtml b/app/views/mailer/inactive_reminder.text.plain.rhtml new file mode 100644 index 0000000..5d09589 --- /dev/null +++ b/app/views/mailer/inactive_reminder.text.plain.rhtml @@ -0,0 +1,2 @@ +<%= l(:mail_body_project_activity_warning, :project => @project.name) %> +<%= @url %> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 2a68101..7f2efec 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -881,4 +881,9 @@ bg: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities - \ No newline at end of file + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project + diff --git a/config/locales/bs.yml b/config/locales/bs.yml index edfd1f6..b4399e7 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -905,3 +905,8 @@ bs: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 12d3632..0cf5b86 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -884,3 +884,8 @@ ca: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 202ba3b..a0a5e0d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -887,3 +887,8 @@ cs: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/da.yml b/config/locales/da.yml index ff76caa..9322ae2 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -907,3 +907,8 @@ da: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/de.yml b/config/locales/de.yml index 8b1cd32..a9e5fdb 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -907,3 +907,12 @@ de: permission_export_wiki_pages: Wiki-Seiten exportieren setting_cache_formatted_text: Formattierten Text zwischenspeichern permission_manage_project_activities: Projektaktivitäten verwalten + error_failed_to_reactivate: Das Projekt konnte nicht reaktiviert werden. + notice_successful_reactivate: Erfolgreich reaktiviert. + mail_subject_project_activity_warning: Aktivitätswarnung + mail_body_project_activity_warning: |- + Das Projekt "{{project}}" weist seit über einem Monat keine Aktivität mehr auf. Falls das Projekt + nicht mehr benötigt wird, ignorieren sie diese E-Mail. In 14 Tagen wird das Projekt automatisch + archiviert. Falls Sie das Projekt "{{project}}" noch benötigen, klicken sie auf folgenden Link, + um es wieder zu aktivieren. + permission_reactivate_project: Projekt reaktivieren. diff --git a/config/locales/el.yml b/config/locales/el.yml index 5ab7e62..18b101e 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -887,3 +887,8 @@ el: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/en.yml b/config/locales/en.yml index 2ee57bc..3415c08 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -139,6 +139,7 @@ en: notice_successful_update: Successful update. notice_successful_delete: Successful deletion. notice_successful_connection: Successful connection. + notice_successful_reactivate: Successful reactivation. notice_file_not_found: The page you were trying to access doesn't exist or has been removed. notice_locking_conflict: Data has been updated by another user. notice_not_authorized: You are not authorized to access this page. @@ -165,6 +166,7 @@ en: error_issue_done_ratios_not_updated: "Issue done ratios not updated." error_workflow_copy_source: 'Please select a source tracker or role' error_workflow_copy_target: 'Please select target tracker(s) and role(s)' + error_failed_to_reactivate: "Can't reactivate the project." warning_attachments_not_saved: "{{count}} file(s) could not be saved." @@ -182,6 +184,8 @@ en: mail_body_wiki_content_added: "The '{{page}}' wiki page has been added by {{author}}." mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated" mail_body_wiki_content_updated: "The '{{page}}' wiki page has been updated by {{author}}." + mail_subject_project_activity_warning: "Activity reminder" + mail_body_project_activity_warning: "Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days." gui_validation_error: 1 error gui_validation_error_plural: "{{count}} errors" @@ -385,6 +389,7 @@ en: permission_delete_messages: Delete messages permission_delete_own_messages: Delete own messages permission_export_wiki_pages: Export wiki pages + permission_reactivate_project: Reactivate Project project_module_issue_tracking: Issue tracking project_module_time_tracking: Time tracking diff --git a/config/locales/es.yml b/config/locales/es.yml index 5c77c71..178d793 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -931,3 +931,8 @@ es: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/fi.yml b/config/locales/fi.yml index d26c985..758d882 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -917,3 +917,8 @@ fi: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 636a588..d86bdff 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -908,3 +908,8 @@ fr: enumeration_system_activity: Activité système label_board_sticky: Sticky label_board_locked: Verrouillé + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 92356c3..0015c02 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -907,3 +907,8 @@ gl: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/he.yml b/config/locales/he.yml index eb068f7..bd01b0a 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -891,3 +891,8 @@ he: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/hr.yml b/config/locales/hr.yml index b7b70b5..cdfbf46 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -894,3 +894,8 @@ hr: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 99a475e..d34c42c 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -912,3 +912,8 @@ permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/id.yml b/config/locales/id.yml index 79e4d36..0871d8d 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -899,3 +899,8 @@ id: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/it.yml b/config/locales/it.yml index 4e52a3d..9e42258 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -894,4 +894,8 @@ it: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities - \ No newline at end of file + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/ja.yml b/config/locales/ja.yml index ce5d87e..831d56d 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -916,3 +916,8 @@ ja: enumeration_activities: 作業分類 (時間トラッキング) enumeration_system_activity: システム作業分類 permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 7d389a9..3bd042b 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -947,3 +947,8 @@ ko: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 4c5be32..84e39c6 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -955,3 +955,8 @@ lt: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/nl.yml b/config/locales/nl.yml index bb2b8dd..aa484ca 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -869,3 +869,8 @@ nl: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/no.yml b/config/locales/no.yml index ee84633..42d7542 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -882,3 +882,8 @@ permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 2492e6e..ccfdd3c 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -912,3 +912,8 @@ pl: permission_export_wiki_pages: Eksport stron wiki permission_manage_project_activities: Zarządzanie aktywnościami projektu setting_cache_formatted_text: Cache formatted text + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index a708273..f51347d 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -915,3 +915,8 @@ pt-BR: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 7c22dff..28c4fbc 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -899,3 +899,8 @@ pt: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/ro.yml b/config/locales/ro.yml index d7b115e..929a046 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -884,3 +884,8 @@ ro: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 2017f62..d7b26da 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -995,3 +995,8 @@ ru: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/sk.yml b/config/locales/sk.yml index f2baf51..3a361fe 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -886,3 +886,8 @@ sk: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 2d5279f..df0844c 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -883,3 +883,8 @@ sl: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 135715f..5ba9cc2 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -902,3 +902,8 @@ permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/sv.yml b/config/locales/sv.yml index c073b93..535ca87 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -936,3 +936,8 @@ sv: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/th.yml b/config/locales/th.yml index 557ad2c..46b11ca 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -884,3 +884,8 @@ th: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/tr.yml b/config/locales/tr.yml index c90661a..946c75c 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -914,3 +914,8 @@ tr: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/uk.yml b/config/locales/uk.yml index f4e012d..9ebd4c2 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -883,3 +883,8 @@ uk: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 5dfb504..27db83c 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -946,3 +946,8 @@ vi: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 4a64e2e..857dc2f 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -978,3 +978,8 @@ permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 3e87d0a..4bf86bb 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -909,4 +909,8 @@ zh: permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities - \ No newline at end of file + error_failed_to_reactivate: "Can't reactivate the project." + notice_successful_reactivate: Successful reactivation. + mail_subject_project_activity_warning: Activity reminder + mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days. + permission_reactivate_project: Reactivate Project diff --git a/config/routes.rb b/config/routes.rb index 10e4be8..4acb666 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -184,6 +184,7 @@ ActionController::Routing::Routes.draw do |map| project_views.connect 'projects/:id/versions/new', :action => 'add_version' project_views.connect 'projects/:id/categories/new', :action => 'add_issue_category' project_views.connect 'projects/:id/settings/:tab', :action => 'settings' + project_views.connect 'projects/:id/reactivate', :action => 'reactivate' end projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity| diff --git a/lib/redmine.rb b/lib/redmine.rb index 0cf0cc4..9aff2e7 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -33,6 +33,7 @@ Redmine::AccessControl.map do |map| map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member map.permission :manage_versions, {:projects => [:settings, :add_version], :versions => [:edit, :close_completed, :destroy]}, :require => :member map.permission :add_subprojects, {:projects => :add}, :require => :member + map.permission :reactivate_project, {:projects => :reactivate}, :require => :member map.project_module :issue_tracking do |map| # Issue categories -- 1.5.6.5