dolibarr 19.0.3
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 (getDolGlobalString('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'=>!getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0),
134 'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>!getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0),
135 'fd.duree'=>array('label'=>'DurationOfLine', 'type'=> 'duration', 'checked'=>1, 'enabled'=>!getDolGlobalString('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 (!getDolGlobalString('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 (!getDolGlobalString('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 (!$user->hasRight('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 (!getDolGlobalString('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 (!$user->hasRight('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// Search on sale representative
319/*
320if ($search_sale && $search_sale != '-1') {
321 if ($search_sale == -2) {
322 $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
323 } elseif ($search_sale > 0) {
324 $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
325 }
326}*/
327// Add where from extra fields
328include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
329// Add where from hooks
330$parameters = array();
331$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
332$sql .= $hookmanager->resPrint;
333// Add GroupBy from hooks
334$parameters = array('search_all' => $search_all, 'fieldstosearchall' => $fieldstosearchall);
335$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
336$sql .= $hookmanager->resPrint;
337
338// Count total nb of records
339$nbtotalofrecords = '';
340if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
341 /* The fast and low memory method to get and count full list converts the sql into a sql count */
342 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
343 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
344 $resql = $db->query($sqlforcount);
345 if ($resql) {
346 $objforcount = $db->fetch_object($resql);
347 $nbtotalofrecords = $objforcount->nbtotalofrecords;
348 } else {
349 dol_print_error($db);
350 }
351
352 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
353 $page = 0;
354 $offset = 0;
355 }
356 $db->free($resql);
357}
358
359// Complete request and execute it with limit
360$sql .= $db->order($sortfield, $sortorder);
361if ($limit) {
362 $sql .= $db->plimit($limit + 1, $offset);
363}
364
365$resql = $db->query($sql);
366if (!$resql) {
367 dol_print_error($db);
368 exit;
369}
370
371$num = $db->num_rows($resql);
372
373
374// Direct jump if only one record found
375if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
376 $obj = $db->fetch_object($resql);
377 $id = $obj->rowid;
378 header("Location: ".dol_buildpath('/fichinter/card.php', 1).'?id='.$id);
379 exit;
380}
381
382
383// Output page
384// --------------------------------------------------------------------
385
386llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
387
388
389$arrayofselected = is_array($toselect) ? $toselect : array();
390
391if ($socid > 0) {
392 $soc = new Societe($db);
393 $soc->fetch($socid);
394 if (empty($search_company)) {
395 $search_company = $soc->name;
396 }
397}
398
399$param = '';
400if (!empty($mode)) {
401 $param .= '&mode='.urlencode($mode);
402}
403if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
404 $param .= '&contextpage='.urlencode($contextpage);
405}
406if ($limit > 0 && $limit != $conf->liste_limit) {
407 $param .= '&limit='.((int) $limit);
408}
409if ($search_all) {
410 $param .= "&search_all=".urlencode($search_all);
411}
412if ($socid) {
413 $param .= "&socid=".urlencode($socid);
414}
415if ($search_ref) {
416 $param .= "&search_ref=".urlencode($search_ref);
417}
418if ($search_ref_client) {
419 $param .= "&search_ref_client=".urlencode($search_ref_client);
420}
421if ($search_company) {
422 $param .= "&search_company=".urlencode($search_company);
423}
424if ($search_desc) {
425 $param .= "&search_desc=".urlencode($search_desc);
426}
427if ($search_status != '' && $search_status > -1) {
428 $param .= "&search_status=".urlencode($search_status);
429}
430if ($show_files) {
431 $param .= '&show_files='.urlencode($show_files);
432}
433if ($optioncss != '') {
434 $param .= '&optioncss='.urlencode($optioncss);
435}
436// Add $param from extra fields
437include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
438// Add $param from hooks
439$parameters = array('param' => &$param);
440$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
441$param .= $hookmanager->resPrint;
442
443// List of mass actions available
444$arrayofmassactions = array(
445 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
446 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
447 //'presend'=>$langs->trans("SendByMail"),
448);
449if (!empty($permissiontodelete)) {
450 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
451}
452if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
453 $arrayofmassactions = array();
454}
455$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
456
457
458print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
459if ($optioncss != '') {
460 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
461}
462print '<input type="hidden" name="token" value="'.newToken().'">';
463print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
464print '<input type="hidden" name="action" value="list">';
465print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
466print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
467print '<input type="hidden" name="page" value="'.$page.'">';
468print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
469print '<input type="hidden" name="page_y" value="">';
470print '<input type="hidden" name="mode" value="'.$mode.'">';
471
472$newcardbutton = '';
473$url = DOL_URL_ROOT.'/fichinter/card.php?action=create';
474if (!empty($socid)) {
475 $url .= '&socid='.$socid;
476}
477$newcardbutton = '';
478$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'));
479$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'));
480$newcardbutton .= dolGetButtonTitleSeparator();
481$newcardbutton .= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('ficheinter', 'creer'));
482
483print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
484
485$topicmail = "Information";
486$modelmail = "intervention";
487$objecttmp = new Fichinter($db);
488$trackid = 'int'.$object->id;
489include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
490
491if ($search_all) {
492 $setupstring = '';
493 foreach ($fieldstosearchall as $key => $val) {
494 $fieldstosearchall[$key] = $langs->trans($val);
495 $setupstring .= $key."=".$val.";";
496 }
497 print '<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
498 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'."\n";
499}
500
501$moreforfilter = '';
502
503$parameters = array();
504$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
505if (empty($reshook)) {
506 $moreforfilter .= $hookmanager->resPrint;
507} else {
508 $moreforfilter = $hookmanager->resPrint;
509}
510
511if (!empty($moreforfilter)) {
512 print '<div class="liste_titre liste_titre_bydiv centpercent">';
513 print $moreforfilter;
514 $parameters = array();
515 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
516 print $hookmanager->resPrint;
517 print '</div>';
518}
519
520$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
521$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
522$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
523
524print '<div class="div-table-responsive">';
525print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
526
527// Fields title search
528// --------------------------------------------------------------------
529print '<tr class="liste_titre_filter">';
530// Action column
531if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
532 print '<td class="liste_titre center maxwidthsearch">';
533 $searchpicto = $form->showFilterButtons('left');
534 print $searchpicto;
535 print '</td>';
536}
537if (!empty($arrayfields['f.ref']['checked'])) {
538 print '<td class="liste_titre">';
539 print '<input type="text" class="flat" name="search_ref" value="'.$search_ref.'" size="8">';
540 print '</td>';
541}
542if (!empty($arrayfields['f.ref_client']['checked'])) {
543 print '<td class="liste_titre">';
544 print '<input type="text" class="flat" name="search_ref_client" value="'.$search_ref_client.'" size="8">';
545 print '</td>';
546}
547if (!empty($arrayfields['s.nom']['checked'])) {
548 print '<td class="liste_titre">';
549 print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
550 print '</td>';
551}
552if (!empty($arrayfields['pr.ref']['checked'])) {
553 print '<td class="liste_titre">';
554 print '<input type="text" class="flat" name="search_projet_ref" value="'.$search_projet_ref.'" size="8">';
555 print '</td>';
556}
557if (!empty($arrayfields['c.ref']['checked'])) {
558 print '<td class="liste_titre">';
559 print '<input type="text" class="flat" name="search_contrat_ref" value="'.$search_contrat_ref.'" size="8">';
560 print '</td>';
561}
562if (!empty($arrayfields['f.description']['checked'])) {
563 print '<td class="liste_titre">';
564 print '<input type="text" class="flat" name="search_desc" value="'.$search_desc.'" size="12">';
565 print '</td>';
566}
567// Extra fields
568include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
569
570// Fields from hook
571$parameters = array('arrayfields'=>$arrayfields);
572$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
573print $hookmanager->resPrint;
574if (!empty($arrayfields['f.datec']['checked'])) {
575 // Date creation
576 print '<td class="liste_titre">';
577 print '</td>';
578}
579if (!empty($arrayfields['f.tms']['checked'])) {
580 // Date modification
581 print '<td class="liste_titre">';
582 print '</td>';
583}
584if (!empty($arrayfields['f.note_public']['checked'])) {
585 // Note public
586 print '<td class="liste_titre">';
587 print '</td>';
588}
589if (!empty($arrayfields['f.note_private']['checked'])) {
590 // Note private
591 print '<td class="liste_titre">';
592 print '</td>';
593}
594// Status
595if (!empty($arrayfields['f.fk_statut']['checked'])) {
596 print '<td class="liste_titre right parentonrightofpage">';
597 $liststatus = [
598 $object::STATUS_DRAFT => $langs->transnoentitiesnoconv('Draft'),
599 $object::STATUS_VALIDATED => $langs->transnoentitiesnoconv('Validated'),
600 $object::STATUS_BILLED => $langs->transnoentitiesnoconv('StatusInterInvoiced'),
601 $object::STATUS_CLOSED => $langs->transnoentitiesnoconv('Done'),
602 ];
603 if (!getDolGlobalString('FICHINTER_CLASSIFY_BILLED')) {
604 unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
605 }
606 print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1, 0, 0, '', 'search_status width100 onrightofpage');
607 print '</td>';
608}
609// Fields of detail line
610if (!empty($arrayfields['fd.description']['checked'])) {
611 print '<td class="liste_titre">&nbsp;</td>';
612}
613if (!empty($arrayfields['fd.date']['checked'])) {
614 print '<td class="liste_titre">&nbsp;</td>';
615}
616if (!empty($arrayfields['fd.duree']['checked'])) {
617 print '<td class="liste_titre">&nbsp;</td>';
618}
619// Action column
620if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
621 print '<td class="liste_titre center maxwidthsearch">';
622 $searchpicto = $form->showFilterButtons();
623 print $searchpicto;
624 print '</td>';
625}
626print '</tr>'."\n";
627
628$totalarray = array();
629$totalarray['nbfield'] = 0;
630
631// Fields title label
632// --------------------------------------------------------------------
633print '<tr class="liste_titre">';
634// Action column
635if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
636 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
637 $totalarray['nbfield']++;
638}
639if (!empty($arrayfields['f.ref']['checked'])) {
640 print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
641 $totalarray['nbfield']++;
642}
643if (!empty($arrayfields['f.ref_client']['checked'])) {
644 print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], "f.ref_client", "", $param, '', $sortfield, $sortorder);
645 $totalarray['nbfield']++;
646}
647if (!empty($arrayfields['s.nom']['checked'])) {
648 print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
649 $totalarray['nbfield']++;
650}
651if (!empty($arrayfields['pr.ref']['checked'])) {
652 print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], "pr.ref", "", $param, '', $sortfield, $sortorder);
653 $totalarray['nbfield']++;
654}
655if (!empty($arrayfields['c.ref']['checked'])) {
656 print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder);
657 $totalarray['nbfield']++;
658}
659if (!empty($arrayfields['f.description']['checked'])) {
660 print_liste_field_titre($arrayfields['f.description']['label'], $_SERVER["PHP_SELF"], "f.description", "", $param, '', $sortfield, $sortorder);
661 $totalarray['nbfield']++;
662}
663// Extra fields
664include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
665// Hook fields
666$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
667$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
668print $hookmanager->resPrint;
669if (!empty($arrayfields['f.datec']['checked'])) {
670 print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
671 $totalarray['nbfield']++;
672}
673if (!empty($arrayfields['f.tms']['checked'])) {
674 print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
675 $totalarray['nbfield']++;
676}
677if (!empty($arrayfields['f.note_public']['checked'])) {
678 print_liste_field_titre($arrayfields['f.note_public']['label'], $_SERVER["PHP_SELF"], "f.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
679 $totalarray['nbfield']++;
680}
681if (!empty($arrayfields['f.note_private']['checked'])) {
682 print_liste_field_titre($arrayfields['f.note_private']['label'], $_SERVER["PHP_SELF"], "f.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
683 $totalarray['nbfield']++;
684}
685if (!empty($arrayfields['f.fk_statut']['checked'])) {
686 print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
687 $totalarray['nbfield']++;
688}
689if (!empty($arrayfields['fd.description']['checked'])) {
690 print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], '');
691 $totalarray['nbfield']++;
692}
693if (!empty($arrayfields['fd.date']['checked'])) {
694 print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center ');
695 $totalarray['nbfield']++;
696}
697if (!empty($arrayfields['fd.duree']['checked'])) {
698 print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right ');
699 $totalarray['nbfield']++;
700}
701
702// Action column
703if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
704 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
705 $totalarray['nbfield']++;
706}
707print "</tr>\n";
708
709
710// Loop on record
711// --------------------------------------------------------------------
712$i = 0;
713$savnbfield = $totalarray['nbfield'];
714$totalarray = array();
715$totalarray['nbfield'] = 0;
716$totalarray['val'] = array();
717$totalarray['val']['fd.duree'] = 0;
718$total = 0;
719$imaxinloop = ($limit ? min($num, $limit) : $num);
720while ($i < $imaxinloop) {
721 $obj = $db->fetch_object($resql);
722 if (empty($obj)) {
723 break; // Should not happen
724 }
725
726 // Store properties in $object
727 //$object->setVarsFromFetchObj($obj);
728
729 $objectstatic->id = $obj->rowid;
730 $objectstatic->ref = $obj->ref;
731 $objectstatic->ref_client = $obj->ref_client;
732 $objectstatic->statut = $obj->status; // deprecated
733 $objectstatic->status = $obj->status;
734
735 $companystatic->name = $obj->name;
736 $companystatic->id = $obj->socid;
737 $companystatic->client = $obj->client;
738 $companystatic->fournisseur = $obj->fournisseur;
739 $companystatic->email = $obj->email;
740 $companystatic->status = $obj->thirdpartystatus;
741
742 //mode kanban
743 if ($mode == 'kanban') {
744 if ($i == 0) {
745 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
746 print '<div class="box-flex-container kanban">';
747 }
748
749 // Output Kanban
750 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
751 $selected = 0;
752 if (in_array($object->id, $arrayofselected)) {
753 $selected = 1;
754 }
755 }
756
757 $objectstatic->duration = $obj->duree;
758 $arraydata['thirdparty'] = $companystatic;
759 print $objectstatic->getKanbanView('', $arraydata);
760 if ($i == ($imaxinloop - 1)) {
761 print '</div>';
762 print '</td></tr>';
763 }
764 } else {
765 // Show here line of result
766 $j = 0;
767 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
768 // Action column
769 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
770 print '<td class="nowrap center">';
771 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
772 $selected = 0;
773 if (in_array($obj->rowid, $arrayofselected)) {
774 $selected = 1;
775 }
776 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
777 }
778 print '</td>';
779 if (!$i) {
780 $totalarray['nbfield']++;
781 }
782 }
783 if (!empty($arrayfields['f.ref']['checked'])) {
784 print "<td>";
785
786 print '<table class="nobordernopadding"><tr class="nocellnopadd">';
787 // Picto + Ref
788 print '<td class="nobordernopadding nowraponall">';
789 print $objectstatic->getNomUrl(1);
790 print '</td>';
791 // Warning
792 $warnornote = '';
793 //if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->fichinter->warning_delay)) $warnornote.=img_warning($langs->trans("Late"));
794 if (!empty($obj->note_private)) {
795 $warnornote .= ($warnornote ? ' ' : '');
796 $warnornote .= '<span class="note">';
797 $warnornote .= '<a href="note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
798 $warnornote .= '</span>';
799 }
800 if ($warnornote) {
801 print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
802 print $warnornote;
803 print '</td>';
804 }
805
806 // Other picto tool
807 print '<td width="16" class="right nobordernopadding hideonsmartphone">';
808 $filename = dol_sanitizeFileName($obj->ref);
809 $filedir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($obj->ref);
810 $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
811 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
812 print '</td></tr></table>';
813
814 print "</td>\n";
815 if (!$i) {
816 $totalarray['nbfield']++;
817 }
818 }
819 if (!empty($arrayfields['f.ref_client']['checked'])) {
820 // Customer ref
821 print '<td class="nowrap tdoverflowmax200">';
822 print dol_escape_htmltag($obj->ref_client);
823 print '</td>';
824 if (!$i) {
825 $totalarray['nbfield']++;
826 }
827 }
828 if (!empty($arrayfields['s.nom']['checked'])) {
829 print '<td>';
830 print $companystatic->getNomUrl(1, '', 44);
831 print '</td>';
832 if (!$i) {
833 $totalarray['nbfield']++;
834 }
835 }
836 if (!empty($arrayfields['pr.ref']['checked'])) {
837 print '<td>';
838 $projetstatic->id = $obj->projet_id;
839 $projetstatic->ref = $obj->projet_ref;
840 $projetstatic->title = $obj->projet_title;
841 if ($projetstatic->id > 0) {
842 print $projetstatic->getNomUrl(1, '');
843 }
844 print '</td>';
845 if (!$i) {
846 $totalarray['nbfield']++;
847 }
848 }
849 if (!empty($arrayfields['c.ref']['checked'])) {
850 print '<td>';
851 $contratstatic->id = $obj->contrat_id;
852 $contratstatic->ref = $obj->contrat_ref;
853 $contratstatic->ref_customer = $obj->contrat_ref_customer;
854 $contratstatic->ref_supplier = $obj->contrat_ref_supplier;
855 if ($contratstatic->id > 0) {
856 print $contratstatic->getNomUrl(1, '');
857 print '</td>';
858 }
859 if (!$i) {
860 $totalarray['nbfield']++;
861 }
862 }
863 if (!empty($arrayfields['f.description']['checked'])) {
864 print '<td>'.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)), 48).'</td>';
865 if (!$i) {
866 $totalarray['nbfield']++;
867 }
868 }
869
870 // Extra fields
871 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
872 // Fields from hook
873 $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
874 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
875 print $hookmanager->resPrint;
876 // Date creation
877 if (!empty($arrayfields['f.datec']['checked'])) {
878 print '<td class="center">';
879 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
880 print '</td>';
881 if (!$i) {
882 $totalarray['nbfield']++;
883 }
884 }
885 // Date modification
886 if (!empty($arrayfields['f.tms']['checked'])) {
887 print '<td class="center">';
888 print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
889 print '</td>';
890 if (!$i) {
891 $totalarray['nbfield']++;
892 }
893 }
894 // Note public
895 if (!empty($arrayfields['f.note_public']['checked'])) {
896 print '<td class="center">';
897 print dol_string_nohtmltag($obj->note_public);
898 print '</td>';
899 if (!$i) {
900 $totalarray['nbfield']++;
901 }
902 }
903 // Note private
904 if (!empty($arrayfields['f.note_private']['checked'])) {
905 print '<td class="center">';
906 print dol_string_nohtmltag($obj->note_private);
907 print '</td>';
908 if (!$i) {
909 $totalarray['nbfield']++;
910 }
911 }
912 // Status
913 if (!empty($arrayfields['f.fk_statut']['checked'])) {
914 print '<td class="center">'.$objectstatic->getLibStatut(5).'</td>';
915 if (!$i) {
916 $totalarray['nbfield']++;
917 }
918 }
919 // Fields of detail of line
920 if (!empty($arrayfields['fd.description']['checked'])) {
921 print '<td>'.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->descriptiondetail, 1)), 48).'</td>';
922 if (!$i) {
923 $totalarray['nbfield']++;
924 }
925 }
926 if (!empty($arrayfields['fd.date']['checked'])) {
927 print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
928 if (!$i) {
929 $totalarray['nbfield']++;
930 }
931 }
932 if (!empty($arrayfields['fd.duree']['checked'])) {
933 print '<td class="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
934 if (!$i) {
935 $totalarray['nbfield']++;
936 }
937 if (!$i) {
938 $totalarray['type'][$totalarray['nbfield']] = 'duration';
939 }
940 if (!$i) {
941 $totalarray['pos'][$totalarray['nbfield']] = 'fd.duree';
942 }
943 $totalarray['val']['fd.duree'] += $obj->duree;
944 }
945 // Action column
946 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
947 print '<td class="nowrap center">';
948 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
949 $selected = 0;
950 if (in_array($obj->rowid, $arrayofselected)) {
951 $selected = 1;
952 }
953 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
954 }
955 print '</td>';
956 if (!$i) {
957 $totalarray['nbfield']++;
958 }
959 }
960
961 print '</tr>'."\n";
962
963 $total += $obj->duree;
964 }
965 $i++;
966}
967
968
969// Show total line
970include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
971
972// If no record found
973if ($num == 0) {
974 $colspan = 1;
975 foreach ($arrayfields as $key => $val) {
976 if (!empty($val['checked'])) {
977 $colspan++;
978 }
979 }
980 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
981}
982
983$db->free($resql);
984
985$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
986$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
987print $hookmanager->resPrint;
988
989print '</table>'."\n";
990print '</div>'."\n";
991
992print '</form>'."\n";
993
994if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
995 $hidegeneratedfilelistifempty = 1;
996 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
997 $hidegeneratedfilelistifempty = 0;
998 }
999
1000 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
1001 $formfile = new FormFile($db);
1002
1003 // Show list of available documents
1004 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
1005 $urlsource .= str_replace('&amp;', '&', $param);
1006
1007 $filedir = $diroutputmassaction;
1008 $genallowed = $permissiontoread;
1009 $delallowed = $permissiontoadd;
1010
1011 print $formfile->showdocuments('massfilesarea_interventions', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
1012}
1013
1014// End of page
1015llxFooter();
1016$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:55
llxFooter()
Empty footer.
Definition wrapper.php:69
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 a 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.