dolibarr  17.0.4
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
7  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
8  * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
9  * Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
10  * Copyright (C) 2022 Charlène Benke <charlene@patas-monkey.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
32 // Load Dolibarr environment
33 require '../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
38 if (isModEnabled('project')) {
39  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
40 }
41 if (isModEnabled('contrat')) {
42  require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
43 }
44 
45 // Load translation files required by the page
46 $langs->loadLangs(array('companies', 'bills', 'interventions'));
47 if (isModEnabled('project')) {
48  $langs->load("projects");
49 }
50 if (isModEnabled('contrat')) {
51  $langs->load("contracts");
52 }
53 
54 $action = GETPOST('action', 'aZ09');
55 $massaction = GETPOST('massaction', 'alpha');
56 $show_files = GETPOST('show_files', 'int');
57 $confirm = GETPOST('confirm', 'alpha');
58 $toselect = GETPOST('toselect', 'array');
59 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'interventionlist';
60 
61 $search_ref = GETPOST('search_ref') ?GETPOST('search_ref', 'alpha') : GETPOST('search_inter', 'alpha');
62 $search_ref_client = GETPOST('search_ref_client', 'alpha');
63 $search_company = GETPOST('search_company', 'alpha');
64 $search_desc = GETPOST('search_desc', 'alpha');
65 $search_projet_ref = GETPOST('search_projet_ref', 'alpha');
66 $search_contrat_ref = GETPOST('search_contrat_ref', 'alpha');
67 $search_status = GETPOST('search_status', 'alpha');
68 $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
69 $optioncss = GETPOST('optioncss', 'alpha');
70 $socid = GETPOST('socid', 'int');
71 
72 $diroutputmassaction = $conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id;
73 
74 // Load variable for pagination
75 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
76 $sortfield = GETPOST('sortfield', 'aZ09comma');
77 $sortorder = GETPOST('sortorder', 'aZ09comma');
78 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
79 if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
80  // If $page is not defined, or '' or -1 or if we click on clear filters
81  $page = 0;
82 }
83 $offset = $limit * $page;
84 $pageprev = $page - 1;
85 $pagenext = $page + 1;
86 if (!$sortorder) {
87  $sortorder = "DESC";
88 }
89 if (!$sortfield) {
90  $sortfield = "f.ref";
91 }
92 
93 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
94 $object = new Fichinter($db);
95 $hookmanager->initHooks(array('interventionlist'));
96 
97 $extrafields = new ExtraFields($db);
98 
99 // Fetch optionals attributes and labels
100 $extrafields->fetch_name_optionals_label($object->table_element);
101 
102 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
103 
104 // List of fields to search into when doing a "search in all"
105 $fieldstosearchall = array(
106  'f.ref'=>'Ref',
107  's.nom'=>"ThirdParty",
108  'f.description'=>'Description',
109  'f.note_public'=>'NotePublic',
110  'fd.description'=>'DescriptionOfLine',
111 );
112 if (empty($user->socid)) {
113  $fieldstosearchall["f.note_private"] = "NotePrivate";
114 }
115 if (!empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
116  unset($fieldstosearchall['fd.description']);
117 }
118 
119 // Definition of fields for list
120 $arrayfields = array(
121  'f.ref'=>array('label'=>'Ref', 'checked'=>1),
122  'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1),
123  's.nom'=>array('label'=>'ThirdParty', 'checked'=>1),
124  'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)),
125  'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)),
126  'f.description'=>array('label'=>'Description', 'checked'=>1),
127  'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500),
128  'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>500),
129  'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
130  'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
131  'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000),
132  'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
133  'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
134  'fd.duree'=>array('label'=>'DurationOfLine', 'type'=> 'duration', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), //type duration is here because in database, column 'duree' is double
135 );
136 // Extra fields
137 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
138 
139 $object->fields = dol_sort_array($object->fields, 'position');
140 $arrayfields = dol_sort_array($arrayfields, 'position');
141 
142 // Security check
143 $id = GETPOST('id', 'int');
144 if ($user->socid) {
145  $socid = $user->socid;
146 }
147 $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
148 
149 $permissiontoread = $user->rights->ficheinter->lire;
150 $permissiontodelete = $user->rights->ficheinter->supprimer;
151 
152 
153 /*
154  * Actions
155  */
156 
157 if (GETPOST('cancel', 'alpha')) {
158  $action = 'list';
159  $massaction = '';
160 }
161 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
162  $massaction = '';
163 }
164 
165 $parameters = array('socid'=>$socid);
166 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
167 if ($reshook < 0) {
168  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
169 }
170 
171 if (empty($reshook)) {
172  // Selection of new fields
173  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
174 
175  // Purge search criteria
176  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
177  $search_ref = "";
178  $search_ref_client = "";
179  $search_company = "";
180  $search_projet_ref = "";
181  $search_contrat_ref = "";
182  $search_desc = "";
183  $search_status = "";
184  $toselect = array();
185  $search_array_options = array();
186  }
187 
188  // Mass actions
189  $objectclass = 'Fichinter';
190  $objectlabel = 'Interventions';
191  $uploaddir = $conf->ficheinter->dir_output;
192  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
193 }
194 
195 
196 
197 /*
198  * View
199  */
200 
201 
202 $form = new Form($db);
203 $formfile = new FormFile($db);
204 $objectstatic = new Fichinter($db);
205 $companystatic = new Societe($db);
206 if (isModEnabled('project')) {
207  $projetstatic = new Project($db);
208 }
209 if (isModEnabled('contrat')) {
210  $contratstatic = new Contrat($db);
211 }
212 
213 $now = dol_now();
214 
215 $help_url = '';
216 $title = $langs->trans("Interventions");
217 $morejs = array();
218 $morecss = array();
219 
220 
221 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
222 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
223 
224 $atleastonefieldinlines = 0;
225 foreach ($arrayfields as $tmpkey => $tmpval) {
226  if (preg_match('/^fd\./', $tmpkey) && !empty($arrayfields[$tmpkey]['checked'])) {
227  $atleastonefieldinlines++;
228  break;
229  }
230 }
231 
232 $sql = "SELECT";
233 $sql .= " f.ref, f.ref_client, f.rowid, f.fk_statut as status, f.description, f.datec as date_creation, f.tms as date_update, f.note_public, f.note_private,";
234 if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) {
235  $sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,";
236 }
237 $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus";
238 if (isModEnabled('project')) {
239  $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title";
240 }
241 if (isModEnabled('contrat')) {
242  $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier";
243 }
244 // Add fields from extrafields
245 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
246  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
247  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
248  }
249 }
250 // Add fields from hooks
251 $parameters = array();
252 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
253 $sql .= $hookmanager->resPrint;
254 
255 $sqlfields = $sql; // $sql fields to remove for count total
256 
257 $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
258 if (isModEnabled('project')) {
259  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid";
260 }
261 if (isModEnabled('contrat')) {
262  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid";
263 }
264 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
265  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (f.rowid = ef.fk_object)";
266 }
267 if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) {
268  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
269 }
270 
271 // Add table from hooks
272 $parameters = array();
273 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
274 $sql .= $hookmanager->resPrint;
275 
276 if (empty($user->rights->societe->client->voir) && empty($socid)) {
277  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
278 }
279 $sql .= ", ".MAIN_DB_PREFIX."societe as s";
280 $sql .= " WHERE f.entity IN (".getEntity('intervention').")";
281 $sql .= " AND f.fk_soc = s.rowid";
282 if ($search_ref) {
283  $sql .= natural_search('f.ref', $search_ref);
284 }
285 if ($search_ref_client) {
286  $sql .= natural_search('f.ref_client', $search_ref_client);
287 }
288 if ($search_company) {
289  $sql .= natural_search('s.nom', $search_company);
290 }
291 if ($search_projet_ref) {
292  $sql .= natural_search('pr.ref', $search_projet_ref);
293 }
294 if ($search_contrat_ref) {
295  $sql .= natural_search('c.ref', $search_contrat_ref);
296 }
297 if ($search_desc) {
298  if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) {
299  $sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
300  } else {
301  $sql .= natural_search(array('f.description'), $search_desc);
302  }
303 }
304 if ($search_status != '' && $search_status >= 0) {
305  $sql .= ' AND f.fk_statut = '.urlencode($search_status);
306 }
307 if (empty($user->rights->societe->client->voir) && empty($socid)) {
308  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
309 }
310 if ($socid) {
311  $sql .= " AND s.rowid = ".((int) $socid);
312 }
313 if ($search_all) {
314  $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
315 }
316 // Add where from extra fields
317 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
318 // Add where from hooks
319 $parameters = array();
320 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
321 $sql .= $hookmanager->resPrint;
322 // Add GroupBy from hooks
323 $parameters = array('search_all' => $search_all, 'fieldstosearchall' => $fieldstosearchall);
324 $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
325 $sql .= $hookmanager->resPrint;
326 
327 // Count total nb of records
328 $nbtotalofrecords = '';
329 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
330  /* The fast and low memory method to get and count full list converts the sql into a sql count */
331  $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
332  $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
333  $resql = $db->query($sqlforcount);
334  if ($resql) {
335  $objforcount = $db->fetch_object($resql);
336  $nbtotalofrecords = $objforcount->nbtotalofrecords;
337  } else {
338  dol_print_error($db);
339  }
340 
341  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
342  $page = 0;
343  $offset = 0;
344  }
345  $db->free($resql);
346 }
347 
348 // Complete request and execute it with limit
349 $sql .= $db->order($sortfield, $sortorder);
350 if ($limit) {
351  $sql .= $db->plimit($limit + 1, $offset);
352 }
353 
354 $resql = $db->query($sql);
355 if (!$resql) {
356  dol_print_error($db);
357  exit;
358 }
359 
360 $num = $db->num_rows($resql);
361 
362 
363 // Direct jump if only one record found
364 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
365  $obj = $db->fetch_object($resql);
366  $id = $obj->rowid;
367  header("Location: ".dol_buildpath('/fichinter/card.php', 1).'?id='.$id);
368  exit;
369 }
370 
371 
372 // Output page
373 // --------------------------------------------------------------------
374 
375 llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
376 
377 
378 $arrayofselected = is_array($toselect) ? $toselect : array();
379 
380 if ($socid > 0) {
381  $soc = new Societe($db);
382  $soc->fetch($socid);
383  if (empty($search_company)) {
384  $search_company = $soc->name;
385  }
386 }
387 
388 $param = '';
389 if (!empty($mode)) {
390  $param .= '&mode='.urlencode($mode);
391 }
392 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
393  $param .= '&contextpage='.urlencode($contextpage);
394 }
395 if ($limit > 0 && $limit != $conf->liste_limit) {
396  $param .= '&limit='.urlencode($limit);
397 }
398 if ($search_all) {
399  $param .= "&search_all=".urlencode($search_all);
400 }
401 if ($socid) {
402  $param .= "&socid=".urlencode($socid);
403 }
404 if ($search_ref) {
405  $param .= "&search_ref=".urlencode($search_ref);
406 }
407 if ($search_ref_client) {
408  $param .= "&search_ref_client=".urlencode($search_ref_client);
409 }
410 if ($search_company) {
411  $param .= "&search_company=".urlencode($search_company);
412 }
413 if ($search_desc) {
414  $param .= "&search_desc=".urlencode($search_desc);
415 }
416 if ($search_status != '' && $search_status > -1) {
417  $param .= "&search_status=".urlencode($search_status);
418 }
419 if ($show_files) {
420  $param .= '&show_files='.urlencode($show_files);
421 }
422 if ($optioncss != '') {
423  $param .= '&optioncss='.urlencode($optioncss);
424 }
425 // Add $param from extra fields
426 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
427 // Add $param from hooks
428 $parameters = array();
429 $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
430 $param .= $hookmanager->resPrint;
431 
432 // List of mass actions available
433 $arrayofmassactions = array(
434  'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
435  'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
436  //'presend'=>$langs->trans("SendByMail"),
437 );
438 if (!empty($permissiontodelete)) {
439  $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
440 }
441 if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
442  $arrayofmassactions = array();
443 }
444 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
445 
446 
447 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
448 if ($optioncss != '') {
449  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
450 }
451 print '<input type="hidden" name="token" value="'.newToken().'">';
452 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
453 print '<input type="hidden" name="action" value="list">';
454 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
455 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
456 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
457 
458 $newcardbutton = '';
459 $url = DOL_URL_ROOT.'/fichinter/card.php?action=create';
460 if (!empty($socid)) {
461  $url .= '&socid='.$socid;
462 }
463 $newcardbutton = dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->rights->ficheinter->creer);
464 
465 print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
466 
467 $topicmail = "Information";
468 $modelmail = "intervention";
469 $objecttmp = new Fichinter($db);
470 $trackid = 'int'.$object->id;
471 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
472 
473 if ($search_all) {
474  foreach ($fieldstosearchall as $key => $val) {
475  $fieldstosearchall[$key] = $langs->trans($val);
476  }
477  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
478 }
479 
480 $moreforfilter = '';
481 
482 $parameters = array();
483 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
484 if (empty($reshook)) {
485  $moreforfilter .= $hookmanager->resPrint;
486 } else {
487  $moreforfilter = $hookmanager->resPrint;
488 }
489 
490 if (!empty($moreforfilter)) {
491  print '<div class="liste_titre liste_titre_bydiv centpercent">';
492  print $moreforfilter;
493  print '</div>';
494 }
495 
496 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
497 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
498 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
499 
500 print '<div class="div-table-responsive">';
501 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
502 
503 // Fields title search
504 // --------------------------------------------------------------------
505 print '<tr class="liste_titre_filter">';
506 // Action column
507 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
508  print '<td class="liste_titre maxwidthsearch">';
509  $searchpicto = $form->showFilterButtons('left');
510  print $searchpicto;
511  print '</td>';
512 }
513 if (!empty($arrayfields['f.ref']['checked'])) {
514  print '<td class="liste_titre">';
515  print '<input type="text" class="flat" name="search_ref" value="'.$search_ref.'" size="8">';
516  print '</td>';
517 }
518 if (!empty($arrayfields['f.ref_client']['checked'])) {
519  print '<td class="liste_titre">';
520  print '<input type="text" class="flat" name="search_ref_client" value="'.$search_ref_client.'" size="8">';
521  print '</td>';
522 }
523 if (!empty($arrayfields['s.nom']['checked'])) {
524  print '<td class="liste_titre">';
525  print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
526  print '</td>';
527 }
528 if (!empty($arrayfields['pr.ref']['checked'])) {
529  print '<td class="liste_titre">';
530  print '<input type="text" class="flat" name="search_projet_ref" value="'.$search_projet_ref.'" size="8">';
531  print '</td>';
532 }
533 if (!empty($arrayfields['c.ref']['checked'])) {
534  print '<td class="liste_titre">';
535  print '<input type="text" class="flat" name="search_contrat_ref" value="'.$search_contrat_ref.'" size="8">';
536  print '</td>';
537 }
538 if (!empty($arrayfields['f.description']['checked'])) {
539  print '<td class="liste_titre">';
540  print '<input type="text" class="flat" name="search_desc" value="'.$search_desc.'" size="12">';
541  print '</td>';
542 }
543 // Extra fields
544 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
545 
546 // Fields from hook
547 $parameters = array('arrayfields'=>$arrayfields);
548 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
549 print $hookmanager->resPrint;
550 if (!empty($arrayfields['f.datec']['checked'])) {
551  // Date creation
552  print '<td class="liste_titre">';
553  print '</td>';
554 }
555 if (!empty($arrayfields['f.tms']['checked'])) {
556  // Date modification
557  print '<td class="liste_titre">';
558  print '</td>';
559 }
560 if (!empty($arrayfields['f.note_public']['checked'])) {
561  // Note public
562  print '<td class="liste_titre">';
563  print '</td>';
564 }
565 if (!empty($arrayfields['f.note_private']['checked'])) {
566  // Note private
567  print '<td class="liste_titre">';
568  print '</td>';
569 }
570 // Status
571 if (!empty($arrayfields['f.fk_statut']['checked'])) {
572  print '<td class="liste_titre right">';
573  $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short
574  $liststatus = $objectstatic->statuts_short;
575  if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
576  unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
577  }
578  print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1, 0, 0, '', 'onrightofpage');
579  print '</td>';
580 }
581 // Fields of detail line
582 if (!empty($arrayfields['fd.description']['checked'])) {
583  print '<td class="liste_titre">&nbsp;</td>';
584 }
585 if (!empty($arrayfields['fd.date']['checked'])) {
586  print '<td class="liste_titre">&nbsp;</td>';
587 }
588 if (!empty($arrayfields['fd.duree']['checked'])) {
589  print '<td class="liste_titre">&nbsp;</td>';
590 }
591 // Action column
592 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
593  print '<td class="liste_titre maxwidthsearch">';
594  $searchpicto = $form->showFilterButtons();
595  print $searchpicto;
596  print '</td>';
597 }
598 print '</tr>'."\n";
599 
600 $totalarray = array();
601 $totalarray['nbfield'] = 0;
602 
603 // Fields title label
604 // --------------------------------------------------------------------
605 print '<tr class="liste_titre">';
606 // Action column
607 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
608  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
609 }
610 if (!empty($arrayfields['f.ref']['checked'])) {
611  print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
612 }
613 if (!empty($arrayfields['f.ref_client']['checked'])) {
614  print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], "f.ref_client", "", $param, '', $sortfield, $sortorder);
615 }
616 if (!empty($arrayfields['s.nom']['checked'])) {
617  print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
618 }
619 if (!empty($arrayfields['pr.ref']['checked'])) {
620  print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], "pr.ref", "", $param, '', $sortfield, $sortorder);
621 }
622 if (!empty($arrayfields['c.ref']['checked'])) {
623  print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder);
624 }
625 if (!empty($arrayfields['f.description']['checked'])) {
626  print_liste_field_titre($arrayfields['f.description']['label'], $_SERVER["PHP_SELF"], "f.description", "", $param, '', $sortfield, $sortorder);
627 }
628 // Extra fields
629 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
630 // Hook fields
631 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
632 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
633 print $hookmanager->resPrint;
634 if (!empty($arrayfields['f.datec']['checked'])) {
635  print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
636 }
637 if (!empty($arrayfields['f.tms']['checked'])) {
638  print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
639 }
640 if (!empty($arrayfields['f.note_public']['checked'])) {
641  print_liste_field_titre($arrayfields['f.note_public']['label'], $_SERVER["PHP_SELF"], "f.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
642 }
643 if (!empty($arrayfields['f.note_private']['checked'])) {
644  print_liste_field_titre($arrayfields['f.note_private']['label'], $_SERVER["PHP_SELF"], "f.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
645 }
646 if (!empty($arrayfields['f.fk_statut']['checked'])) {
647  print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
648 }
649 if (!empty($arrayfields['fd.description']['checked'])) {
650  print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], '');
651 }
652 if (!empty($arrayfields['fd.date']['checked'])) {
653  print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center ');
654 }
655 if (!empty($arrayfields['fd.duree']['checked'])) {
656  print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right ');
657 }
658 
659 // Action column
660 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
661  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
662 }
663 print "</tr>\n";
664 
665 
666 // Loop on record
667 // --------------------------------------------------------------------
668 $total = 0;
669 $i = 0;
670 $savnbfield = $totalarray['nbfield'];
671 $totalarray = array();
672 $totalarray['nbfield'] = 0;
673 $totalarray['val'] = array();
674 $totalarray['val']['fd.duree'] = 0;
675 $imaxinloop = ($limit ? min($num, $limit) : $num);
676 while ($i < $imaxinloop) {
677  $obj = $db->fetch_object($resql);
678  if (empty($obj)) {
679  break; // Should not happen
680  }
681 
682  // Store properties in $object
683  //$object->setVarsFromFetchObj($obj);
684 
685  $objectstatic->id = $obj->rowid;
686  $objectstatic->ref = $obj->ref;
687  $objectstatic->ref_client = $obj->ref_client;
688  $objectstatic->statut = $obj->status;
689  $objectstatic->status = $obj->status;
690 
691  $companystatic->name = $obj->name;
692  $companystatic->id = $obj->socid;
693  $companystatic->client = $obj->client;
694  $companystatic->fournisseur = $obj->fournisseur;
695  $companystatic->email = $obj->email;
696  $companystatic->status = $obj->thirdpartystatus;
697 
698  print '<tr class="oddeven">';
699  // Action column
700  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
701  print '<td class="nowrap center">';
702  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
703  $selected = 0;
704  if (in_array($obj->rowid, $arrayofselected)) {
705  $selected = 1;
706  }
707  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
708  }
709  print '</td>';
710  }
711  if (!empty($arrayfields['f.ref']['checked'])) {
712  print "<td>";
713 
714  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
715  // Picto + Ref
716  print '<td class="nobordernopadding nowraponall">';
717  print $objectstatic->getNomUrl(1);
718  print '</td>';
719  // Warning
720  $warnornote = '';
721  //if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->fichinter->warning_delay)) $warnornote.=img_warning($langs->trans("Late"));
722  if (!empty($obj->note_private)) {
723  $warnornote .= ($warnornote ? ' ' : '');
724  $warnornote .= '<span class="note">';
725  $warnornote .= '<a href="note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
726  $warnornote .= '</span>';
727  }
728  if ($warnornote) {
729  print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
730  print $warnornote;
731  print '</td>';
732  }
733 
734  // Other picto tool
735  print '<td width="16" class="right nobordernopadding hideonsmartphone">';
736  $filename = dol_sanitizeFileName($obj->ref);
737  $filedir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($obj->ref);
738  $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
739  print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
740  print '</td></tr></table>';
741 
742  print "</td>\n";
743  if (!$i) {
744  $totalarray['nbfield']++;
745  }
746  }
747  if (!empty($arrayfields['f.ref_client']['checked'])) {
748  // Customer ref
749  print '<td class="nowrap tdoverflowmax200">';
750  print dol_escape_htmltag($obj->ref_client);
751  print '</td>';
752  if (!$i) {
753  $totalarray['nbfield']++;
754  }
755  }
756  if (!empty($arrayfields['s.nom']['checked'])) {
757  print '<td>';
758  print $companystatic->getNomUrl(1, '', 44);
759  print '</td>';
760  if (!$i) {
761  $totalarray['nbfield']++;
762  }
763  }
764  if (!empty($arrayfields['pr.ref']['checked'])) {
765  print '<td>';
766  $projetstatic->id = $obj->projet_id;
767  $projetstatic->ref = $obj->projet_ref;
768  $projetstatic->title = $obj->projet_title;
769  if ($projetstatic->id > 0) {
770  print $projetstatic->getNomUrl(1, '');
771  }
772  print '</td>';
773  if (!$i) {
774  $totalarray['nbfield']++;
775  }
776  }
777  if (!empty($arrayfields['c.ref']['checked'])) {
778  print '<td>';
779  $contratstatic->id = $obj->contrat_id;
780  $contratstatic->ref = $obj->contrat_ref;
781  $contratstatic->ref_customer = $obj->contrat_ref_customer;
782  $contratstatic->ref_supplier = $obj->contrat_ref_supplier;
783  if ($contratstatic->id > 0) {
784  print $contratstatic->getNomUrl(1, '');
785  print '</td>';
786  }
787  if (!$i) {
788  $totalarray['nbfield']++;
789  }
790  }
791  if (!empty($arrayfields['f.description']['checked'])) {
792  print '<td>'.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)), 48).'</td>';
793  if (!$i) {
794  $totalarray['nbfield']++;
795  }
796  }
797 
798  // Extra fields
799  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
800  // Fields from hook
801  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
802  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
803  print $hookmanager->resPrint;
804  // Date creation
805  if (!empty($arrayfields['f.datec']['checked'])) {
806  print '<td class="center">';
807  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
808  print '</td>';
809  if (!$i) {
810  $totalarray['nbfield']++;
811  }
812  }
813  // Date modification
814  if (!empty($arrayfields['f.tms']['checked'])) {
815  print '<td class="center">';
816  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
817  print '</td>';
818  if (!$i) {
819  $totalarray['nbfield']++;
820  }
821  }
822  // Note public
823  if (!empty($arrayfields['f.note_public']['checked'])) {
824  print '<td class="center">';
825  print dol_string_nohtmltag($obj->note_public);
826  print '</td>';
827  if (!$i) {
828  $totalarray['nbfield']++;
829  }
830  }
831  // Note private
832  if (!empty($arrayfields['f.note_private']['checked'])) {
833  print '<td class="center">';
834  print dol_string_nohtmltag($obj->note_private);
835  print '</td>';
836  if (!$i) {
837  $totalarray['nbfield']++;
838  }
839  }
840  // Status
841  if (!empty($arrayfields['f.fk_statut']['checked'])) {
842  print '<td class="right">'.$objectstatic->getLibStatut(5).'</td>';
843  if (!$i) {
844  $totalarray['nbfield']++;
845  }
846  }
847  // Fields of detail of line
848  if (!empty($arrayfields['fd.description']['checked'])) {
849  print '<td>'.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->descriptiondetail, 1)), 48).'</td>';
850  if (!$i) {
851  $totalarray['nbfield']++;
852  }
853  }
854  if (!empty($arrayfields['fd.date']['checked'])) {
855  print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
856  if (!$i) {
857  $totalarray['nbfield']++;
858  }
859  }
860  if (!empty($arrayfields['fd.duree']['checked'])) {
861  print '<td class="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
862  if (!$i) {
863  $totalarray['nbfield']++;
864  }
865  if (!$i) {
866  $totalarray['type'][$totalarray['nbfield']] = 'duration';
867  }
868  if (!$i) {
869  $totalarray['pos'][$totalarray['nbfield']] = 'fd.duree';
870  }
871  $totalarray['val']['fd.duree'] += $obj->duree;
872  }
873  // Action column
874  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
875  print '<td class="nowrap center">';
876  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
877  $selected = 0;
878  if (in_array($obj->rowid, $arrayofselected)) {
879  $selected = 1;
880  }
881  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
882  }
883  print '</td>';
884  }
885  if (!$i) {
886  $totalarray['nbfield']++;
887  }
888 
889  print '</tr>'."\n";
890 
891  $total += $obj->duree;
892  $i++;
893 }
894 
895 
896 // Show total line
897 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
898 
899 // If no record found
900 if ($num == 0) {
901  $colspan = 1;
902  foreach ($arrayfields as $key => $val) {
903  if (!empty($val['checked'])) {
904  $colspan++;
905  }
906  }
907  print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
908 }
909 
910 $db->free($resql);
911 
912 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
913 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
914 print $hookmanager->resPrint;
915 
916 print '</table>'."\n";
917 print '</div>'."\n";
918 
919 print '</form>'."\n";
920 
921 if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
922  $hidegeneratedfilelistifempty = 1;
923  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
924  $hidegeneratedfilelistifempty = 0;
925  }
926 
927  require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
928  $formfile = new FormFile($db);
929 
930  // Show list of available documents
931  $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
932  $urlsource .= str_replace('&amp;', '&', $param);
933 
934  $filedir = $diroutputmassaction;
935  $genallowed = $user->rights->ficheinter->lire;
936  $delallowed = $user->rights->ficheinter->creer;
937 
938  print $formfile->showdocuments('massfilesarea_interventions', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
939 }
940 
941 // End of page
942 llxFooter();
943 $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 contracts.
Class to manage standard extra fields.
Class to manage interventions.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
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...
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.
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.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$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.