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