@@ -19,8 +19,29 | |||||
19 |
|
19 | |||
20 | module CustomFieldsHelper |
|
20 | module CustomFieldsHelper | |
21 |
|
21 | |||
|
22 | CUSTOM_FIELDS_TABS = [ | |||
|
23 | {:name => 'IssueCustomField', :partial => 'custom_fields/index', | |||
|
24 | :label => :label_issue_plural}, | |||
|
25 | {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', | |||
|
26 | :label => :label_spent_time}, | |||
|
27 | {:name => 'ProjectCustomField', :partial => 'custom_fields/index', | |||
|
28 | :label => :label_project_plural}, | |||
|
29 | {:name => 'VersionCustomField', :partial => 'custom_fields/index', | |||
|
30 | :label => :label_version_plural}, | |||
|
31 | {:name => 'UserCustomField', :partial => 'custom_fields/index', | |||
|
32 | :label => :label_user_plural}, | |||
|
33 | {:name => 'GroupCustomField', :partial => 'custom_fields/index', | |||
|
34 | :label => :label_group_plural}, | |||
|
35 | {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', | |||
|
36 | :label => TimeEntryActivity::OptionName}, | |||
|
37 | {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', | |||
|
38 | :label => IssuePriority::OptionName}, | |||
|
39 | {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', | |||
|
40 | :label => DocumentCategory::OptionName} | |||
|
41 | ] | |||
|
42 | ||||
22 | def custom_fields_tabs |
|
43 | def custom_fields_tabs | |
23 |
|
|
44 | CUSTOM_FIELDS_TABS | |
24 | end |
|
45 | end | |
25 |
|
46 | |||
26 | # Return custom field html tag corresponding to its format |
|
47 | # Return custom field html tag corresponding to its format |
@@ -53,29 +53,6 class CustomField < ActiveRecord::Base | |||||
53 | end |
|
53 | end | |
54 | } |
|
54 | } | |
55 |
|
55 | |||
56 | CUSTOM_FIELDS_TABS = [ |
|
|||
57 | {:name => 'IssueCustomField', :partial => 'custom_fields/index', |
|
|||
58 | :label => :label_issue_plural}, |
|
|||
59 | {:name => 'TimeEntryCustomField', :partial => 'custom_fields/index', |
|
|||
60 | :label => :label_spent_time}, |
|
|||
61 | {:name => 'ProjectCustomField', :partial => 'custom_fields/index', |
|
|||
62 | :label => :label_project_plural}, |
|
|||
63 | {:name => 'VersionCustomField', :partial => 'custom_fields/index', |
|
|||
64 | :label => :label_version_plural}, |
|
|||
65 | {:name => 'UserCustomField', :partial => 'custom_fields/index', |
|
|||
66 | :label => :label_user_plural}, |
|
|||
67 | {:name => 'GroupCustomField', :partial => 'custom_fields/index', |
|
|||
68 | :label => :label_group_plural}, |
|
|||
69 | {:name => 'TimeEntryActivityCustomField', :partial => 'custom_fields/index', |
|
|||
70 | :label => TimeEntryActivity::OptionName}, |
|
|||
71 | {:name => 'IssuePriorityCustomField', :partial => 'custom_fields/index', |
|
|||
72 | :label => IssuePriority::OptionName}, |
|
|||
73 | {:name => 'DocumentCategoryCustomField', :partial => 'custom_fields/index', |
|
|||
74 | :label => DocumentCategory::OptionName} |
|
|||
75 | ] |
|
|||
76 |
|
||||
77 | CUSTOM_FIELDS_NAMES = CUSTOM_FIELDS_TABS.collect{|v| v[:name]} |
|
|||
78 |
|
||||
79 | def visible_by?(project, user=User.current) |
|
56 | def visible_by?(project, user=User.current) | |
80 | visible? || user.admin? |
|
57 | visible? || user.admin? | |
81 | end |
|
58 | end |
General Comments 0
You need to be logged in to leave comments.
Login now