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