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