dolibarr  21.0.0-alpha
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 = GETPOSTINT('show_files');
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 = GETPOSTINT("id");
44 $search_title = GETPOST('search_title', 'alpha');
45 
46 // Load variable for pagination
47 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
48 $sortfield = GETPOST('sortfield', 'aZ09comma');
49 $sortorder = GETPOST('sortorder', 'aZ09comma');
50 $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
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, '', '', 0, 0, '', '', '', 'mod-bookmarks page-list');
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('param' => &$param);
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 (GETPOSTINT('nomassaction') || 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  $selected = -1;
362  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
363  $selected = 0;
364  if (in_array($object->id, $arrayofselected)) {
365  $selected = 1;
366  }
367  }
368  print $object->getKanbanView('', array('selected' => $selected));
369  if ($i == ($imaxinloop - 1)) {
370  print '</div>';
371  print '</td></tr>';
372  }
373  } else {
374  // Show here line of result
375  $j = 0;
376  print '<tr data-rowid="'.$object->id.'" class="oddeven">';
377  // Action column
378  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
379  print '<td class="nowrap center">';
380  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
381  $selected = 0;
382  if (in_array($object->id, $arrayofselected)) {
383  $selected = 1;
384  }
385  print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
386  }
387  print '</td>';
388  if (!$i) {
389  $totalarray['nbfield']++;
390  }
391  }
392 
393  // Id
394  print '<td class="nowraponall">';
395  print $object->getNomUrl(1);
396  print '</td>';
397 
398  $linkintern = 1;
399  if (preg_match('/^http/i', $obj->url)) {
400  $linkintern = 0;
401  }
402  $title = $obj->title;
403  $link = $obj->url;
404  $canedit = $permissiontoadd;
405  $candelete = $permissiontodelete;
406 
407  // Title
408  print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
409  print dol_escape_htmltag($title);
410  print "</td>\n";
411 
412  // Url
413  print '<td class="tdoverflowmax200">';
414  if (empty($linkintern)) {
415  print img_picto('', 'url', 'class="pictofixedwidth"');
416  print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
417  } else {
418  //print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
419  print '<a class="" href="'.$obj->url.'">';
420  }
421  print $link;
422  print '</a>';
423  print "</td>\n";
424 
425  // Target
426  print '<td class="tdoverflowmax100 center">';
427  if ($obj->target == 0) {
428  print $langs->trans("BookmarkTargetReplaceWindowShort");
429  }
430  if ($obj->target == 1) {
431  print $langs->trans("BookmarkTargetNewWindowShort");
432  }
433  print "</td>\n";
434 
435  // Author
436  print '<td class="tdoverflowmax100 center">';
437  if ($obj->fk_user > 0) {
438  if (empty($conf->cache['users'][$obj->fk_user])) {
439  $tmpuser = new User($db);
440  $tmpuser->fetch($obj->fk_user);
441  $conf->cache['users'][$obj->fk_user] = $tmpuser;
442  }
443  $tmpuser = $conf->cache['users'][$obj->fk_user];
444  print $tmpuser->getNomUrl(-1);
445  } else {
446  print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
447  if (!$user->admin) {
448  $candelete = false;
449  $canedit = false;
450  }
451  }
452  print "</td>\n";
453 
454  // Date creation
455  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>";
456 
457  // Position
458  print '<td class="right">'.$obj->position."</td>";
459 
460  // Action column
461  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
462  print '<td class="nowrap center">';
463  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
464  $selected = 0;
465  if (in_array($object->id, $arrayofselected)) {
466  $selected = 1;
467  }
468  print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
469  }
470  print '</td>';
471  if (!$i) {
472  $totalarray['nbfield']++;
473  }
474  }
475 
476  print "</tr>\n";
477  }
478 
479  $i++;
480 }
481 
482 // Show total line
483 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
484 
485 // If no record found
486 if ($num == 0) {
487  $colspan = 1;
488  foreach ($arrayfields as $key => $val) {
489  if (!empty($val['checked'])) {
490  $colspan++;
491  }
492  }
493  print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
494 }
495 
496 $db->free($resql);
497 
498 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
499 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
500 print $hookmanager->resPrint;
501 
502 print '</table>'."\n";
503 print '</div>'."\n";
504 
505 print '</form>'."\n";
506 
507 
508 // End of page
509 llxFooter();
510 $db->close();
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition: card.php:58
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:55
llxFooter()
Empty footer.
Definition: wrapper.php:69
Class to manage bookmarks.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
Definition: user.class.php:50
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('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') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:751
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.