dolibarr 23.0.3
mails_senderprofile_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
4 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
34
43// Load translation files required by the page
44$langs->loadLangs(array("errors", "admin", "mails", "languages"));
45
46$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
47$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
48$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
49$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
50$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
51$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
52$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'emailsenderprofilelist'; // To manage different context of search
53$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
54$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
55$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
56
57$id = GETPOSTINT('id');
58
59// Load variable for pagination
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
64if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
65 // If $page is not defined, or '' or -1 or if we click on clear filters
66 $page = 0;
67}
68$offset = $limit * $page;
69$pageprev = $page - 1;
70$pagenext = $page + 1;
71
72// Initialize a technical objects
74$extrafields = new ExtraFields($db);
75$diroutputmassaction = $conf->admin->dir_output.'/temp/massgeneration/'.$user->id;
76$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
77
78// Fetch optionals attributes and labels
79$extrafields->fetch_name_optionals_label($object->table_element);
80
81$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
82
83// Default sort order (if not yet defined by previous GETPOST)
84if (!$sortfield) {
85 reset($object->fields); // Reset is required to avoid key() to return null.
86 $sortfield = "t.position"; // Set here default search field. By default 1st field in definition.
87}
88if (!$sortorder) {
89 $sortorder = "ASC";
90}
91
92// Initialize array of search criteria
93$search_all = trim(GETPOST("search_all", 'alphanohtml'));
94$search = array();
95foreach ($object->fields as $key => $val) {
96 if (GETPOST('search_'.$key, 'alpha') !== '') {
97 $search[$key] = GETPOST('search_'.$key, 'alpha');
98 }
99 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
100 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
101 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
102 }
103}
104
105$fieldstosearchall = array();
106// List of fields to search into when doing a "search in all"
107foreach ($object->fields as $key => $val) {
108 if (!empty($val['searchall'])) {
109 $fieldstosearchall['t.'.$key] = $val['label'];
110 }
111}
112
113// Definition of array of fields for columns
114$arrayfields = array();
115foreach ($object->fields as $key => $val) {
116 // If $val['visible']==0, then we never show the field
117 if (!empty($val['visible'])) {
118 $visible = (int) dol_eval((string) $val['visible'], 1);
119 $arrayfields['t.'.$key] = array(
120 'label' => $val['label'],
121 'checked' => (($visible < 0) ? 0 : 1),
122 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
123 'position' => $val['position'],
124 'help' => isset($val['help']) ? $val['help'] : ''
125 );
126 }
127}
128// Extra fields
129include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
130
131$object->fields = dol_sort_array($object->fields, 'position');
132$arrayfields = dol_sort_array($arrayfields, 'position');
133
134$permissiontoread = $user->admin;
135$permissiontoadd = $user->admin;
136$permissiontodelete = $user->admin;
137
138if ($id > 0) {
139 $object->fetch($id);
140}
141
142// Security check
143$socid = 0;
144if ($user->socid > 0) {
146}
147// A non admin user can see profiles but limited to its own user
148if (!$user->admin) {
149 if ($object->id > 0 && $object->private != $user->id) {
151 }
152}
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();
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 // Actions cancel, add, update, delete or clone
175 $backurlforlist = $_SERVER["PHP_SELF"];
176 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
177
178 // Selection of new fields
179 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
180
181 // Purge search criteria
182 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
183 foreach ($object->fields as $key => $val) {
184 $search[$key] = '';
185 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
186 $search[$key.'_dtstart'] = '';
187 $search[$key.'_dtend'] = '';
188 }
189 }
190 $toselect = array();
191 $search_array_options = array();
192 }
193 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
194 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
195 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
196 }
197
198 // Mass actions
199 $objectclass = 'EmailSenderProfile';
200 $objectlabel = 'EmailSenderProfile';
201 $uploaddir = $conf->admin->dir_output.'/senderprofiles';
202 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
203
204 if ($action == 'delete') {
205 $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".GETPOSTINT('id');
206 $resql = $db->query($sql);
207 if ($resql) {
208 setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
209 } else {
210 setEventMessages($langs->trans("Error").' '.$db->lasterror(), null, 'errors');
211 }
212 }
213}
214
215
216
217/*
218 * View
219 */
220
221$form = new Form($db);
222
223$now = dol_now();
224
225//$help_url="EN:Module_EmailSenderProfile|FR:Module_EmailSenderProfile_FR|ES:Módulo_EmailSenderProfile";
226$help_url = '';
227$title = $langs->trans("EMailsSetup");
228
229llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-admin page-mails_senderprofile_list');
230
231$linkback = '';
232$titlepicto = 'title_setup';
233
234print load_fiche_titre($title, $linkback, $titlepicto);
235
237
238print dol_get_fiche_head($head, 'senderprofiles', '', -1);
239
240print '<span class="opacitymedium">'.$langs->trans("EMailsSenderProfileDesc")."</span><br>\n";
241print "<br>\n";
242
243// Build and execute select
244// --------------------------------------------------------------------
245$sql = 'SELECT ';
246$sql .= $object->getFieldList('t');
247// Add fields from extrafields
248if (!empty($extrafields->attributes[$object->table_element]['label'])) {
249 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
250 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
251 }
252}
253// Add fields from hooks
254$parameters = array();
255$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
256$sql .= $hookmanager->resPrint;
257$sql = preg_replace('/,\s*$/', '', $sql);
258
259$sqlfields = $sql; // $sql fields to remove for count total
260
261$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
262if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
263 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
264}
265// Add table from hooks
266$parameters = array();
267$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
268$sql .= $hookmanager->resPrint;
269if ($object->ismultientitymanaged == 1) {
270 $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
271} else {
272 $sql .= " WHERE 1 = 1";
273}
274foreach ($search as $key => $val) {
275 if (array_key_exists($key, $object->fields)) {
276 if ($key == 'status' && $search[$key] == -1) {
277 continue;
278 }
279 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
280 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
281 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
282 $search[$key] = '';
283 }
284 $mode_search = 2;
285 }
286 if ($search[$key] != '') {
287 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
288 }
289 } else {
290 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
291 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
292 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
293 if (preg_match('/_dtstart$/', $key)) {
294 $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
295 }
296 if (preg_match('/_dtend$/', $key)) {
297 $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
298 }
299 }
300 }
301 }
302}
303if ($search_all) {
304 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
305}
306// If non admin, restrict list to itself
307if (empty($user->admin)) {
308 $sql .= " AND private = ".((int) $user->id);
309}
310//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
311// Add where from extra fields
312include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
313// Add where from hooks
314$parameters = array();
315$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
316$sql .= $hookmanager->resPrint;
317
318/* If a group by is required
319$sql .= " GROUP BY ";
320foreach($object->fields as $key => $val) {
321 $sql .= "t.".$db->escape($key).", ";
322}
323// Add fields from extrafields
324if (!empty($extrafields->attributes[$object->table_element]['label'])) {
325 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
326 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
327 }
328}
329// Add groupby from hooks
330$parameters=array();
331$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
332$sql.=$hookmanager->resPrint;
333$sql=preg_replace('/,\s*$/','', $sql);
334*/
335
336// Count total nb of records
337$nbtotalofrecords = '';
338if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
339 /* The fast and low memory method to get and count full list converts the sql into a sql count */
340 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
341 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
342
343 $resql = $db->query($sqlforcount);
344 if ($resql) {
345 $objforcount = $db->fetch_object($resql);
346 $nbtotalofrecords = $objforcount->nbtotalofrecords;
347 } else {
348 dol_print_error($db);
349 }
350
351 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
352 $page = 0;
353 $offset = 0;
354 }
355 $db->free($resql);
356}
357
358// Complete request and execute it with limit
359$sql .= $db->order($sortfield, $sortorder);
360if ($limit) {
361 $sql .= $db->plimit($limit + 1, $offset);
362}
363
364$resql = $db->query($sql);
365if (!$resql) {
366 dol_print_error($db);
367 exit;
368}
369
370$num = $db->num_rows($resql);
371
372
373// Output page
374// --------------------------------------------------------------------
375
376$arrayofselected = is_array($toselect) ? $toselect : array();
377
378$param = '';
379if (!empty($mode)) {
380 $param .= '&mode='.urlencode($mode);
381}
382if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
383 $param .= '&contextpage='.urlencode($contextpage);
384}
385if ($limit > 0 && $limit != $conf->liste_limit) {
386 $param .= '&limit='.((int) $limit);
387}
388if ($optioncss != '') {
389 $param .= '&optioncss='.urlencode($optioncss);
390}
391foreach ($search as $key => $val) {
392 if (is_array($search[$key])) {
393 foreach ($search[$key] as $skey) {
394 if ($skey != '') {
395 $param .= '&search_'.$key.'[]='.urlencode($skey);
396 }
397 }
398 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
399 $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
400 $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
401 $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
402 } elseif ($search[$key] != '') {
403 $param .= '&search_'.$key.'='.urlencode($search[$key]);
404 }
405}
406// Add $param from extra fields
407include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
408// Add $param from hooks
409$parameters = array();
410$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
411$param .= $hookmanager->resPrint;
412
413// List of mass actions available
414$arrayofmassactions = array(
415 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
416 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
417);
418//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
419//if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
420$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
421
422print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
423if ($optioncss != '') {
424 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
425}
426print '<input type="hidden" name="token" value="'.newToken().'">';
427print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
428print '<input type="hidden" name="action" value="'.($action == 'create' ? 'add' : ($action == 'edit' ? 'update' : 'list')).'">';
429print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
430print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
431print '<input type="hidden" name="page" value="'.$page.'">';
432print '<input type="hidden" name="id" value="'.$id.'">';
433print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
434print '<input type="hidden" name="page_y" value="">';
435print '<input type="hidden" name="mode" value="'.$mode.'">';
436
437
438$newcardbutton = '';
439if ($action != 'create') {
440 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER['PHP_SELF'].'?action=create', '', $permissiontoadd);
441
442 if ($action == 'edit') {
443 print '<table class="border centpercent tableforfield">';
444 print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" class="width300" value="'.(GETPOSTISSET('label') ? GETPOST('label', 'alphanohtml') : $object->label).'"></td></tr>';
445 print '<tr><td>'.$langs->trans("Email").'</td><td>';
446 print img_picto('', 'email', 'class="pictofixedwidth"');
447 print '<input type="text" name="email" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alphanohtml') : $object->email).'"></td></tr>';
448 print '<tr><td>'.$langs->trans("Signature").'</td><td>';
449 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
450 $doleditor = new DolEditor('signature', (GETPOSTISSET('signature') ? GETPOST('signature', 'restricthtml') : $object->signature), '', 138, 'dolibarr_notes', 'In', true, true, !getDolGlobalString('FCKEDITOR_ENABLE_USERSIGN') ? 0 : 1, ROWS_4, '90%');
451 print $doleditor->Create(1);
452 print '</td></tr>';
453 print '<tr><td>'.$langs->trans("User").'</td><td>';
454 print img_picto('', 'user', 'class="pictofixedwidth"');
455 print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id));
456 print '</td></tr>';
457 print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.(GETPOSTISSET('position') ? GETPOSTINT('position') : $object->position).'"></td></tr>';
458 print '<tr><td>'.$langs->trans("Status").'</td><td>';
459 print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOSTINT('active') : $object->active), 0, 0, 0, '', 1);
460 print '</td></tr>';
461 print '</table>';
462
463 print $form->buttonsSaveCancel();
464 }
465} else {
466 /*print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
467 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
468 print '<input type="hidden" name="token" value="'.newToken().'">';
469 print '<input type="hidden" name="action" value="add">';
470 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
471 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
472 print '<input type="hidden" name="page" value="'.$page.'">';
473 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
474 */
475 print '<table class="border centpercent tableforfield">';
476 print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" class="width300" value="'.GETPOST('label', 'alphanohtml').'" autofocus></td></tr>';
477 print '<tr><td class="fieldrequired">'.$langs->trans("Email").'</td><td>';
478 print img_picto('', 'email', 'class="pictofixedwidth"');
479 print '<input type="text" name="email" class="width300" value="'.GETPOST('email', 'alphanohtml').'"></td></tr>';
480 print '<tr><td>'.$langs->trans("Signature").'</td><td>';
481 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
482 $doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, !getDolGlobalString('FCKEDITOR_ENABLE_USERSIGN') ? 0 : 1, ROWS_4, '90%');
483 print $doleditor->Create(1);
484 print '</td></tr>';
485 print '<tr><td>'.$langs->trans("User").'</td><td>';
486 print img_picto('', 'user', 'class="pictofixedwidth"');
487 print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id));
488 print '</td></tr>';
489 print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.GETPOSTINT('position').'"></td></tr>';
490 print '<tr><td>'.$langs->trans("Status").'</td><td>';
491 print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOSTINT('active'), 0);
492 print '</td></tr>';
493 print '</table>';
494
495 print $form->buttonsSaveCancel();
496 //print '</form>';
497}
498
499print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
500//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
501
502$topicmail = "Information";
503//$modelmail="subscription";
504$objecttmp = new EmailSenderProfile($db);
505//$trackid = (($action == 'testhtml') ? "testhtml" : "test");
506include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
507
508if ($search_all) {
509 foreach ($fieldstosearchall as $key => $val) {
510 $fieldstosearchall[$key] = $langs->trans($val);
511 }
512 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
513}
514
515$moreforfilter = '';
516/*$moreforfilter.='<div class="divsearchfield">';
517$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
518$moreforfilter.= '</div>';*/
519
520$parameters = array();
521$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
522if (empty($reshook)) {
523 $moreforfilter .= $hookmanager->resPrint;
524} else {
525 $moreforfilter = $hookmanager->resPrint;
526}
527
528if (!empty($moreforfilter)) {
529 print '<div class="liste_titre liste_titre_bydiv centpercent">';
530 print $moreforfilter;
531 print '</div>';
532}
533
534$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
535$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
536$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
537$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
538
539print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
540print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
541
542
543// Fields title search
544// --------------------------------------------------------------------
545print '<tr class="liste_titre">';
546// Action column
547if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
548 print '<td class="liste_titre center maxwidthsearch">';
549 $searchpicto = $form->showFilterButtons('left');
550 print $searchpicto;
551 print '</td>';
552}
553foreach ($object->fields as $key => $val) {
554 $searchkey = empty($search[$key]) ? '' : $search[$key];
555 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
556 if ($key == 'status') {
557 $cssforfield .= ($cssforfield ? ' ' : '').'center';
558 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
559 $cssforfield .= ($cssforfield ? ' ' : '').'center';
560 } elseif (in_array($val['type'], array('timestamp'))) {
561 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
562 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
563 $cssforfield .= ($cssforfield ? ' ' : '').'right';
564 }
565 if (!empty($arrayfields['t.'.$key]['checked'])) {
566 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
567 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
568 print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
569 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
570 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
571 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
572 print '<div class="nowrap">';
573 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
574 print '</div>';
575 print '<div class="nowrap">';
576 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
577 print '</div>';
578 } elseif ($key == 'lang') {
579 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
580 $formadmin = new FormAdmin($db);
581 print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
582 } else {
583 print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
584 }
585 print '</td>';
586 }
587}
588// Extra fields
589include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
590// Fields from hook
591$parameters = array('arrayfields' => $arrayfields);
592$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
593print $hookmanager->resPrint;
594// Action column
595if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
596 print '<td class="liste_titre center maxwidthsearch">';
597 $searchpicto = $form->showFilterButtons();
598 print $searchpicto;
599 print '</td>';
600}
601print '</tr>'."\n";
602
603$totalarray = array();
604$totalarray['nbfield'] = 0;
605
606// Fields title label
607// --------------------------------------------------------------------
608print '<tr class="liste_titre">';
609// Action column
610if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
611 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
612 $totalarray['nbfield']++;
613}
614foreach ($object->fields as $key => $val) {
615 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
616 if ($key == 'status') {
617 $cssforfield .= ($cssforfield ? ' ' : '').'center';
618 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
619 $cssforfield .= ($cssforfield ? ' ' : '').'center';
620 } elseif (in_array($val['type'], array('timestamp'))) {
621 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
622 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
623 $cssforfield .= ($cssforfield ? ' ' : '').'right';
624 }
625 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
626 if (!empty($arrayfields['t.'.$key]['checked'])) {
627 print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
628 $totalarray['nbfield']++;
629 }
630}
631// Extra fields
632include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
633
634// Hook fields
635$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
636$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
637print $hookmanager->resPrint;
638// Action column
639if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
640 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
641 $totalarray['nbfield']++;
642}
643print '</tr>'."\n";
644
645
646// Detect if we need a fetch on each output line
647$needToFetchEachLine = 0;
648if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
649 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
650 if (!is_null($val) && preg_match('/\$object/', $val)) {
651 $needToFetchEachLine++; // There is at least one compute field that use $object
652 }
653 }
654}
655
656
657// Loop on record
658// --------------------------------------------------------------------
659$i = 0;
660$savnbfield = $totalarray['nbfield'];
661$totalarray = array();
662$totalarray['nbfield'] = 0;
663$imaxinloop = ($limit ? min($num, $limit) : $num);
664while ($i < $imaxinloop) {
665 $obj = $db->fetch_object($resql);
666 if (empty($obj)) {
667 break; // Should not happen
668 }
669
670 // Store properties in $object
671 $object->setVarsFromFetchObj($obj);
672
673 if ($mode == 'kanban') {
674 if ($i == 0) {
675 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
676 print '<div class="box-flex-container kanban">';
677 }
678 // Output Kanban
679 $selected = -1;
680 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
681 $selected = 0;
682 if (in_array($object->id, $arrayofselected)) {
683 $selected = 1;
684 }
685 }
686 //print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected));
687 print $object->getKanbanView('', array('selected' => $selected));
688 if ($i == ($imaxinloop - 1)) {
689 print '</div>';
690 print '</td></tr>';
691 }
692 } else {
693 // Show line of result
694 $j = 0;
695 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
696
697 // Action column
698 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
699 print '<td class="nowrap center">';
700
701 $url = $_SERVER["PHP_SELF"].'?id='.$obj->rowid;
702 if ($limit) {
703 $url .= '&limit='.((int) $limit);
704 }
705 if ($page) {
706 $url .= '&page='.urlencode((string) ($page));
707 }
708 if ($sortfield) {
709 $url .= '&sortfield='.urlencode($sortfield);
710 }
711 if ($sortorder) {
712 $url .= '&page='.urlencode($sortorder);
713 }
714 print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&token='.newToken().'&rowid='.$obj->rowid.'">'.img_edit().'</a>';
715 //print ' &nbsp; ';
716 print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> &nbsp; ';
717 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
718 $selected = 0;
719 if (in_array($object->id, $arrayofselected)) {
720 $selected = 1;
721 }
722 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
723 }
724 print '</td>';
725 if (!$i) {
726 $totalarray['nbfield']++;
727 }
728 }
729
730 foreach ($object->fields as $key => $val) {
731 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
732 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
733 $cssforfield .= ($cssforfield ? ' ' : '').'center';
734 } elseif ($key == 'status') {
735 $cssforfield .= ($cssforfield ? ' ' : '').'center';
736 }
737
738 if (in_array($val['type'], array('timestamp'))) {
739 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
740 } elseif ($key == 'ref') {
741 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
742 }
743
744 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
745 $cssforfield .= ($cssforfield ? ' ' : '').'right';
746 }
747 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
748
749 if (!empty($arrayfields['t.'.$key]['checked'])) {
750 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
751 if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
752 print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
753 }
754 print '>';
755 if ($key == 'status') {
756 print $object->getLibStatut(5);
757 } elseif ($key == 'rowid') {
758 print $object->showOutputField($val, $key, (string) $object->id, '');
759 } else {
760 print $object->showOutputField($val, $key, $object->$key, '');
761 }
762 print '</td>';
763 if (!$i) {
764 $totalarray['nbfield']++;
765 }
766 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
767 if (!$i) {
768 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
769 }
770 if (!isset($totalarray['val'])) {
771 $totalarray['val'] = array();
772 }
773 if (!isset($totalarray['val']['t.'.$key])) {
774 $totalarray['val']['t.'.$key] = 0;
775 }
776 $totalarray['val']['t.'.$key] += $object->$key;
777 }
778 }
779 }
780 // Extra fields
781 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
782 // Fields from hook
783 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
784 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
785 print $hookmanager->resPrint;
786
787 // Action column
788 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
789 print '<td class="nowrap center">';
790
791 $url = $_SERVER["PHP_SELF"].'?id='.$obj->rowid;
792 if ($limit) {
793 $url .= '&limit='.((int) $limit);
794 }
795 if ($page) {
796 $url .= '&page='.urlencode((string) $page);
797 }
798 $url .= '&sortfield='.urlencode((string) $sortfield);
799 $url .= '&page='.urlencode((string) $sortorder);
800
801 print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&token='.newToken().'&rowid='.$obj->rowid.'">'.img_edit().'</a>';
802 //print ' &nbsp; ';
803 print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> &nbsp; ';
804 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
805 $selected = 0;
806 if (in_array($object->id, $arrayofselected)) {
807 $selected = 1;
808 }
809 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
810 }
811 print '</td>';
812 if (!$i) {
813 $totalarray['nbfield']++;
814 }
815 }
816
817 print '</tr>'."\n";
818 }
819
820 $i++;
821}
822
823// Show total line
824include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
825
826
827// If no record found
828if ($num == 0) {
829 $colspan = 1;
830 foreach ($arrayfields as $key => $val) {
831 if (!empty($val['checked'])) {
832 $colspan++;
833 }
834 }
835 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
836}
837
838
839$db->free($resql);
840
841$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
842$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
843print $hookmanager->resPrint;
844
845print '</table>'."\n";
846print '</div>'."\n";
847
848print '</form>'."\n";
849
850if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
851 $hidegeneratedfilelistifempty = 1;
852 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
853 $hidegeneratedfilelistifempty = 0;
854 }
855
856 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
857 $formfile = new FormFile($db);
858
859 // Show list of available documents
860 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
861 $urlsource .= str_replace('&amp;', '&', $param);
862
863 $filedir = $diroutputmassaction;
864 $genallowed = $permissiontoread;
865 $delallowed = $permissiontoadd;
866
867 print $formfile->showdocuments('massfilesarea_emailsenderprofile', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
868}
869
870print dol_get_fiche_end();
871
872// End of page
873llxFooter();
874$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition export.php:1216
email_admin_prepare_head()
Return array head with list of tabs to view object information.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
print $object position
Definition edit.php:207
Class to manage a WYSIWYG editor.
Class for EmailSenderProfile.
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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...
editval_textarea active
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.