##// END OF EJS Templates
Translations update (close #845, #822):...
Translations update (close #845, #822): * Finnish (Antti Perkiömäki) * Czech (Maxim Krušina) git-svn-id: http://redmine.rubyforge.org/svn/trunk@1253 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r1237:aec989707edc
r1238:185ecd585438
Show More
tracker.rb
56 lines | 2.1 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # redMine - project management software
# Copyright (C) 2006 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 Tracker < ActiveRecord::Base
before_destroy :check_integrity
has_many :issues
Jean-Philippe Lang
Workflow copy:...
r1237 has_many :workflows, :dependent => :delete_all do
def copy(tracker)
raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
clear
connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
" SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
" FROM workflows" +
" WHERE tracker_id = #{tracker.id}"
end
end
Jean-Philippe Lang
On the calendar, the gantt and in the Tracker filter on the issue list, only active trackers of the project (and its sub projects) can be selected....
r1057 has_and_belongs_to_many :projects
Jean-Philippe Lang
fixed #9308 table_name pre/suffix support...
r334 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 acts_as_list
validates_presence_of :name
validates_uniqueness_of :name
Jean-Philippe Lang
Added several validates_length_of...
r590 validates_length_of :name, :maximum => 30
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 validates_format_of :name, :with => /^[\w\s\'\-]*$/i
Jean-Philippe Lang
Added the ability to customize columns of a saved query....
r771 def to_s; name end
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 def <=>(tracker)
name <=> tracker.name
end
Jean-Philippe Lang
Added per-project tracker selection. Trackers can be selected on project settings....
r907 def self.all
find(:all, :order => 'position')
end
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 private
def check_integrity
raise "Can't delete tracker" if Issue.find(:first, :conditions => ["tracker_id=?", self.id])
Jean-Philippe Lang
Initial commit...
r2 end
end