diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-23 11:19:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-23 11:19:24 +0000 |
commit | 583680fd919fc22e378d4ce20eb4a992e800a31b (patch) | |
tree | 13a72f55a9d8a2488ce577c7d66888616d124f01 | |
parent | 1f2cbee0aab9938fcd5f91cdd4f1faae200fc8f4 (diff) | |
download | redmine-583680fd919fc22e378d4ce20eb4a992e800a31b.tar.gz redmine-583680fd919fc22e378d4ce20eb4a992e800a31b.zip |
added migration scripts and permissions for time tracking
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@367 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | time/app/models/permission.rb | 3 | ||||
-rw-r--r-- | time/db/migrate/032_create_time_entries.rb | 24 | ||||
-rw-r--r-- | time/db/migrate/033_add_timelog_permissions.rb | 9 | ||||
-rw-r--r-- | time/lang/fr.yml | 3 | ||||
-rw-r--r-- | time/lib/tasks/load_default_data.rake | 8 |
5 files changed, 44 insertions, 3 deletions
diff --git a/time/app/models/permission.rb b/time/app/models/permission.rb index 65b9253c7..742885c39 100644 --- a/time/app/models/permission.rb +++ b/time/app/models/permission.rb @@ -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
diff --git a/time/db/migrate/032_create_time_entries.rb b/time/db/migrate/032_create_time_entries.rb new file mode 100644 index 000000000..e055c13e6 --- /dev/null +++ b/time/db/migrate/032_create_time_entries.rb @@ -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 diff --git a/time/db/migrate/033_add_timelog_permissions.rb b/time/db/migrate/033_add_timelog_permissions.rb new file mode 100644 index 000000000..3b5b81ed6 --- /dev/null +++ b/time/db/migrate/033_add_timelog_permissions.rb @@ -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 diff --git a/time/lang/fr.yml b/time/lang/fr.yml index fd63741b5..8d95bfa23 100644 --- a/time/lang/fr.yml +++ b/time/lang/fr.yml @@ -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
diff --git a/time/lib/tasks/load_default_data.rake b/time/lib/tasks/load_default_data.rake index b554df1ba..488cd2a64 100644 --- a/time/lib/tasks/load_default_data.rake +++ b/time/lib/tasks/load_default_data.rake @@ -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."
|