From f6c6797dc4d077a3b721089ebf91913b7be978a7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:38:18 +0200 Subject: [PATCH] Update compare.php --- htdocs/hrm/compare.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index c8bb01d85e5..686d5820695 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -1,9 +1,9 @@ - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Greg Rastklan - * Copyright (C) 2021 Jean-Pascal BOUDET - * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * \file class/compare.php + * \file htdocs/hrm/compare.php * \ingroup hrm * \brief This file compares skills of user groups * @@ -33,23 +33,29 @@ * */ + +// Load Dolibarr environment 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'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; 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->evaluation->read || $user->rights->hrm->compare_advance->read; -$permissiontoadd = 0; -if (empty($conf->hrm->enabled)) accessforbidden(); -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); +// Load translation files required by the page $langs->load('hrm'); +// Permissions +$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read; +$permissiontoadd = 0; + +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + /* * View