From 8712b5eaeac6bdb52570c8ddd22c1ff35787e8c5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:41:25 +0200 Subject: [PATCH] Update evaluation_contact.php --- htdocs/hrm/evaluation_contact.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 205192055c6..1c1d9ed26fd 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -20,11 +20,12 @@ */ /** - * \file evaluation_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Evaluation + * \file htdocs/hrm/evaluation_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Evaluation */ + // Load Dolibarr environment require '../main.inc.php'; @@ -34,8 +35,9 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -53,6 +55,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->evaluation->write; // Security check (enable the most restrictive one) @@ -64,10 +67,13 @@ $permission = $user->rights->hrm->evaluation->write; //if (!$permissiontoread) accessforbidden(); + /* - * Add a new contact + * Action */ +// Add a new contact + if ($action == 'addcontact' && $permission) { $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));