added migration scripts and permissions for time tracking

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@367 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-03-23 11:19:24 +00:00
parent 1f2cbee0aa
commit 583680fd91
5 changed files with 44 additions and 3 deletions

View File

@@ -30,7 +30,8 @@ class Permission < ActiveRecord::Base
1100 => :label_news_plural,
1200 => :label_document_plural,
1300 => :label_attachment_plural,
1400 => :label_repository
1400 => :label_repository,
1500 => :label_time_tracking
}.freeze
@@cached_perms_for_public = nil

View File

@@ -0,0 +1,24 @@
class CreateTimeEntries < ActiveRecord::Migration
def self.up
create_table :time_entries do |t|
t.column :project_id, :integer, :null => false
t.column :user_id, :integer, :null => false
t.column :issue_id, :integer
t.column :hours, :float, :null => false
t.column :comment, :string, :limit => 255
t.column :activity_id, :integer, :null => false
t.column :spent_on, :date, :null => false
t.column :tyear, :integer, :null => false
t.column :tmonth, :integer, :null => false
t.column :tweek, :integer, :null => false
t.column :created_on, :datetime, :null => false
t.column :updated_on, :datetime, :null => false
end
add_index :time_entries, [:project_id], :name => :time_entries_project_id
add_index :time_entries, [:issue_id], :name => :time_entries_issue_id
end
def self.down
drop_table :time_entries
end
end

View File

@@ -0,0 +1,9 @@
class AddTimelogPermissions < ActiveRecord::Migration
def self.up
Permission.create :controller => "timelog", :action => "edit", :description => "button_log_time", :sort => 1520, :is_public => false, :mail_option => 0, :mail_enabled => 0
end
def self.down
Permission.find_by_controller_and_action('timelog', 'edit').destroy
end
end

View File

@@ -334,6 +334,7 @@ label_preview: Prévisualisation
label_spent_time: Temps passé
label_f_hour: %.2f heure
label_f_hour_plural: %.2f heures
label_time_tracking: Suivi du temps
button_login: Connexion
button_submit: Soumettre
@@ -392,6 +393,8 @@ default_priority_normal: Normal
default_priority_high: Haut
default_priority_urgent: Urgent
default_priority_immediate: Immédiat
default_activity_design: Conception
default_activity_development: Développement
enumeration_issue_priorities: Priorités des demandes
enumeration_doc_categories: Catégories des documents

View File

@@ -39,7 +39,7 @@ begin
manager.permissions = Permission.find(:all, :conditions => ["is_public=?", false])
developper = Role.create :name => l(:default_role_developper), :position => 2
perms = [150, 320, 321, 322, 420, 421, 422, 1050, 1060, 1070, 1075, 1130, 1220, 1221, 1222, 1223, 1224, 1320, 1322, 1061, 1057]
perms = [150, 320, 321, 322, 420, 421, 422, 1050, 1060, 1070, 1075, 1130, 1220, 1221, 1222, 1223, 1224, 1320, 1322, 1061, 1057, 1520]
developper.permissions = Permission.find(:all, :conditions => ["sort IN (#{perms.join(',')})"])
reporter = Role.create :name => l(:default_role_reporter), :position => 3
@@ -88,12 +88,16 @@ begin
# enumerations
Enumeration.create(:opt => "DCAT", :name => l(:default_doc_category_user))
Enumeration.create(:opt => "DCAT", :name => l(:default_doc_category_tech))
Enumeration.create(:opt => "IPRI", :name => l(:default_priority_low))
Enumeration.create(:opt => "IPRI", :name => l(:default_priority_normal))
Enumeration.create(:opt => "IPRI", :name => l(:default_priority_high))
Enumeration.create(:opt => "IPRI", :name => l(:default_priority_urgent))
Enumeration.create(:opt => "IPRI", :name => l(:default_priority_immediate))
Enumeration.create(:opt => "ACTI", :name => l(:default_activity_design))
Enumeration.create(:opt => "ACTI", :name => l(:default_activity_development))
rescue => error
puts "Error: " + error
puts "Default configuration data can't be loaded."