dolibarr 24.0.2
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// Add hook to complete $arrayfield
81$parameters = array('arrayfields' => &$arrayfields);
82$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
83$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
84
85if ($id > 0) {
86 $object->fetch($id);
87}
88
89$object->fields = dol_sort_array($object->fields, 'position');
90$arrayfields = dol_sort_array($arrayfields, 'position');
91
92// Security check
93restrictedArea($user, 'bookmark', $object);
94
95// Permissions
96$permissiontoread = $user->hasRight('bookmark', 'lire');
97$permissiontoadd = $user->hasRight('bookmark', 'creer');
98$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id));
99
100
101/*
102 * Actions
103 */
104
105if (GETPOST('cancel', 'alpha')) {
106 $action = 'list';
107 $massaction = '';
108}
109if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
110 $massaction = '';
111}
112
113$parameters = array();
114$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
115if ($reshook < 0) {
116 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
117}
118
119if (empty($reshook)) {
120 // Selection of new fields
121 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
122
123 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
124 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
125 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
126 }
127
128 // Without the permission to delete all bookmarks, a user can only delete his own bookmarks: the mass action must
129 // not delete other records than these, whatever the list of ids received.
130 if (!$user->hasRight('bookmark', 'supprimer') && is_array($toselect) && count($toselect) > 0) {
131 $ownbookmarks = array();
132 $sqlown = "SELECT rowid FROM ".MAIN_DB_PREFIX."bookmark";
133 $sqlown .= " WHERE rowid IN (".$db->sanitize(implode(',', array_map('intval', $toselect))).")";
134 $sqlown .= " AND fk_user = ".((int) $user->id);
135 $sqlown .= " AND entity IN (".getEntity('bookmark').")";
136 $resqlown = $db->query($sqlown);
137 if ($resqlown) {
138 while ($objown = $db->fetch_object($resqlown)) {
139 $ownbookmarks[] = (int) $objown->rowid;
140 }
141 }
142 $toselect = $ownbookmarks;
143 }
144
145 // Mass actions
146 $objectclass = 'Bookmark';
147 $objectlabel = 'Bookmark';
148 $uploaddir = $conf->bookmark->dir_output;
149 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
150
151 if ($action == 'delete' && $permissiontodelete) {
152 $object->fetch($id);
153 $res = $object->delete($user);
154 if ($res > 0) {
155 header("Location: ".$_SERVER["PHP_SELF"]);
156 exit;
157 } else {
158 setEventMessages($object->error, $object->errors, 'errors');
159 $action = '';
160 }
161 }
162}
163
164
165/*
166 * View
167 */
168
169$form = new Form($db);
170
171$now = dol_now();
172
173//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
174$help_url = '';
175$title = $langs->trans("Bookmarks");
176$morejs = array();
177$morecss = array();
178
179
180// Build and execute select
181// --------------------------------------------------------------------
182$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
183$sql .= " u.login, u.lastname, u.firstname";
184// Add fields from extrafields
185if (!empty($extrafields->attributes[$object->table_element]['label'])) {
186 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
187 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
188 }
189}
190// Add fields from hooks
191$parameters = array();
192$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
193$sql .= $hookmanager->resPrint;
194$sql = preg_replace('/,\s*$/', '', $sql);
195
196$sqlfields = $sql; // $sql fields to remove for count total
197
198$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
199$sql .= " WHERE 1=1";
200if ($search_title) {
201 $sql .= natural_search('title', $search_title);
202}
203$sql .= " AND b.entity IN (".getEntity('bookmark').")";
204if (!$user->admin) {
205 $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
206}
207
208// Count total nb of records
209$nbtotalofrecords = '';
210if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
211 /* The fast and low memory method to get and count full list converts the sql into a sql count */
212 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
213 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
214 $resql = $db->query($sqlforcount);
215 if ($resql) {
216 $objforcount = $db->fetch_object($resql);
217 $nbtotalofrecords = $objforcount->nbtotalofrecords;
218 } else {
220 }
221
222 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
223 $page = 0;
224 $offset = 0;
225 }
226 $db->free($resql);
227}
228
229// Complete request and execute it with limit
230$sql .= $db->order($sortfield.", position", $sortorder);
231if ($limit) {
232 $sql .= $db->plimit($limit + 1, $offset);
233}
234
235$resql = $db->query($sql);
236if (!$resql) {
238 exit;
239}
240
241$num = $db->num_rows($resql);
242
243
244// Output page
245// --------------------------------------------------------------------
246
247llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist mod-bookmarks page-list');
248
249$arrayofselected = is_array($toselect) ? $toselect : array();
250
251$param = '';
252if (!empty($mode)) {
253 $param .= '&mode='.urlencode($mode);
254}
255if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
256 $param .= '&contextpage='.urlencode($contextpage);
257}
258if ($limit > 0 && $limit != $conf->liste_limit) {
259 $param .= '&limit='.((int) $limit);
260}
261if ($optioncss != '') {
262 $param .= '&optioncss='.urlencode($optioncss);
263}
264// Add $param from extra fields
265include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
266// Add $param from hooks
267$parameters = array('param' => &$param);
268$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
269$param .= $hookmanager->resPrint;
270
271// List of mass actions available
272$arrayofmassactions = array(
273 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
274 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
275 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
276 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
277);
278if (!empty($permissiontodelete)) {
279 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
280}
281if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
282 $arrayofmassactions = array();
283}
284$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
285
286print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
287if ($optioncss != '') {
288 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
289}
290print '<input type="hidden" name="token" value="'.newToken().'">';
291print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
292print '<input type="hidden" name="action" value="list">';
293print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
294print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
295print '<input type="hidden" name="page" value="'.$page.'">';
296print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
297print '<input type="hidden" name="page_y" value="">';
298print '<input type="hidden" name="mode" value="'.$mode.'">';
299
300
301$newcardbutton = '';
302$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);
303
304print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
305
306// Add code for pre mass action (confirmation or email presend form)
307$topicmail = "SendBookmarkRef";
308$modelmail = "bookmark";
309$objecttmp = new Bookmark($db);
310$trackid = 'bookmark'.$object->id;
311include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
312
313$moreforfilter = '';
314
315$parameters = array();
316$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
317if (empty($reshook)) {
318 $moreforfilter .= $hookmanager->resPrint;
319} else {
320 $moreforfilter = $hookmanager->resPrint;
321}
322
323if (!empty($moreforfilter)) {
324 print '<div class="liste_titre liste_titre_bydiv centpercent">';
325 print $moreforfilter;
326 print '</div>';
327}
328
329$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
330$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
331$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
332
333print '<div class="div-table-responsive">';
334print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
335
336// Fields title search
337// --------------------------------------------------------------------
338// TODO
339
340$totalarray = array();
341$totalarray['nbfield'] = 0;
342
343// Fields title label
344// --------------------------------------------------------------------
345print '<tr class="liste_titre">';
346if ($conf->main_checkbox_left_column) {
347 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
348 $totalarray['nbfield']++;
349}
350print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
351$totalarray['nbfield']++;
352print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
353$totalarray['nbfield']++;
354print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
355$totalarray['nbfield']++;
356print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
357$totalarray['nbfield']++;
358print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
359$totalarray['nbfield']++;
360print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
361$totalarray['nbfield']++;
362print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
363$totalarray['nbfield']++;
364if (!$conf->main_checkbox_left_column) {
365 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
366 $totalarray['nbfield']++;
367}
368print '</tr>'."\n";
369
370// Loop on record
371// --------------------------------------------------------------------
372$i = 0;
373$savnbfield = $totalarray['nbfield'];
374$totalarray = array();
375$totalarray['nbfield'] = 0;
376$imaxinloop = ($limit ? min($num, $limit) : $num);
377while ($i < $imaxinloop) {
378 $obj = $db->fetch_object($resql);
379 if (empty($obj)) {
380 break; // Should not happen
381 }
382
383 $object->id = $obj->rowid;
384 $object->ref = $obj->rowid;
385
386 if ($mode == 'kanban') {
387 if ($i == 0) {
388 print '<tr><td colspan="'.$savnbfield.'">';
389 print '<div class="box-flex-container">';
390 }
391 // Output Kanban
392 $selected = -1;
393 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
394 $selected = 0;
395 if (in_array($object->id, $arrayofselected)) {
396 $selected = 1;
397 }
398 }
399 print $object->getKanbanView('', array('selected' => $selected));
400 if ($i == ($imaxinloop - 1)) {
401 print '</div>';
402 print '</td></tr>';
403 }
404 } else {
405 // Show here line of result
406 $j = 0;
407 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
408 // Action column
409 if ($conf->main_checkbox_left_column) {
410 print '<td class="nowrap center">';
411 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
412 $selected = 0;
413 if (in_array($object->id, $arrayofselected)) {
414 $selected = 1;
415 }
416 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
417 }
418 print '</td>';
419 if (!$i) {
420 $totalarray['nbfield']++;
421 }
422 }
423
424 // Id
425 print '<td class="nowraponall">';
426 print $object->getNomUrl(1);
427 print '</td>';
428
429 $linkintern = 1;
430 if (preg_match('/^http/i', $obj->url)) {
431 $linkintern = 0;
432 }
433 $title = $obj->title;
434 $link = $obj->url;
435 $canedit = $permissiontoadd;
436 $candelete = $permissiontodelete;
437
438 // Title
439 print '<td class="tdoverflowmax250" alt="'.dol_escape_htmltag($title).'">';
440 print dol_escape_htmltag($title);
441 print "</td>\n";
442
443 // Url
444 print '<td class="tdoverflowmax250">';
445 if (empty($linkintern)) {
446 print img_picto('', 'url', 'class="pictofixedwidth"');
447 print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
448 } else {
449 print '<a class="" href="'.$obj->url.'">';
450 }
451 print $link;
452 print '</a>';
453 print "</td>\n";
454
455 // Target
456 print '<td class="tdoverflowmax125 center">';
457 if ($obj->target == 0) {
458 print $langs->trans("BookmarkTargetReplaceWindowShort");
459 }
460 if ($obj->target == 1) {
461 print $langs->trans("BookmarkTargetNewWindowShort");
462 }
463 print "</td>\n";
464
465 // Author
466 print '<td class="tdoverflowmax125 center">';
467 if ($obj->fk_user > 0) {
468 if (empty($conf->cache['users'][$obj->fk_user])) {
469 $tmpuser = new User($db);
470 $tmpuser->fetch($obj->fk_user);
471 $conf->cache['users'][$obj->fk_user] = $tmpuser;
472 }
473 $tmpuser = $conf->cache['users'][$obj->fk_user];
474 print $tmpuser->getNomUrl(-1);
475 } else {
476 print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
477 if (!$user->admin) {
478 $candelete = false;
479 $canedit = false;
480 }
481 }
482 print "</td>\n";
483
484 // Date creation
485 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>";
486
487 // Position
488 print '<td class="right">'.$obj->position."</td>";
489
490 // Action column
491 if (!$conf->main_checkbox_left_column) {
492 print '<td class="nowrap center">';
493 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
494 $selected = 0;
495 if (in_array($object->id, $arrayofselected)) {
496 $selected = 1;
497 }
498 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
499 }
500 print '</td>';
501 if (!$i) {
502 $totalarray['nbfield']++;
503 }
504 }
505
506 print "</tr>\n";
507 }
508
509 $i++;
510}
511
512// Show total line
513include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
514
515// If no record found
516if ($num == 0) {
517 $colspan = 1;
518 foreach ($arrayfields as $key => $val) {
519 if (!empty($val['checked'])) {
520 $colspan++;
521 }
522 }
523 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
524}
525
526$db->free($resql);
527
528$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
529$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
530print $hookmanager->resPrint;
531
532print '</table>'."\n";
533print '</div>'."\n";
534
535print '</form>'."\n";
536
537
538// End of page
539llxFooter();
540$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:501
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)
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, $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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.