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