From 47dd7335a9c0c77b4111afcca95cc9e3481938b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Nov 2021 21:34:41 +0100 Subject: [PATCH 1/4] Debug v15 --- htdocs/core/menus/standard/eldy.lib.php | 48 ++++++++++--------- htdocs/core/modules/modHRM.class.php | 10 ++-- htdocs/hrm/compare.php | 12 +++-- htdocs/hrm/index.php | 7 +-- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 + htdocs/langs/en_US/holiday.lang | 2 +- htdocs/langs/en_US/hrm.lang | 10 ++-- htdocs/user/list.php | 2 +- 8 files changed, 51 insertions(+), 42 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 32dc909f2e2..a3071864f2f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1793,6 +1793,31 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire); + + $newmenu->add("/hrm/index.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); + + if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm_sm") { + // Skills + $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"')); + //$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write); + //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + + // Job (Description of work to do and skills required) + $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"')); + //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write); + //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + + // Position = Link job - user + $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"')); + //$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write); + //$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + + // Evaluation + $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evalutions"), 1, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); + //$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write); + //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read); + $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read); + } } // Leave/Holiday/Vacation module @@ -1850,29 +1875,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"')); } } - - if (!empty($conf->hrm->enabled)) { - // Skills - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("skill"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"')); - $newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write); - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read); - - // Job - $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Job"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"')); - $newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write); - $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read); - - // Position - $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Position"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"')); - $newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write); - $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read); - - // Evaluation - $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Eval"), 0, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); - $newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write); - $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read); - $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Compare"), 1, $user->rights->hrm->compare->read); - } } diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index b13e5b6bbba..8feb6bd7ac0 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -196,21 +196,21 @@ class modHRM extends DolibarrModules $r = 0; // Skill / Job / Position - $this->rights[$r][0] = 4010; // Permission id (must not be already used) + $this->rights[$r][0] = 4001; // Permission id (must not be already used) $this->rights[$r][1] = 'Read skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read) $r++; - $this->rights[$r][0] = 4011; // Permission id (must not be already used) + $this->rights[$r][0] = 4002; // Permission id (must not be already used) $this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write) $r++; - $this->rights[$r][0] = 4012; // Permission id (must not be already used) + $this->rights[$r][0] = 4003; // Permission id (must not be already used) $this->rights[$r][1] = 'Delete skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; @@ -226,7 +226,7 @@ class modHRM extends DolibarrModules $r++; $this->rights[$r][0] = 4021; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label + $this->rights[$r][1] = 'Create/modify your evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write) @@ -240,7 +240,7 @@ class modHRM extends DolibarrModules $r++; $this->rights[$r][0] = 4023; // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete all evaluations'; // Permission label + $this->rights[$r][1] = 'Delete evaluations'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 07097443628..dc641cb6d09 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -36,21 +36,25 @@ require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - -ini_set('display_errors', 1); - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php'; -$permissiontoread = $user->rights->hrm->compare->read; +$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read; +$permissiontoadd = 0; if (empty($conf->hrm->enabled)) accessforbidden(); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); $langs->load('hrm'); + + +/* + * View + */ + $css = array(); $css[] = '/hrm/css/style.css'; llxHeader('', $langs->trans('SkillComparison'), '', '', 0, 0, '', $css); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 0b887667561..6bd777401f7 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -153,7 +153,7 @@ if (!empty($conf->holiday->enabled)) { print ''; print ''; print ''; - print ''; print ''; diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 02a18f69a40..000c147ab3f 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -276,6 +276,8 @@ CREATE TABLE llx_hrm_job_user( fk_user_modif integer ) ENGINE=innodb; +ALTER TABLE llx_hrm_job_user ADD COLUMN abort_comment varchar(255); + ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); -- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref); diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index dfbd97cdbdc..835cb67f090 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -27,7 +27,7 @@ DescCP=Description SendRequestCP=Create leave request DelayToRequestCP=Leave requests must be made at least %s day(s) before them. MenuConfCP=Balance of leave -SoldeCPUser=Leave balance is %s days. +SoldeCPUser=Leave balance (in days) %s ErrorEndDateCP=You must select an end date greater than the start date. ErrorSQLCreateCP=An SQL error occurred during the creation: ErrorIDFicheCP=An error has occurred, the leave request does not exist. diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 8724bb805a6..dedbb1f5923 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -20,13 +20,14 @@ Employee=Employee NewEmployee=New employee ListOfEmployees=List of employees HrmSetup=HRM module setup +SkillsManagement=Skills management HRM_MAXRANK=Maximum rank for a skill HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift DateEval=Evaluation date JobCard=Job card -Job=Job -Jobs=Jobs +JobPosition=Job +JobsPosition=Jobs NewSkill=New Skill SkillType=Skill type Skilldets=List of ranks for this skill @@ -47,9 +48,8 @@ ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with EvaluationCard=Evaluation card RequiredRank=Required rank for this job EmployeeRank=Employee rank for this skill -Position=Position -Positions=Positions -PositionCard=Position card +EmployeePosition=Employee position +EmployeePositions=Employee positions EmployeesInThisPosition=Employees in this position group1ToCompare=Usergroup to analyze group2ToCompare=Second usergroup for comparison diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e302a0fac85..c55fdeac682 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -726,7 +726,7 @@ if (!empty($arrayfields['u.tms']['checked'])) { if (!empty($arrayfields['u.statut']['checked'])) { // Status print ''; } // Action column From dd953b6e5a684b9430990c6ce192064c5355d55e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Nov 2021 01:09:16 +0100 Subject: [PATCH 2/4] Fix filter --- htdocs/projet/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 444dc6d525f..4078afb20c0 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -751,6 +751,9 @@ $url = DOL_URL_ROOT.'/projet/card.php?action=create'; if (!empty($socid)) { $url .= '&socid='.$socid; } +if ($search_usage_event_organization == 1) { + $url .= '&usage_organize_event=1'; +} $newcardbutton = dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer); print '
'; From 654e20e9fb9044e761b2e49eb119178923f9a3f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Nov 2021 01:11:59 +0100 Subject: [PATCH 3/4] CSS --- htdocs/contrat/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/fourn/facture/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index fad5b67cf27..cdbda7a17b8 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { ?>
- +
'.$langs->trans("Holidays").'
'; + print ''; $out = ''; $nb_holiday = 0; @@ -163,8 +163,9 @@ if (!empty($conf->holiday->enabled)) { $nb_holiday += $nb_type; $out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': '.($nb_type ? price2num($nb_type) : 0).'
'; } - print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'
'; - print $out; + $balancetoshow = $langs->trans('SoldeCPUser', '{s1}'); + print '
'.str_replace('{s1}', img_picto('', 'holiday', 'class="paddingleft pictofixedwidth"').''.round($nb_holiday, 5).'', $balancetoshow).'
'; + print ''.$out.''; print '
'; - print $form->selectarray('search_statut', array('-1'=>'', '0'=>$langs->trans('Disabled'), '1'=>$langs->trans('Enabled')), $search_statut); + print $form->selectarray('search_statut', array('-1'=>'', '0'=>$langs->trans('Disabled'), '1'=>$langs->trans('Enabled')), $search_statut, 0, 0, 0, '', 0, 0, 0, '', 'minwidth50'); print '
trans("Contract"); ?>getNomUrl(1); ?>getNomUrl(1); ?> date_contrat, 'day'); ?> '; if (!empty($arrayfields['f.ref']['checked'])) { - print ''; + print ''; print ''; // Picto + Ref From 7cc93986614cc4b06a6b12f5e5b72dc353fa9e7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Nov 2021 01:24:32 +0100 Subject: [PATCH 4/4] css --- htdocs/fourn/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index c05799bf5d2..e29b928140e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -936,7 +936,7 @@ if ($resql) { $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } @@ -1371,7 +1371,7 @@ if ($resql) { print '
'; // Picto + Ref - print '
'; + print ''; print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); $filename = dol_sanitizeFileName($obj->ref);