diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-08-04 10:26:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-08-04 10:26:54 +0000 |
commit | b19b90234529206205abfa21c4a92ba7cebb7d98 (patch) | |
tree | 94418ed45d17e704087a01b32101034067637bb1 | |
parent | b900ea8e2f188cdf07951bc37c466408c738eda7 (diff) | |
download | redmine-b19b90234529206205abfa21c4a92ba7cebb7d98.tar.gz redmine-b19b90234529206205abfa21c4a92ba7cebb7d98.zip |
Moved CUSTOM_FIELDS_TABS out of the model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12077 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/custom_fields_helper.rb | 23 | ||||
-rw-r--r-- | app/models/custom_field.rb | 23 |
2 files changed, 22 insertions, 24 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index ab516d00a..242bfefef 100644 --- a/app/helpers/custom_fields_helper.rb +++ b/app/helpers/custom_fields_helper.rb @@ -19,8 +19,29 @@ module CustomFieldsHelper + CUSTOM_FIELDS_TABS = [ + {:name => 'IssueCustomField', :partial => 'custom_fields/index', + :label => :label_issue_plural}, + {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', + :label => :label_spent_time}, + {:name => 'ProjectCustomField', :partial => 'custom_fields/index', + :label => :label_project_plural}, + {:name => 'VersionCustomField', :partial => 'custom_fields/index', + :label => :label_version_plural}, + {:name => 'UserCustomField', :partial => 'custom_fields/index', + :label => :label_user_plural}, + {:name => 'GroupCustomField', :partial => 'custom_fields/index', + :label => :label_group_plural}, + {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', + :label => TimeEntryActivity::OptionName}, + {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', + :label => IssuePriority::OptionName}, + {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', + :label => DocumentCategory::OptionName} + ] + def custom_fields_tabs - CustomField::CUSTOM_FIELDS_TABS + CUSTOM_FIELDS_TABS end # Return custom field html tag corresponding to its format diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index f469bc534..937f9f4d0 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -53,29 +53,6 @@ class CustomField < ActiveRecord::Base end } - CUSTOM_FIELDS_TABS = [ - {:name => 'IssueCustomField', :partial => 'custom_fields/index', - :label => :label_issue_plural}, - {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', - :label => :label_spent_time}, - {:name => 'ProjectCustomField', :partial => 'custom_fields/index', - :label => :label_project_plural}, - {:name => 'VersionCustomField', :partial => 'custom_fields/index', - :label => :label_version_plural}, - {:name => 'UserCustomField', :partial => 'custom_fields/index', - :label => :label_user_plural}, - {:name => 'GroupCustomField', :partial => 'custom_fields/index', - :label => :label_group_plural}, - {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', - :label => TimeEntryActivity::OptionName}, - {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', - :label => IssuePriority::OptionName}, - {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', - :label => DocumentCategory::OptionName} - ] - - CUSTOM_FIELDS_NAMES = CUSTOM_FIELDS_TABS.collect{|v| v[:name]} - def visible_by?(project, user=User.current) visible? || user.admin? end |