I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

init.rb.patch.diff

Brody Kenrick, 29 May 2014 23:02

Download (1.9 KB)

View differences:

init.rb 2014-05-28 17:32:19.000000000 +1000
35 35
                                                         :caption => :label_issue_watchers,
36 36
                                                         :value => lambda { |issue| issue.watchers.size }))
37 37

  
38
#<BK>
39
#TODO: This should be extracted to an extension of this extension (or pushed up to the extension if the community wants it)
40
#Take each Project custom field and make it available as a column in issue queries.
41
0.upto(  ProjectCustomField.all.size - 1 ) do |loop_index|
42
			issue_query.add_available_column(ExtendedQueryColumn.new(
43
				 #Create a unique symbol for this entry
44
				 ("project_cf_"+loop_index.to_s).to_sym,
45
				 #Get the custom field name from the first (any) project.
46
				 #NB: This assumes that CF will be the same on the first project as the issue project.....
47
				 :caption => "Project's " + Project.first.custom_field_values[loop_index].custom_field.name,
48
				 #Get the CF value - via a temp function - that is assigned to the project for this issue
49
				 :value => lambda { |issue| Project.find_by_id(issue.project_id).custom_field_values[loop_index].value } )
50
			)
51
end
52
#</BK>
53
														 
38 54
Rails.configuration.to_prepare do
39 55

  
40 56
    unless String.method_defined?(:html_safe)
......
131 147
end
132 148

  
133 149
Redmine::Plugin.register :extended_fields do
134
    name 'Extended fields'
135
    author 'Andriy Lesyuk'
150
    name 'Extended fields (BK Edition)'
151
    author 'Andriy Lesyuk (+Brody Kenrick)'
136 152
    author_url 'http://www.andriylesyuk.com'
137
    description 'Adds new custom field types, improves listings etc.'
153
    description 'Adds new custom field types, improves listings etc. (BK Added/hacked support for provisioning project settings in issues lists/queries)'
138 154
    url 'http://projects.andriylesyuk.com/projects/extended-fields'
139
    version '0.2.3'
155
    version '0.2.3-BK'
140 156
end
Terms of use | Privacy policy