before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu]
before_filter :find_optional_project, :only => [:index, :changes]
accept_key_auth :index, :changes
-
- cache_sweeper :issue_sweeper, :only => [ :new, :edit, :bulk_edit, :destroy ]
helper :journals
helper :projects
before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
accept_key_auth :activity, :calendar
- cache_sweeper :project_sweeper, :only => [ :add, :edit, :archive, :unarchive, :destroy ]
- cache_sweeper :version_sweeper, :only => [ :add_version ]
-
helper :sort
include SortHelper
helper :custom_fields
menu_item :roadmap
before_filter :find_project, :authorize
- cache_sweeper :version_sweeper, :only => [ :edit, :destroy ]
-
def show
end
+++ /dev/null
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-class IssueSweeper < ActionController::Caching::Sweeper
- observe Issue
-
- def after_save(issue)
- expire_cache_for(issue)
- end
-
- def after_destroy(issue)
- expire_cache_for(issue)
- end
-
-private
- def expire_cache_for(issue)
- # fragments of the main project
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{issue.project_id}\\."))
- # fragments of the root project that include subprojects issues
- unless issue.project.parent_id.nil?
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{issue.project.parent_id}\\..*subprojects"))
- end
- end
-end
+++ /dev/null
-# redMine - project management software\r
-# Copyright (C) 2006-2007 Jean-Philippe Lang\r
-#\r
-# This program is free software; you can redistribute it and/or\r
-# modify it under the terms of the GNU General Public License\r
-# as published by the Free Software Foundation; either version 2\r
-# of the License, or (at your option) any later version.\r
-# \r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-# \r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
-\r
-class ProjectSweeper < ActionController::Caching::Sweeper\r
- observe Project\r
-\r
- def before_save(project)\r
- if project.new_record?\r
- expire_cache_for(project.parent) if project.parent\r
- else\r
- project_before_update = Project.find(project.id)\r
- return if project_before_update.parent_id == project.parent_id && project_before_update.status == project.status\r
- expire_cache_for(project.parent) if project.parent \r
- expire_cache_for(project_before_update.parent) if project_before_update.parent\r
- end\r
- end\r
- \r
- def after_destroy(project)\r
- expire_cache_for(project.parent) if project.parent\r
- end\r
- \r
-private\r
- def expire_cache_for(project)\r
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{project.id}\\."))\r
- end\r
-end\r
+++ /dev/null
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-class VersionSweeper < ActionController::Caching::Sweeper
- observe Version
-
- def after_save(version)
- expire_cache_for(version)
- end
-
- def after_destroy(version)
- expire_cache_for(version)
- end
-
-private
- def expire_cache_for(version)
- # calendar and gantt fragments of the project
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{version.project_id}\\."))
- end
-end
-<% cache(:year => @year, :month => @month, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
<h2><%= "#{month_name(@month)} #{@year}" %></h2>
<table width="100%">
<%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br />
<%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br />
<%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br />
-<% end %>
<% content_for :sidebar do %>
<h3><%= l(:label_calendar) %></h3>
</table>
<% end %>
-<% cache(:year => @year_from, :month => @month_from, :months => @months, :zoom => @zoom, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
-
<table width="100%" style="border:0; border-collapse: collapse;">
<tr>
<td style="width:<%= subject_width %>px;">
<% top = top + 20
end %>
-<% end # cache
-%>
-
<%
#
# Today red line (excluded from cache)