From d01460d6063ed8c7d288b60d82e93b3d8cc478a7 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 1 Oct 2021 08:06:45 +0200 Subject: [PATCH] FIX : hrm_position > hrm_job_user + seEventMessage on evaluation close --- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 6 +++--- htdocs/hrm/evaluation_card.php | 5 ++++- htdocs/langs/en_US/hrm.lang | 1 + htdocs/langs/fr_FR/hrm.lang | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 263f685dc78..23b08e00012 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -147,7 +147,7 @@ class Job extends CommonObject // /** // * @var array List of child tables. To test if we can delete object. // */ - protected $childtables = array('hrm_evaluation', 'hrm_position'); + protected $childtables = array('hrm_evaluation', 'hrm_job_user'); // /** // * @var array List of child tables. To know object to delete on cascade. diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index e15a15de12d..673840c83d4 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -48,7 +48,7 @@ class Position extends CommonObject /** * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. */ - public $table_element = 'hrm_position'; + public $table_element = 'hrm_job_user'; /** * @var int Does this object support multicompany module ? @@ -144,7 +144,7 @@ class Position extends CommonObject // /** // * @var string Name of subtable line // */ - // public $table_element_line = 'hrm_positionline'; + // public $table_element_line = 'hrm_job_userline'; // /** // * @var string Field with ID of parent key if this object has a parent @@ -166,7 +166,7 @@ class Position extends CommonObject // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object // */ - // protected $childtablesoncascade = array('hrm_positiondet'); + // protected $childtablesoncascade = array('hrm_job_userdet'); // /** // * @var PositionLine[] Array of subtable lines diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 4ae21fef372..5234338212a 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -255,7 +255,10 @@ if (empty($reshook)) { } } } - $object->setStatut(Evaluation::STATUS_CLOSED); + if(empty($errors)) { + $object->setStatut(Evaluation::STATUS_CLOSED); + setEventMessage('EmployeeSkillsUpdated'); + } } if ($action == 'reopen' ) { diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 45d1aadbbd3..cb6d860bb8c 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -41,6 +41,7 @@ SkillHasNoLines=This skill has no lines skill=Skill Skills=Skills SkillCard=Skill card +EmployeeSkillsUpdated=Employee skills have been updated (see "Skills" tab of employee card) Eval=Evaluation Evals=Evaluations NewEval=New evaluation diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index f0998719c47..c2a787cecb2 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -52,6 +52,7 @@ SkillHasNoLines=Cette compétence n'a pas de notes skill=Compétence Skills=Compétences SkillCard=Fiche compétence +EmployeeSkillsUpdated=Les compétences du salarié ont été mises à jour (voir l'onglet "compétences" de la fiche du salarié) Eval=Evaluation Evals=Evaluations NewEval=Nouvelle evaluation