From b19b90234529206205abfa21c4a92ba7cebb7d98 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 4 Aug 2013 10:26:54 +0000 Subject: [PATCH] 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 --- app/helpers/custom_fields_helper.rb | 23 ++++++++++++++++++++++- 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 -- 2.39.5