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