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