@@ -20,16 +20,7 | |||||
20 | module CustomFieldsHelper |
|
20 | module CustomFieldsHelper | |
21 |
|
21 | |||
22 | def custom_fields_tabs |
|
22 | def custom_fields_tabs | |
23 | tabs = [{:name => 'IssueCustomField', :partial => 'custom_fields/index', :label => :label_issue_plural}, |
|
23 | CustomField::CUSTOM_FIELDS_TABS | |
24 | {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', :label => :label_spent_time}, |
|
|||
25 | {:name => 'ProjectCustomField', :partial => 'custom_fields/index', :label => :label_project_plural}, |
|
|||
26 | {:name => 'VersionCustomField', :partial => 'custom_fields/index', :label => :label_version_plural}, |
|
|||
27 | {:name => 'UserCustomField', :partial => 'custom_fields/index', :label => :label_user_plural}, |
|
|||
28 | {:name => 'GroupCustomField', :partial => 'custom_fields/index', :label => :label_group_plural}, |
|
|||
29 | {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', :label => TimeEntryActivity::OptionName}, |
|
|||
30 | {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', :label => IssuePriority::OptionName}, |
|
|||
31 | {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', :label => DocumentCategory::OptionName} |
|
|||
32 | ] |
|
|||
33 | end |
|
24 | end | |
34 |
|
25 | |||
35 | # Return custom field html tag corresponding to its format |
|
26 | # Return custom field html tag corresponding to its format |
@@ -30,6 +30,27 class CustomField < ActiveRecord::Base | |||||
30 | validate :validate_custom_field |
|
30 | validate :validate_custom_field | |
31 | before_validation :set_searchable |
|
31 | before_validation :set_searchable | |
32 |
|
32 | |||
|
33 | CUSTOM_FIELDS_TABS = [ | |||
|
34 | {:name => 'IssueCustomField', :partial => 'custom_fields/index', | |||
|
35 | :label => :label_issue_plural}, | |||
|
36 | {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', | |||
|
37 | :label => :label_spent_time}, | |||
|
38 | {:name => 'ProjectCustomField', :partial => 'custom_fields/index', | |||
|
39 | :label => :label_project_plural}, | |||
|
40 | {:name => 'VersionCustomField', :partial => 'custom_fields/index', | |||
|
41 | :label => :label_version_plural}, | |||
|
42 | {:name => 'UserCustomField', :partial => 'custom_fields/index', | |||
|
43 | :label => :label_user_plural}, | |||
|
44 | {:name => 'GroupCustomField', :partial => 'custom_fields/index', | |||
|
45 | :label => :label_group_plural}, | |||
|
46 | {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', | |||
|
47 | :label => TimeEntryActivity::OptionName}, | |||
|
48 | {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', | |||
|
49 | :label => IssuePriority::OptionName}, | |||
|
50 | {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', | |||
|
51 | :label => DocumentCategory::OptionName} | |||
|
52 | ] | |||
|
53 | ||||
33 | def set_searchable |
|
54 | def set_searchable | |
34 | # make sure these fields are not searchable |
|
55 | # make sure these fields are not searchable | |
35 | self.searchable = false if %w(int float date bool).include?(field_format) |
|
56 | self.searchable = false if %w(int float date bool).include?(field_format) |
General Comments 0
You need to be logged in to leave comments.
Login now