From 81863e45f4284630bb0a848b1c8b8e53a11e4038 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Sep 2021 18:09:50 +0200 Subject: [PATCH] Fix link --- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 0a01a3f5996..a09d7aff6de 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -152,7 +152,7 @@ if (!$permissiontoread) accessforbidden(); * Actions */ -if (preg_match('/^set/', $action) && $projectid > 0) { +if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) { $project = new Project($db); //If "set" fields keys is in projects fields $project_attr=preg_replace('/^set/', '', $action); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index a6ea42da346..39cd3e0aded 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -36,6 +36,7 @@ if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } +global $dolibarr_main_url_root; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -158,6 +159,24 @@ if (!$permissiontoread) accessforbidden(); * Actions */ +if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) { + $project = new Project($db); + //If "set" fields keys is in projects fields + $project_attr=preg_replace('/^set/', '', $action); + if (array_key_exists($project_attr, $project->fields)) { + $result = $project->fetch($projectid); + if ($result < 0) { + setEventMessages(null, $project->errors, 'errors'); + } else { + $project->{$project_attr}=GETPOST($project_attr); + $result=$project->update($user); + if ($result < 0) { + setEventMessages(null, $project->errors, 'errors'); + } + } + } +} + if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; @@ -494,7 +513,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print ""; } - print ''; + print ''; $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext); @@ -541,7 +560,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { //print ''; print ''; $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print '