Skip to content

Commit 121d1dd

Browse files
frederic34claude
andcommitted
FIX: fix bugs and update deprecated API calls
- ajax_events.php: fix SQL in getDeletedEventsId() comparing datetime field with integer timestamp (use $db->idate() instead of raw int cast) - ajax_events.php: fix birthday textColor always using null $obj->color (not selected in SQL) - ajax_events.php: replace $user->rights-> with $user->hasRight() - ajax_events.php: replace $conf->global-> with getDolGlobalString/Int() - ajax_events.php: replace $conf->module->enabled with isModEnabled() - ajax_events.php: replace direct $_POST access with GETPOST() - ajax_events.php: disable debug dol_syslog() calls active at LOG_WARNING - actions_idreamanewcalendar.class.php: replace $user->rights-> with $user->hasRight() - actions_idreamanewcalendar.class.php: replace $conf->global-> with getDolGlobalString/Int() - actions_idreamanewcalendar.class.php: replace $conf->module->enabled with isModEnabled() - actions_idreamanewcalendar.class.php: replace $_SESSION['newtoken'] with newToken() - actions_idreamanewcalendar.class.php: replace $_GET/$_POST isset() with GETPOSTISSET() - actions_idreamanewcalendar.class.php: fix undefined $mode variable in getPrintActionsFilter() - tabs/agenda_extsites.php: replace $_SESSION['newtoken'] with newToken() - tabs/agenda_extsites.php: replace $user->rights-> with $user->hasRight() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8d83029 commit 121d1dd

3 files changed

Lines changed: 56 additions & 48 deletions

File tree

class/actions_idreamanewcalendar.class.php

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
331331
$MAXAGENDA = getDolGlobalInt('AGENDA_EXT_NB', 6);
332332

333333
// Define list of external calendars (global admin setup)
334-
if (empty($conf->global->AGENDA_DISABLE_EXT)) {
334+
if (!getDolGlobalInt('AGENDA_DISABLE_EXT')) {
335335
$i = 0;
336336
while ($i < $MAXAGENDA) {
337337
$i++;
@@ -340,12 +340,12 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
340340
$offsettz = 'AGENDA_EXT_OFFSETTZ' . $i;
341341
$color = 'AGENDA_EXT_COLOR' . $i;
342342
$buggedfile = 'AGENDA_EXT_BUGGEDFILE' . $i;
343-
if (!empty($conf->global->$source) && !empty($conf->global->$name)) {
343+
if (getDolGlobalString($source) && getDolGlobalString($name)) {
344344
// Note: $conf->global->buggedfile can be empty
345345
// or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
346346
$listofextcals[] = [
347-
'src' => $conf->global->$source,
348-
'name' => $conf->global->$name,
347+
'src' => getDolGlobalString($source),
348+
'name' => getDolGlobalString($name),
349349
'offsettz' => getDolGlobalInt($offsettz),
350350
'color' => getDolGlobalString($color),
351351
'buggedfile' => getDolGlobalInt($buggedfile),
@@ -354,7 +354,7 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
354354
}
355355
}
356356
// Define list of external calendars (user setup)
357-
if (empty($user->conf->AGENDA_DISABLE_EXT)) {
357+
if (!getDolUserInt('AGENDA_DISABLE_EXT')) {
358358
$i = 0;
359359
while ($i < $MAXAGENDA) {
360360
$i++;
@@ -391,7 +391,7 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
391391
// tmpday is a negative or null cursor to know how many days before the 1st to show on month view (if tmpday=0, 1st is monday)
392392
// date('w') is 0 for sunday
393393
$tmpday = -date("w", dol_mktime(12, 0, 0, $month, 1, $year, true)) + 2;
394-
$tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1);
394+
$tmpday += (getDolGlobalInt('MAIN_START_WEEK', 1) - 1);
395395
if ($tmpday >= 1) {
396396
// If tmpday is 0 we start with sunday, if -6, we start with monday of previous week.
397397
$tmpday -= 7;
@@ -456,7 +456,7 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
456456
}
457457

458458
$param = '';
459-
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
459+
if ($actioncode || GETPOSTISSET('search_actioncode')) {
460460
if (is_array($actioncode)) {
461461
foreach ($actioncode as $str_action) {
462462
$param .= "&search_actioncode[]=" . urlencode($str_action);
@@ -468,7 +468,7 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
468468
if ($resourceid > 0) {
469469
$param .= "&search_resourceid=" . urlencode($resourceid);
470470
}
471-
if ($status || isset($_GET['status']) || isset($_POST['status'])) {
471+
if ($status || GETPOSTISSET('status')) {
472472
$param .= '&search_status=' . urlencode($status);
473473
}
474474
if ($filter) {
@@ -530,8 +530,8 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
530530
$param .= '&year=' . $year . '&month=' . $month . ($day ? '&day=' . $day : '');
531531
//print 'x'.$param;
532532

533-
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
534-
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
533+
$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month');
534+
$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview);
535535
// if (empty($mode) && !GETPOSTISSET('mode')) {
536536
// $mode = $defaultview;
537537
// }
@@ -645,15 +645,15 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
645645
</button>
646646
</span>';
647647

648-
if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) {
648+
if (isModEnabled('societe') && $user->hasRight('societe', 'lire')) {
649649
print '<span id="search-customers" class="search-customers">';
650650
print ' <input class="form-control customersAutoComplete" type="text" placeholder="' . $langs->trans('ThirdParty') . '" autocomplete="off">';
651651
print '</span>';
652652
print '<span id="search-states" class="search-states">';
653653
print ' <select class="statesAutoComplete" multiple type="text" title="' . $langs->trans('StateShort') . '"></select>';
654654
print '</span>';
655655
}
656-
if (isModEnabled('projet') && !empty($user->rights->projet->lire)) {
656+
if (isModEnabled('projet') && $user->hasRight('projet', 'lire')) {
657657
print '<span id="search-projects" class="search-projects">';
658658
print ' <input class="form-control projectsAutoComplete" type="text" placeholder="' . $langs->trans("Project") . '" autocomplete="off">';
659659
print ' <input id="project_id" name="project_id" type="hidden">';
@@ -871,6 +871,15 @@ public function beforeAgenda($parameters, &$object, &$action, $hookmanager)
871871
dayMaxEvents: true,
872872
nowIndicator: true,
873873
selectable: true,
874+
select: function (info) {
875+
console.log(info);
876+
ec.addEvent({
877+
start: info.start,
878+
end: info.end,
879+
resourceId: 1
880+
});
881+
ec.unselect();
882+
},
874883
eventResizeStart: function(info) {
875884
console.log('eventResizeStart');
876885
},
@@ -1024,11 +1033,11 @@ private function getPrintActionsFilter($form, $canedit, $status, $year, $month,
10241033

10251034
// Filters
10261035
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
1027-
$html = '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
1036+
$html = '<input type="hidden" name="token" value="' . newToken() . '">';
10281037
$html .= '<input type="hidden" name="year" value="' . $year . '">';
10291038
$html .= '<input type="hidden" name="month" value="' . $month . '">';
10301039
$html .= '<input type="hidden" name="day" value="' . $day . '">';
1031-
$html .= '<input type="hidden" name="action" value="' . $mode . '">';
1040+
$html .= '<input type="hidden" name="action" value="' . dol_escape_htmltag($action) . '">';
10321041
$html .= '<input type="hidden" name="search_showbirthday" value="' . $showbirthday . '">';
10331042

10341043
$html .= '<div class="fichecenter">';
@@ -1053,7 +1062,7 @@ private function getPrintActionsFilter($form, $canedit, $status, $year, $month,
10531062
$html .= $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit);
10541063
$html .= '</td></tr>';
10551064

1056-
if ($conf->resource->enabled) {
1065+
if (isModEnabled('resource')) {
10571066
include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php';
10581067
$formresource = new FormResource($db);
10591068

@@ -1072,11 +1081,11 @@ private function getPrintActionsFilter($form, $canedit, $status, $year, $month,
10721081
$html .= $langs->trans("Type");
10731082
$html .= ' &nbsp;</td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
10741083
$multiselect = 0;
1075-
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) {
1084+
if (getDolGlobalInt('MAIN_ENABLE_MULTISELECT_TYPE')) {
10761085
// We use an option here because it adds bugs when used on agenda page "peruser" and "list"
1077-
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
1086+
$multiselect = (int) getDolGlobalInt('AGENDA_USE_EVENT_TYPE');
10781087
}
1079-
$html .= $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 1);
1088+
$html .= $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (!getDolGlobalInt('AGENDA_USE_EVENT_TYPE') ? 1 : -1), 0, $multiselect, 1);
10801089
$html .= '</td></tr>';
10811090
}
10821091

@@ -1089,7 +1098,7 @@ private function getPrintActionsFilter($form, $canedit, $status, $year, $month,
10891098
// $html .= '</td></tr>';
10901099
// }
10911100

1092-
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
1101+
if (isModEnabled('projet') && $user->hasRight('projet', 'lire')) {
10931102
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
10941103
$formproject = new FormProjets($db);
10951104

core/ajax/ajax_events.php

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
$langs->loadLangs(["agenda", "other", "commercial", "companies", "idreamanewcalendar@idreamanewcalendar"]);
5353

5454
top_httphead('application/json', 1);
55-
// dol_syslog('posted events ajax GET '.print_r($_GET, true), LOG_WARNING);
56-
dol_syslog('posted events ajax POST ' . print_r($_POST, true), LOG_WARNING);
57-
dol_syslog('posted events ajax REQUEST ' . print_r($_REQUEST, true), LOG_WARNING);
55+
// dol_syslog('posted events ajax GET '.print_r($_GET, true), LOG_DEBUG);
56+
// dol_syslog('posted events ajax POST '.print_r($_POST, true), LOG_DEBUG);
57+
// dol_syslog('posted events ajax REQUEST '.print_r($_REQUEST, true), LOG_DEBUG);
5858
$action = GETPOSTISSET('action') ? GETPOST('action', 'aZ09') : 'getevents';
5959
$input = file_get_contents('php://input');
6060
switch ($action) {
@@ -161,7 +161,7 @@
161161
// dol_syslog('posted events ajax REQUEST '.print_r($_POST, true), LOG_NOTICE);
162162
if (GETPOSTISSET('schedule')) {
163163
//$deletedevent = json_decode(GETPOST('schedule'), 'none');
164-
$deletedevent = json_decode($_POST['schedule']);
164+
$deletedevent = json_decode(GETPOST('schedule', 'none'));
165165
dol_syslog('posted events ajax REQUEST ' . print_r($deletedevent, true), LOG_NOTICE);
166166
$action = new ActionComm($db);
167167
$action->fetch($deletedevent->id);
@@ -187,27 +187,27 @@
187187
$sql .= ", dictp.code as country_code";
188188
}
189189
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
190-
if (!$user->rights->societe->client->voir && !$user->socid) {
190+
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
191191
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
192192
}
193-
if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
193+
if (getDolGlobalInt('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
194194
$sql .= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "c_country as dictp ON dictp.rowid=s.fk_pays";
195195
}
196196
$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
197197
if (!empty($user->socid)) {
198198
$sql .= " AND s.rowid = " . $user->socid;
199199
}
200-
if (!$user->rights->societe->client->voir && !$user->socid) {
200+
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
201201
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
202202
}
203-
if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) {
203+
if (getDolGlobalInt('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
204204
$sql .= " AND s.status <> 0";
205205
}
206206
// Add criteria
207207
if ($filterkey && $filterkey != '') {
208208
$sql .= " AND (";
209209
// Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on
210-
$prefix = empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE) ? '%' : '';
210+
$prefix = !getDolGlobalInt('COMPANY_DONOTSEARCH_ANYWHERE') ? '%' : '';
211211
// For natural search
212212
$scriteria = explode(' ', $filterkey);
213213
$i = 0;
@@ -224,7 +224,7 @@
224224
if (count($scriteria) > 1) {
225225
$sql .= ")";
226226
}
227-
if (!empty($conf->barcode->enabled)) {
227+
if (isModEnabled('barcode')) {
228228
$sql .= " OR s.barcode LIKE '" . $db->escape($prefix . $filterkey) . "%'";
229229
}
230230
$sql .= " OR s.code_client LIKE '" . $db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $db->escape($prefix . $filterkey) . "%'";
@@ -236,7 +236,7 @@
236236
$resql = $db->query($sql);
237237
while ($resql && $obj = $db->fetch_object($resql)) {
238238
$label = '';
239-
if ($conf->global->SOCIETE_ADD_REF_IN_LIST) {
239+
if (getDolGlobalInt('SOCIETE_ADD_REF_IN_LIST')) {
240240
if (($obj->client) && (!empty($obj->code_client))) {
241241
$label = $obj->code_client . ' - ';
242242
}
@@ -289,11 +289,11 @@
289289
$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
290290
}
291291
if ($socid > 0) {
292-
if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) {
292+
if (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) {
293293
$sql .= " AND (p.fk_soc = " . $socid . " OR p.fk_soc IS NULL)";
294-
} elseif ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') {
294+
} elseif (getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') != 'all') {
295295
// PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
296-
$sql .= " AND (p.fk_soc IN (" . $socid . ", " . $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY . ") OR p.fk_soc IS NULL)";
296+
$sql .= " AND (p.fk_soc IN (" . $socid . ", " . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') . ") OR p.fk_soc IS NULL)";
297297
}
298298
}
299299
if (!empty($filterkey)) {
@@ -322,19 +322,19 @@
322322

323323
if ($user->hasRight('agenda', 'allactions', 'read')) {
324324
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
325-
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
325+
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
326326
$sql .= ", e.label";
327327
}
328328
$sql .= " FROM " . MAIN_DB_PREFIX . "user as u";
329-
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
329+
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
330330
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "entity as e ON e.rowid=u.entity";
331331
if ($force_entity) {
332332
$sql .= " WHERE u.entity IN (0," . $force_entity . ")";
333333
} else {
334334
$sql .= " WHERE u.entity IS NOT NULL";
335335
}
336336
} else {
337-
if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
337+
if (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
338338
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "usergroup_user as ug";
339339
$sql .= " ON ug.fk_user = u.rowid";
340340
$sql .= " WHERE ug.entity = " . $conf->entity;
@@ -345,19 +345,18 @@
345345
if (!empty($user->socid)) {
346346
$sql .= " AND u.fk_soc = " . $user->socid;
347347
}
348-
if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) {
348+
if (getDolGlobalInt('USER_HIDE_INACTIVE_IN_COMBOBOX') || $noactive) {
349349
$sql .= " AND u.statut <> 0";
350350
}
351351
if (!empty($filterkey)) {
352352
$sql .= natural_search(['u.firstname', 'u.lastname'], $db->escape($filterkey));
353353
}
354-
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
354+
if (!getDolGlobalString('MAIN_FIRSTNAME_NAME_POSITION')) {
355355
// MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname
356356
$sql .= " ORDER BY u.firstname ASC";
357357
} else {
358358
$sql .= " ORDER BY u.lastname ASC";
359359
}
360-
dol_syslog($sql, LOG_WARNING);
361360
// Build output string
362361
$resql = $db->query($sql);
363362
while ($resql && $obj = $db->fetch_object($resql)) {
@@ -411,7 +410,7 @@
411410
case 'gettypeactions':
412411
$preselectedtypes = [];
413412
$response = [];
414-
if (!empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)) {
413+
if (getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE')) {
415414
$preselectedtypes = explode(',', getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE'));
416415
}
417416
$sql = "SELECT id, code, libelle as label, module, type, color, picto";
@@ -543,7 +542,7 @@ function getDeletedEventsId($resourceId)
543542
if ($resourceId != '1') {
544543
return $events;
545544
}
546-
$sql = "SELECT fk_actioncomm FROM " . MAIN_DB_PREFIX . "actioncomm_deleted WHERE tms>'" . (int) (time() - (3 * 60 * 60)) . "'";
545+
$sql = "SELECT fk_actioncomm FROM " . MAIN_DB_PREFIX . "actioncomm_deleted WHERE tms>'" . $db->idate(time() - (3 * 60 * 60)) . "'";
547546
$resql = $db->query($sql);
548547
while ($resql && $obj = $db->fetch_object($resql)) {
549548
$events[] = [
@@ -654,7 +653,7 @@ function getEvents($resourceId, $calendarName, $startDate, $endDate, $offset, $o
654653
if ($pid) {
655654
$sql .= " AND a.fk_project=" . $db->escape($pid);
656655
}
657-
if (!$user->rights->societe->client->voir && !$socid) {
656+
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
658657
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = " . $user->id . ")";
659658
}
660659
if ($socid > 0) {
@@ -777,7 +776,7 @@ function getEvents($resourceId, $calendarName, $startDate, $endDate, $offset, $o
777776
}
778777
// Is Editable ?
779778
$isEditable = true;
780-
if (($event->type_code == 'AC_OTH_AUTO') || (($user->id != $event->userownerid) && !$user->rights->agenda->allactions->create)) {
779+
if (($event->type_code == 'AC_OTH_AUTO') || (($user->id != $event->userownerid) && !$user->hasRight('agenda', 'allactions', 'create'))) {
781780
$isEditable = false;
782781
}
783782

@@ -848,8 +847,8 @@ function getEvents($resourceId, $calendarName, $startDate, $endDate, $offset, $o
848847
// birthdays are readonly
849848
'editable' => false,
850849
'allDay' => true,
851-
// color : The schedule text color
852-
'textColor' => isDarkColor($obj->color) ? '#ffffff' : '#000000',
850+
// color : The schedule text color (birthday events always use dark background #555555)
851+
'textColor' => '#ffffff',
853852
// backgroundColor : The schedule background color
854853
'backgroundColor' => '#555555',
855854
// borderColor : The schedule border color
@@ -975,7 +974,7 @@ function getEvents($resourceId, $calendarName, $startDate, $endDate, $offset, $o
975974
//die($e);
976975
return [];
977976
}
978-
dol_syslog('Ical : ' . $namecal . ' cachetime : ' . print_r($ical->events(), true), LOG_WARNING);
977+
dol_syslog('Ical : loaded ' . $namecal . ' cachetime : ' . $cachetime, LOG_DEBUG);
979978
// on cache le fichier parsé
980979
dol_filecache($cachedir, $filename, $ical);
981980
} else {

tabs/agenda_extsites.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@
170170

171171
print '<form name="extsitesconfig" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
172172
print '<input type="hidden" name="id" value="' . $id . '">';
173-
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
173+
print '<input type="hidden" name="token" value="' . newToken() . '">';
174174

175175
$head = user_prepare_head($object);
176176

177177
print dol_get_fiche_head($head, 'extsites', $langs->trans("User"), -1, 'user');
178178

179179
$linkback = '';
180180

181-
if ($user->rights->user->user->lire || $user->admin) {
181+
if ($user->hasRight('user', 'user', 'lire') || $user->admin) {
182182
$linkback = '<a href="' . DOL_URL_ROOT . '/user/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
183183
}
184184

0 commit comments

Comments
 (0)