Merge pull request #22195 from dolibit-ut/patch-565

Update evaluation_contact.php
This commit is contained in:
Laurent Destailleur 2022-09-25 14:20:23 +02:00 committed by GitHub
commit e7c75eb837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'));