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