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