You are not logged in.
Pages: 1
Hello GLPI Team,
GLPI 9.5.6
I want to get the average of my projects automatically (In the main page of a project, the field percent done), from the tasks added to my project, a few years ago I did it including a trigger, I would like to know if now there is an automatically way to do that in the glpi interface or if I should do the same I did years ago modifying the code.
This was the trigger
This is my trigger:
delimiter $$
CREATE TRIGGER before_glpi_projecttasks_update
AFTER UPDATE ON glpi_projecttasks
FOR EACH ROW BEGIN
declare cc int;
select (sum(ifnull(percent_done,0)/100 * ifnull(planned_duration,0))/sum(ifnull(planned_duration,0)))*100
into cc
from glpi_projecttasks
where projects_id=OLD.projects_id;
update glpi_projects
set percent_done= cc
where id=OLD.projects_id;
END$$
delimiter ;
Thanks a lot,
Claudia
Offline
In a Project or Project Task that you want to have its percent done field to be calculated, you can click the checkbox next to the Percent Done field. This will disable to field and automatically keep it updated any time sub-projects/tasks are added, updated or deleted.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you very much!!
Indeed, my vision is not very good and I could not see the checkbox to mark, but there it is! right next to the percent done box, with this information I close this topic
Offline
Pages: 1