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