dolibarr  19.0.0-dev
define_holiday.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
4  * Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
5  * Copyright (C) 2016 Regis Houssin <regis.houssin@inodbox.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
29 // Load Dolibarr environment
30 require '../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadlangs(array('users', 'other', 'holiday', 'hrm'));
36 
37 $action = GETPOST('action', 'aZ09');
38 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'defineholidaylist';
39 $massaction = GETPOST('massaction', 'alpha');
40 $optioncss = GETPOST('optioncss', 'alpha');
41 $mode = GETPOST('optioncss', 'aZ');
42 
43 $search_name = GETPOST('search_name', 'alpha');
44 $search_supervisor = GETPOST('search_supervisor', 'int');
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 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
51 $confirm = GETPOST('confirm', 'alpha');
52 
53 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
54 if (empty($page) || $page == -1) {
55  $page = 0;
56 } // If $page is not defined, or '' or -1
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
60 if (!$sortfield) {
61  $sortfield = "t.rowid"; // Set here default search field
62 }
63 if (!$sortorder) {
64  $sortorder = "ASC";
65 }
66 
67 
68 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
69 $hookmanager->initHooks(array('defineholidaylist'));
70 $extrafields = new ExtraFields($db);
71 
72 $holiday = new Holiday($db);
73 
74 
75 if (empty($conf->holiday->enabled)) {
76  accessforbidden('Module not enabled');
77 }
78 
79 // Protection if external user
80 if ($user->socid > 0) {
82 }
83 
84 // If the user does not have perm to read the page
85 if (empty($user->rights->holiday->read)) {
87 }
88 
89 $arrayfields = array(
90  'cp.rowid'=>array('label'=>$langs->trans("Employee"), 'checked'=>1, 'position'=>20),
91  'cp.fk_user'=>array('label'=>$langs->trans("Supervisor"), 'checked'=>1, 'position'=>30),
92  'cp.nbHoliday'=>array('label'=>$langs->trans("MenuConfCP"), 'checked'=>1, 'position'=>40),
93  'cp.note_public'=>array('label'=>$langs->trans("Note"), 'checked'=>1, 'position'=>50),
94 );
95 
96 
97 /*
98  * Actions
99  */
100 
101 if (GETPOST('cancel', 'alpha')) {
102  $action = 'list'; $massaction = '';
103 }
104 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
105  $massaction = '';
106 }
107 
108 $parameters = array();
109 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
110 if ($reshook < 0) {
111  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
112 }
113 
114 if (empty($reshook)) {
115  // Selection of new fields
116  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
117 
118  // Purge search criteria
119  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
120  $search_name = '';
121  $search_supervisor = '';
122  $toselect = array();
123  $search_array_options = array();
124  }
125 
126  // Mass actions
127  $objectclass = 'Holiday';
128  $objectlabel = 'Holiday';
129  $permissiontoread = $user->hasRight('holiday', 'read');
130  $permissiontodelete = $user->hasRight('holiday', 'delete');
131  $permissiontoapprove = $user->hasRight('holiday', 'approve');
132  $uploaddir = $conf->holiday->dir_output;
133  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
134 
135  // If there is an update action
136  if ($action == 'update' && GETPOSTISSET('update_cp')) {
137  $error = 0;
138  $nbok = 0;
139 
140  $typeleaves = $holiday->getTypes(1, 1);
141 
142  $userID = array_keys(GETPOST('update_cp'));
143  $userID = $userID[0];
144 
145  $db->begin();
146 
147  foreach ($typeleaves as $key => $val) {
148  $userValue = GETPOST('nb_holiday_'.$val['rowid']);
149  $userValue = $userValue[$userID];
150 
151  if (!empty($userValue) || (string) $userValue == '0') {
152  $userValue = price2num($userValue, 5);
153  } else {
154  $userValue = '';
155  }
156 
157  //If the user set a comment, we add it to the log comment
158  $note_holiday = GETPOST('note_holiday');
159  $comment = ((isset($note_holiday[$userID]) && !empty($note_holiday[$userID])) ? ' ('.$note_holiday[$userID].')' : '');
160 
161  //print 'holiday: '.$val['rowid'].'-'.$userValue;exit;
162  if ($userValue != '') {
163  // We add the modification to the log (must be done before the update of balance because we read current value of balance inside this method)
164  $result = $holiday->addLogCP($user->id, $userID, $langs->transnoentitiesnoconv('ManualUpdate').$comment, $userValue, $val['rowid']);
165  if ($result < 0) {
166  setEventMessages($holiday->error, $holiday->errors, 'errors');
167  $error++;
168  }
169 
170  // Update of the days of the employee
171  if ($result > 0) {
172  $nbok++;
173 
174  $result = $holiday->updateSoldeCP($userID, $userValue, $val['rowid']);
175  if ($result < 0) {
176  setEventMessages($holiday->error, $holiday->errors, 'errors');
177  $error++;
178  }
179  }
180 
181  // If it first update of balance, we set date to avoid to have sold incremented by new month
182  /*
183  $now=dol_now();
184  $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
185  $sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
186  $sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
187  dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
188  $result = $db->query($sql);
189  */
190  }
191  }
192 
193  if (!$error && !$nbok) {
194  setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings');
195  }
196 
197  if (!$error) {
198  $db->commit();
199 
200  if ($nbok > 0) {
201  setEventMessages('UpdateConfCPOK', null, 'mesgs');
202  }
203  } else {
204  $db->rollback();
205  }
206  }
207 }
208 
209 
210 /*
211  * View
212  */
213 
214 $form = new Form($db);
215 $userstatic = new User($db);
216 
217 
218 $title = $langs->trans('CPTitreMenu');
219 
220 llxHeader('', $title);
221 
222 $typeleaves = $holiday->getTypes(1, 1);
223 $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user.
224 if ($result < 0) {
225  setEventMessages($holiday->error, $holiday->errors, 'errors');
226 }
227 
228 // List of mass actions available
229 $arrayofmassactions = array(
230  //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
231  //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
232  //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
233 );
234 if ($user->hasRight("holiday", "approve")) {
235  $arrayofmassactions['preincreaseholiday'] = img_picto('', 'add', 'class="pictofixedwidth"').$langs->trans("IncreaseHolidays");
236 }
237 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
238 
239 
240 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
241 if ($optioncss != '') {
242  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
243 }
244 print '<input type="hidden" name="token" value="'.newToken().'">';
245 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
246 print '<input type="hidden" name="action" value="update">';
247 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
248 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
249 print '<input type="hidden" name="page" value="'.$page.'">';
250 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
251 
252 $title = $langs->trans("MenuConfCP");
253 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, '', '', 'title_hrm', 0, '', '', $limit, 0, 0, 1);
254 
255 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
256 
257 if ($massaction == 'preincreaseholiday') {
258  $langs->load("holiday", "hrm");
259  require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
260  $staticholiday = new Holiday($db);
261  $arraytypeholidays = $staticholiday->getTypes(1, 1);
262  $formquestion[] = array();
263  $labeltypes = array();
264  foreach ($typeleaves as $key => $val) {
265  $labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
266  }
267  $formquestion [] = array( 'type' => 'other',
268  'name' => 'typeofholiday',
269  'label' => $langs->trans("Type"),
270  'value' => $form->selectarray('typeholiday', $labeltypes, GETPOST('typeholiday', 'alpha'), 1)
271  );
272  $formquestion [] = array( 'type' => 'other',
273  'name' => 'nbdaysholydays',
274  'label' => $langs->trans("NumberDayAddMass"),
275  'value' => '<input name="nbdaysholidays" class="maxwidth75" id="nbdaysholidays" value="'.GETPOST('nbdaysholidays', 'int').'">'
276  );
277  print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassIncreaseHoliday"), $langs->trans("ConfirmMassIncreaseHolidayQuestion", count($toselect)), "increaseholiday", $formquestion, 1, 0, 200, 500, 1);
278 }
279 
280 print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
281 $lastUpdate = $holiday->getConfCP('lastUpdate');
282 if ($lastUpdate) {
283  print '<strong>'.dol_print_date($db->jdate($lastUpdate), 'dayhour').'</strong>';
284  print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).'</strong>'."\n";
285 } else {
286  print $langs->trans('None');
287 }
288 print "</div><br>\n";
289 
290 
291 $filters = '';
292 
293 // Filter on array of ids of all childs
294 $userchilds = array();
295 if (empty($user->rights->holiday->readall)) {
296  $userchilds = $user->getAllChildIds(1);
297  $filters .= ' AND u.rowid IN ('.$db->sanitize(join(', ', $userchilds)).')';
298 }
299 if (!empty($search_name)) {
300  $filters .= natural_search(array('u.firstname', 'u.lastname'), $search_name);
301 }
302 if ($search_supervisor > 0) {
303  $filters .= natural_search(array('u.fk_user'), $search_supervisor, 2);
304 }
305 $filters .= ' AND employee = 1'; // Only employee users are visible
306 
307 $listUsers = $holiday->fetchUsers(false, true, $filters);
308 if (is_numeric($listUsers) && $listUsers < 0) {
309  setEventMessages($holiday->error, $holiday->errors, 'errors');
310 }
311 
312 $i = 0;
313 
314 
315 
316 if (count($typeleaves) == 0) {
317  //print '<div class="info">';
318  print $langs->trans("NoLeaveWithCounterDefined")."<br>\n";
319  print $langs->trans("GoIntoDictionaryHolidayTypes");
320  //print '</div>';
321 } else {
322  $canedit = 0;
323  if (!empty($user->rights->holiday->define_holiday)) {
324  $canedit = 1;
325  }
326 
327  $moreforfilter = '';
328 
329  $selectedfields = '';
330  if ($massactionbutton) {
331  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
332  $selectedfields .= ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
333  $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
334  }
335 
336  print '<div class="div-table-responsive">';
337  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
338 
339  print '<tr class="liste_titre_filter">';
340 
341  // Action column
342  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
343  print '<td class="liste_titre maxwidthsearch center">';
344  $searchpicto = $form->showFilterButtons();
345  print $searchpicto;
346  print '</td>';
347  }
348 
349  // User
350  if (!empty($arrayfields['cp.rowid']['checked'])) {
351  print '<td class="liste_titre">';
352  print '<input type="text" name="search_name" value="'.dol_escape_htmltag($search_name).'" class="maxwidth100">';
353  print '</td>';
354  }
355  // Supervisor
356  if (!empty($arrayfields['cp.fk_user']['checked'])) {
357  print '<td class="liste_titre">';
358  print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, null, null, 0, 0, 0, '', 0, '', 'maxwidth150');
359  print '</td>';
360  }
361  // Type of leave request
362  if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
363  if (count($typeleaves)) {
364  foreach ($typeleaves as $key => $val) {
365  print '<td class="liste_titre" style="text-align:center"></td>';
366  }
367  } else {
368  print '<td class="liste_titre"></td>';
369  }
370  }
371  if (!empty($arrayfields['cp.note_public']['checked'])) {
372  print '<td class="liste_titre"></td>';
373  }
374  print '<td class="liste_titre"></td>';
375 
376  // Action column
377  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
378  print '<td class="liste_titre maxwidthsearch center">';
379  $searchpicto = $form->showFilterButtons();
380  print $searchpicto;
381  print '</td>';
382  }
383 
384  print '</tr>';
385 
386  print '<tr class="liste_titre">';
387  // Action column
388  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
389  print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
390  }
391  if (!empty($arrayfields['cp.rowid']['checked'])) {
392  print_liste_field_titre('Employee', $_SERVER["PHP_SELF"]);
393  }
394  if (!empty($arrayfields['cp.fk_user']['checked'])) {
395  print_liste_field_titre('Supervisor', $_SERVER["PHP_SELF"]);
396  }
397  if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
398  if (count($typeleaves)) {
399  foreach ($typeleaves as $key => $val) {
400  $labeltype = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
401  print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'center ');
402  }
403  } else {
404  print_liste_field_titre('NoLeaveWithCounterDefined', $_SERVER["PHP_SELF"], '', '', '', '');
405  }
406  }
407  if (!empty($arrayfields['cp.note_public']['checked'])) {
408  print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]);
409  }
411  // Action column
412  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
413  print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
414  }
415  print '</tr>';
416  $usersupervisor = new User($db);
417 
418  foreach ($listUsers as $users) {
419  $arrayofselected = is_array($toselect) ? $toselect : array();
420 
421  // If user has not permission to edit/read all, we must see only subordinates
422  if (empty($user->rights->holiday->readall)) {
423  if (($users['rowid'] != $user->id) && (!in_array($users['rowid'], $userchilds))) {
424  continue; // This user is not into hierarchy of current user, we hide it.
425  }
426  }
427 
428  $userstatic->id = $users['rowid'];
429  $userstatic->lastname = $users['lastname'];
430  $userstatic->firstname = $users['firstname'];
431  $userstatic->gender = $users['gender'];
432  $userstatic->photo = $users['photo'];
433  $userstatic->statut = $users['status'];
434  $userstatic->employee = $users['employee'];
435  $userstatic->fk_user = $users['fk_user'];
436 
437  if ($userstatic->fk_user > 0) {
438  $usersupervisor->fetch($userstatic->fk_user);
439  }
440 
441  print '<tr class="oddeven">';
442 
443  // Action column
444  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
445  print '<td class="nowrap center">';
446 
447  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
448  $selected = 0;
449  if (in_array($userstatic->id, $arrayofselected)) {
450  $selected = 1;
451  }
452  print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
453  }
454  print '</td>';
455  }
456 
457  // User
458  if (!empty($arrayfields['cp.rowid']['checked'])) {
459  print '<td>';
460  print $userstatic->getNomUrl(-1);
461  print '</td>';
462  }
463  // Supervisor
464  if (!empty($arrayfields['cp.fk_user']['checked'])) {
465  print '<td>';
466  if ($userstatic->fk_user > 0) {
467  print $usersupervisor->getNomUrl(-1);
468  }
469  print '</td>';
470  }
471 
472  // Amount for each type
473  if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
474  if (count($typeleaves)) {
475  foreach ($typeleaves as $key => $val) {
476  $nbtoshow = '';
477  if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') {
478  $nbtoshow = price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5);
479  }
480 
481  //var_dump($users['rowid'].' - '.$val['rowid']);
482  print '<td style="text-align:center">';
483  if ($canedit) {
484  print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" class="width75 center" />';
485  } else {
486  print $nbtoshow;
487  }
488  //print ' '.$langs->trans('days');
489  print '</td>'."\n";
490  }
491  } else {
492  print '<td></td>';
493  }
494  }
495 
496  // Note
497  if (!empty($arrayfields['cp.note_public']['checked'])) {
498  print '<td>';
499  if ($canedit) {
500  print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
501  }
502  print '</td>';
503  }
504 
505  // Button modify
506  print '<td class="center">';
507  if (!empty($user->rights->holiday->define_holiday)) { // Allowed to set the balance of any user
508  print '<input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Save")).'" class="button smallpaddingimp"/>';
509  }
510  print '</td>'."\n";
511 
512  // Action column
513  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
514  print '<td class="nowrap center">';
515 
516  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
517  $selected = 0;
518  if (in_array($userstatic->id, $arrayofselected)) {
519  $selected = 1;
520  }
521  print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
522  }
523  print '</td>';
524  }
525 
526  print '</tr>';
527 
528  $i++;
529  }
530 
531  if (count($listUsers) <= 0) {
532  $colspan = 2;
533  foreach ($arrayfields as $key => $val) {
534  if (!empty($val['checked'])) {
535  if ($key == 'cp.nbHoliday') {
536  foreach ($typeleaves as $key => $val) {
537  $colspan++;
538  }
539  } else {
540  $colspan++;
541  }
542  }
543  }
544  print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
545  }
546 
547  print '</table>';
548  print '</div>';
549 }
550 
551 print '</form>';
552 
553 // End of page
554 llxFooter();
555 $db->close();
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 standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class of the module paid holiday.
Class to manage Dolibarr users.
Definition: user.class.php:48
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.