dolibarr 20.0.0
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26require '../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
28
29// Load translation files required by the page
30$langs->loadLangs(array('bookmarks', 'admin'));
31
32// Get Parameters
33$action = GETPOST('action', 'aZ09');
34$massaction = GETPOST('massaction', 'alpha');
35$show_files = GETPOSTINT('show_files');
36$confirm = GETPOST('confirm', 'alpha');
37$cancel = GETPOST('cancel', 'alpha');
38$toselect = GETPOST('toselect', 'array');
39$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
40$backtopage = GETPOST('backtopage', 'alpha');
41$optioncss = GETPOST('optioncss', 'alpha');
42$mode = GETPOST('mode', 'aZ');
43
44$id = GETPOSTINT("id");
45$search_title = GETPOST('search_title', 'alpha');
46
47// Load variable for pagination
48$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
49$sortfield = GETPOST('sortfield', 'aZ09comma');
50$sortorder = GETPOST('sortorder', 'aZ09comma');
51$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
52if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
53 // If $page is not defined, or '' or -1 or if we click on clear filters
54 $page = 0;
55}
56$offset = $limit * $page;
57$pageprev = $page - 1;
58$pagenext = $page + 1;
59if (!$sortfield) {
60 $sortfield = 'b.position';
61}
62if (!$sortorder) {
63 $sortorder = 'ASC';
64}
65
66// Initialize Objects
67$object = new Bookmark($db);
68$extrafields = new ExtraFields($db);
69$arrayfields = array();
70$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
71
72if ($id > 0) {
73 $object->fetch($id);
74}
75
76$object->fields = dol_sort_array($object->fields, 'position');
77$arrayfields = dol_sort_array($arrayfields, 'position');
78
79// Security check
80restrictedArea($user, 'bookmark', $object);
81
82// Permissions
83$permissiontoread = $user->hasRight('bookmark', 'lire');
84$permissiontoadd = $user->hasRight('bookmark', 'creer');
85$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id));
86
87
88/*
89 * Actions
90 */
91
92if (GETPOST('cancel', 'alpha')) {
93 $action = 'list';
94 $massaction = '';
95}
96if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
97 $massaction = '';
98}
99
100$parameters = array();
101$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
102if ($reshook < 0) {
103 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
104}
105
106if (empty($reshook)) {
107 // Selection of new fields
108 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
109
110 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
111 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
112 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
113 }
114
115 // Mass actions
116 $objectclass = 'Bookmark';
117 $objectlabel = 'Bookmark';
118 $uploaddir = $conf->bookmark->dir_output;
119 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
120
121 if ($action == 'delete' && $permissiontodelete) {
122 $object->fetch($id);
123 $res = $object->delete($user);
124 if ($res > 0) {
125 header("Location: ".$_SERVER["PHP_SELF"]);
126 exit;
127 } else {
128 setEventMessages($object->error, $object->errors, 'errors');
129 $action = '';
130 }
131 }
132}
133
134
135/*
136 * View
137 */
138
139$form = new Form($db);
140
141$now = dol_now();
142
143//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
144$help_url = '';
145$title = $langs->trans("Bookmarks");
146$morejs = array();
147$morecss = array();
148
149
150// Build and execute select
151// --------------------------------------------------------------------
152$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
153$sql .= " u.login, u.lastname, u.firstname";
154// Add fields from extrafields
155if (!empty($extrafields->attributes[$object->table_element]['label'])) {
156 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
157 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
158 }
159}
160// Add fields from hooks
161$parameters = array();
162$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
163$sql .= $hookmanager->resPrint;
164$sql = preg_replace('/,\s*$/', '', $sql);
165
166$sqlfields = $sql; // $sql fields to remove for count total
167
168$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
169$sql .= " WHERE 1=1";
170if ($search_title) {
171 $sql .= natural_search('title', $search_title);
172}
173$sql .= " AND b.entity IN (".getEntity('bookmark').")";
174if (!$user->admin) {
175 $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
176}
177
178// Count total nb of records
179$nbtotalofrecords = '';
180if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
181 /* The fast and low memory method to get and count full list converts the sql into a sql count */
182 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
183 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
184 $resql = $db->query($sqlforcount);
185 if ($resql) {
186 $objforcount = $db->fetch_object($resql);
187 $nbtotalofrecords = $objforcount->nbtotalofrecords;
188 } else {
189 dol_print_error($db);
190 }
191
192 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
193 $page = 0;
194 $offset = 0;
195 }
196 $db->free($resql);
197}
198
199// Complete request and execute it with limit
200$sql .= $db->order($sortfield.", position", $sortorder);
201if ($limit) {
202 $sql .= $db->plimit($limit + 1, $offset);
203}
204
205$resql = $db->query($sql);
206if (!$resql) {
207 dol_print_error($db);
208 exit;
209}
210
211$num = $db->num_rows($resql);
212
213
214// Output page
215// --------------------------------------------------------------------
216
217llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist mod-bookmarks page-list');
218
219$arrayofselected = is_array($toselect) ? $toselect : array();
220
221$param = '';
222if (!empty($mode)) {
223 $param .= '&mode='.urlencode($mode);
224}
225if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
226 $param .= '&contextpage='.urlencode($contextpage);
227}
228if ($limit > 0 && $limit != $conf->liste_limit) {
229 $param .= '&limit='.((int) $limit);
230}
231if ($optioncss != '') {
232 $param .= '&optioncss='.urlencode($optioncss);
233}
234// Add $param from extra fields
235include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
236// Add $param from hooks
237$parameters = array('param' => &$param);
238$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
239$param .= $hookmanager->resPrint;
240
241// List of mass actions available
242$arrayofmassactions = array(
243 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
244 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
245 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
246 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
247);
248if (!empty($permissiontodelete)) {
249 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
250}
251if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
252 $arrayofmassactions = array();
253}
254$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
255
256print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
257if ($optioncss != '') {
258 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
259}
260print '<input type="hidden" name="token" value="'.newToken().'">';
261print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
262print '<input type="hidden" name="action" value="list">';
263print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
264print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
265print '<input type="hidden" name="page" value="'.$page.'">';
266print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
267print '<input type="hidden" name="page_y" value="">';
268print '<input type="hidden" name="mode" value="'.$mode.'">';
269
270
271$newcardbutton = '';
272$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', $permissiontoadd);
273
274print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
275
276// Add code for pre mass action (confirmation or email presend form)
277$topicmail = "SendBookmarkRef";
278$modelmail = "bookmark";
279$objecttmp = new Bookmark($db);
280$trackid = 'bookmark'.$object->id;
281include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
282
283$moreforfilter = '';
284
285$parameters = array();
286$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
287if (empty($reshook)) {
288 $moreforfilter .= $hookmanager->resPrint;
289} else {
290 $moreforfilter = $hookmanager->resPrint;
291}
292
293if (!empty($moreforfilter)) {
294 print '<div class="liste_titre liste_titre_bydiv centpercent">';
295 print $moreforfilter;
296 print '</div>';
297}
298
299$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
300$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
301$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
302
303print '<div class="div-table-responsive">';
304print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
305
306// Fields title search
307// --------------------------------------------------------------------
308// TODO
309
310$totalarray = array();
311$totalarray['nbfield'] = 0;
312
313// Fields title label
314// --------------------------------------------------------------------
315print '<tr class="liste_titre">';
316if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
317 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
318 $totalarray['nbfield']++;
319}
320print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
321$totalarray['nbfield']++;
322print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
323$totalarray['nbfield']++;
324print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
325$totalarray['nbfield']++;
326print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
327$totalarray['nbfield']++;
328print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
329$totalarray['nbfield']++;
330print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
331$totalarray['nbfield']++;
332print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
333$totalarray['nbfield']++;
334if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
335 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
336 $totalarray['nbfield']++;
337}
338print '</tr>'."\n";
339
340// Loop on record
341// --------------------------------------------------------------------
342$i = 0;
343$savnbfield = $totalarray['nbfield'];
344$totalarray = array();
345$totalarray['nbfield'] = 0;
346$imaxinloop = ($limit ? min($num, $limit) : $num);
347while ($i < $imaxinloop) {
348 $obj = $db->fetch_object($resql);
349 if (empty($obj)) {
350 break; // Should not happen
351 }
352
353 $object->id = $obj->rowid;
354 $object->ref = $obj->rowid;
355
356 if ($mode == 'kanban') {
357 if ($i == 0) {
358 print '<tr><td colspan="'.$savnbfield.'">';
359 print '<div class="box-flex-container">';
360 }
361 // Output Kanban
362 $selected = -1;
363 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
364 $selected = 0;
365 if (in_array($object->id, $arrayofselected)) {
366 $selected = 1;
367 }
368 }
369 print $object->getKanbanView('', array('selected' => $selected));
370 if ($i == ($imaxinloop - 1)) {
371 print '</div>';
372 print '</td></tr>';
373 }
374 } else {
375 // Show here line of result
376 $j = 0;
377 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
378 // Action column
379 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
380 print '<td class="nowrap center">';
381 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
382 $selected = 0;
383 if (in_array($object->id, $arrayofselected)) {
384 $selected = 1;
385 }
386 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
387 }
388 print '</td>';
389 if (!$i) {
390 $totalarray['nbfield']++;
391 }
392 }
393
394 // Id
395 print '<td class="nowraponall">';
396 print $object->getNomUrl(1);
397 print '</td>';
398
399 $linkintern = 1;
400 if (preg_match('/^http/i', $obj->url)) {
401 $linkintern = 0;
402 }
403 $title = $obj->title;
404 $link = $obj->url;
405 $canedit = $permissiontoadd;
406 $candelete = $permissiontodelete;
407
408 // Title
409 print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
410 print dol_escape_htmltag($title);
411 print "</td>\n";
412
413 // Url
414 print '<td class="tdoverflowmax200">';
415 if (empty($linkintern)) {
416 print img_picto('', 'url', 'class="pictofixedwidth"');
417 print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
418 } else {
419 //print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
420 print '<a class="" href="'.$obj->url.'">';
421 }
422 print $link;
423 print '</a>';
424 print "</td>\n";
425
426 // Target
427 print '<td class="tdoverflowmax100 center">';
428 if ($obj->target == 0) {
429 print $langs->trans("BookmarkTargetReplaceWindowShort");
430 }
431 if ($obj->target == 1) {
432 print $langs->trans("BookmarkTargetNewWindowShort");
433 }
434 print "</td>\n";
435
436 // Author
437 print '<td class="tdoverflowmax100 center">';
438 if ($obj->fk_user > 0) {
439 if (empty($conf->cache['users'][$obj->fk_user])) {
440 $tmpuser = new User($db);
441 $tmpuser->fetch($obj->fk_user);
442 $conf->cache['users'][$obj->fk_user] = $tmpuser;
443 }
444 $tmpuser = $conf->cache['users'][$obj->fk_user];
445 print $tmpuser->getNomUrl(-1);
446 } else {
447 print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
448 if (!$user->admin) {
449 $candelete = false;
450 $canedit = false;
451 }
452 }
453 print "</td>\n";
454
455 // Date creation
456 print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
457
458 // Position
459 print '<td class="right">'.$obj->position."</td>";
460
461 // Action column
462 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
463 print '<td class="nowrap center">';
464 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
465 $selected = 0;
466 if (in_array($object->id, $arrayofselected)) {
467 $selected = 1;
468 }
469 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
470 }
471 print '</td>';
472 if (!$i) {
473 $totalarray['nbfield']++;
474 }
475 }
476
477 print "</tr>\n";
478 }
479
480 $i++;
481}
482
483// Show total line
484include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
485
486// If no record found
487if ($num == 0) {
488 $colspan = 1;
489 foreach ($arrayfields as $key => $val) {
490 if (!empty($val['checked'])) {
491 $colspan++;
492 }
493 }
494 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
495}
496
497$db->free($resql);
498
499$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
500$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
501print $hookmanager->resPrint;
502
503print '</table>'."\n";
504print '</div>'."\n";
505
506print '</form>'."\n";
507
508
509// End of page
510llxFooter();
511$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage bookmarks.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.