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