Adding Column to Time Log Table

Added by Marek Stepan 2 days ago

Hello ,
so i was tasked with adding the Project description column to the Time Log Table in Redmine 4.0.2 , i have no idea where to start and my searched attempts brought no fruit .

I know of custom columns but there doesnt seem to be a option to merge a custom column with the data of a existing table /description/ .

Any pointers on how to accomplish this are greatly apreaciated .

Yours Friendly ,
Marek Stepan

Replies (2)

RE: Adding Column to Time Log Table - Added by Bernhard Rohloff 1 day ago

Hi Marek,

look at source:trunk/app/models/time_entry_query.rb#L25.
I think adding the following line should do the trick.

QueryColumn.new(:project, :sortable => "#{Project.table_name}.description", :groupable => false),

Kind regards,

Bernhard

RE: Adding Column to Time Log Table - Added by Marek Stepan about 2 hours ago

Hello Bernhard ,
Firstmost ,i thank you for your reply and help.

I did as you told , and added the line in the correct file in opt/bitnami/apps/redmine/htdocs/app/models/time_entry_query.rb

Restart all services with ./ctlscript.sh restart in opt/bitnami .

But unfortunately it didnt seem to do the trick .
Am i missing something ? Im sorry upfront if im missing something "newbie-like" but im completly new to redmine .

//EDIT: I then realized maybe i need to add it in the administrator section after these changes , when i saw two Project columns i was hopefull that that was it but , i could not add both of them to the "Selected columns " list , then i tried changing the codeline , which changed the name of the Object in the list and i was able to add it to "selected columns" but then redmine Timelog window crashed . (After each stepp i run ctlscript.sh restart )

"QueryColumn.new(:description, :sortable => "#{Project.table_name}.description", :groupable => false),"

Any Suggestions or help is apreciated .

Yours Friendly ,
Marek Stepan

code change.PNG - initial code change (438 KB)

project columns.PNG - two project columns (8.33 KB)

description columnt.PNG - after changing project to description (17.5 KB)

error.PNG - crashing on time log view (9.68 KB)

(1-2/2)