In Project Template module, in gantt view, task templates aren't showed according to the value saved in am_tasktemplates.order_number.
This is unfriendly.
In Project Template module, if a user drag and drop a task template to change the order of a task, the change is saved but the result is not showed to the user until he goes in the detail view
In /modules/AM_ProjectTemplates/controller.php
change
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates','AM_TaskTemplates');
with
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates','AM_TaskTemplates','order_number');
in /modules/AM_ProjectTemplates/views/view.ganttchart.php
change
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates','AM_TaskTemplates');
with
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates','AM_TaskTemplates','order_number');
https://demo.suiteondemand.com
Project Templates


I think is a medium priority because you can actually change the order in Gantt View with drag and drop, but users can't see task templates have been affected until they look at the Project Template's Detail View Task Templates subpanel and they go into one of the Task Template Detail view.
The issue appers also when you want to create a Project from the Project Template (Task Templates aren't in order in the popup)
or you want to Add a new Task Template (Predecessors in the dropdown aren't ordered)
I've tested it on SuiteCRM v. 7.10.4 and 7.8.5
mayerelyashiv, you are amazing.
I have been frustrated with this issue for years. Twice I have tried to use the project templates, and each time I gave up after a couple of days of trying to figure out why the order was being jumbled. With your fix, I can finally throw out the task list PDF and use the template feature.
I am currently on version 7.11.13
Here is what I did:
nano /var/www/html/modules/AM_ProjectTemplates/controller.php
line 268
//Get project tasks
$project_template->load_relationship('am_tasktemplates_am_projecttemplates');
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates');
Changed to
//Get project tasks
$project_template->load_relationship('am_tasktemplates_am_projecttemplates');
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates','order_number');
nano /var/www/html/modules/AM_ProjectTemplates/views/view.ganttchart.php
line253
$this->bean->load_relationship('am_tasktemplates_am_projecttemplates');
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates');
Changed to
$this->bean->load_relationship('am_tasktemplates_am_projecttemplates');
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates', 'order_number');
I realize this change is not upgrade safe, and I will likely have to repeat after every upgrade until the changes are committed by the suitecrm developers.
Can one of you please start a PR with these changes?
Hi pgorod, i鈥檓 not used to do it. Could you help me please?
Yeah, sure.
Start with this, and then ask me when you get stuck:
https://docs.suitecrm.com/community/contributing-code/
Do you already use git locally?
Most helpful comment
mayerelyashiv, you are amazing.
I have been frustrated with this issue for years. Twice I have tried to use the project templates, and each time I gave up after a couple of days of trying to figure out why the order was being jumbled. With your fix, I can finally throw out the task list PDF and use the template feature.
I am currently on version 7.11.13
Here is what I did:
nano /var/www/html/modules/AM_ProjectTemplates/controller.php
line 268
//Get project tasks
$project_template->load_relationship('am_tasktemplates_am_projecttemplates');
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates');
Changed to
//Get project tasks
$project_template->load_relationship('am_tasktemplates_am_projecttemplates');
$tasks = $project_template->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates','order_number');
nano /var/www/html/modules/AM_ProjectTemplates/views/view.ganttchart.php
line253
$this->bean->load_relationship('am_tasktemplates_am_projecttemplates');
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates');
Changed to
$this->bean->load_relationship('am_tasktemplates_am_projecttemplates');
$task_list = $this->bean->get_linked_beans('am_tasktemplates_am_projecttemplates', 'AM_TaskTemplates', 'order_number');
I realize this change is not upgrade safe, and I will likely have to repeat after every upgrade until the changes are committed by the suitecrm developers.