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