Help for plugin / modified issues list: display column for "spent time"
On the Issues list, I'd like to be able to display an additional column, "Spent time", which displays the overall spent time as collected by the time tracker module for each issue.
I tried by creating a custom view, but realized that - ideally - this should be a selectable column as we can do in Administration / Settings / Issue tracking.
Any idea if I can accomplish this with a plugin? Or is it something deeper inside Redmine?
Thanks for any help,
RE: Help for plugin / modified issues list: display column for "spent time" - Added by Carsten Buchenau almost 12 years ago
Ok, I solved it the following way:
- Installed Eric Davis' Question plugin (http://github.com/edavis10/question_plugin)
lib/question_query_patch.rbto add one line of code, making the "Spent time" column available
- Added translations for "field_spent_hours
Here's the line of code I added, and its location inside
module QuestionQueryPatch def self.included(base) # :nodoc: base.extend(ClassMethods) base.send(:include, InstanceMethods) # Same as typing in the class base.class_eval do unloadable # Send unloadable so it will not be unloaded in development base.add_available_column(QueryColumn.new(:formatted_questions)) # # ADD ADDITIONAL COLUMN TO SHOW "Spent time": base.add_available_column(QueryColumn.new(:spent_hours)) ...
Thanks to this thread for pointing me the right way: