##// END OF EJS Templates
Added observers to watch model objects for mail delivery instead of calling Mailer....
Added observers to watch model objects for mail delivery instead of calling Mailer. * Added an IssueObserver to watch when Issues are created * Added a JournalObserver to watch when Journals are created (Issue updates) * Added a NewsObserver for News items. * Added a DocumentObserver for Document notifications. * Setup IssuesController#new to use the IssueObserver. * Setup IssuesController#edit to use the IssueObserver. * Setup IssuesController#bulk_edit to use the JournalObserver. * Removed the Mailer call in Changeset#scan_commit_for_issue_ids, the JournalObserver will handle it. * Removed Mailer calls in MailHandler in favor of the Observers. #2659 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2637 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2535:451ef7f21f41
r2548:b4be8849c0de
Show More
custom_fields_controller.rb
60 lines | 2.3 KiB | text/x-ruby | RubyLexer
/ app / controllers / custom_fields_controller.rb
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 # Redmine - project management software
# Copyright (C) 2006-2009 Jean-Philippe Lang
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 #
# 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 CustomFieldsController < ApplicationController
before_filter :require_admin
Jean-Philippe Lang
0.3 unstable...
r10
Jean-Philippe Lang
Initial commit...
r2 def index
Jean-Philippe Lang
Removed deprecated Object#type in CustomFieldsController....
r612 @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name }
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @tab = params[:tab] || 'IssueCustomField'
Jean-Philippe Lang
Initial commit...
r2 end
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330
def new
Jean-Philippe Lang
CustomFieldsController refactoring....
r2271 @custom_field = begin
if params[:type].to_s.match(/.+CustomField$/)
params[:type].to_s.constantize.new(params[:custom_field])
end
rescue
end
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 redirect_to(:action => 'index') and return unless @custom_field.is_a?(CustomField)
Jean-Philippe Lang
CustomFieldsController refactoring....
r2271
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 if request.post? and @custom_field.save
flash[:notice] = l(:notice_successful_create)
Eric Davis
Added several more plugin hooks:...
r2535 call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 redirect_to :action => 'index', :tab => @custom_field.class.name
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 end
@trackers = Tracker.find(:all, :order => 'position')
end
def edit
@custom_field = CustomField.find(params[:id])
if request.post? and @custom_field.update_attributes(params[:custom_field])
flash[:notice] = l(:notice_successful_update)
Eric Davis
Added several more plugin hooks:...
r2535 call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 redirect_to :action => 'index', :tab => @custom_field.class.name
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 end
@trackers = Tracker.find(:all, :order => 'position')
end
Jean-Philippe Lang
Custom fields can now be reordered....
r888
Jean-Philippe Lang
Initial commit...
r2 def destroy
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @custom_field = CustomField.find(params[:id]).destroy
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 redirect_to :action => 'index', :tab => @custom_field.class.name
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 rescue
Jean-Philippe Lang
Applied the flash notices patch by Matt Jones (slightly edited)....
r597 flash[:error] = "Unable to delete custom field"
Jean-Philippe Lang
CustomFieldsController#list moved to #index....
r2272 redirect_to :action => 'index'
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 end
Jean-Philippe Lang
Initial commit...
r2 end