26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/emailsenderprofile.class.php';
34$langs->loadLangs(array(
"errors",
"admin",
"mails",
"languages"));
36$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
37$massaction =
GETPOST(
'massaction',
'alpha');
38$show_files =
GETPOST(
'show_files',
'int');
39$confirm =
GETPOST(
'confirm',
'alpha');
40$cancel =
GETPOST(
'cancel',
'alpha');
41$toselect =
GETPOST(
'toselect',
'array');
42$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'emailsenderprofilelist';
43$backtopage =
GETPOST(
'backtopage',
'alpha');
44$optioncss =
GETPOST(
'optioncss',
'aZ');
47$rowid =
GETPOST(
'rowid',
'alpha');
50$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
51$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
52$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
53$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
54if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
57$offset = $limit * $page;
64$diroutputmassaction = $conf->admin->dir_output.
'/temp/massgeneration/'.$user->id;
65$hookmanager->initHooks(array(
'emailsenderprofilelist'));
68$extrafields->fetch_name_optionals_label($object->table_element);
70$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
74 $sortfield =
"t.".key($object->fields);
81$search_all =
GETPOST(
"search_all",
'alpha');
83foreach ($object->fields as $key => $val) {
84 if (
GETPOST(
'search_'.$key,
'alpha')) {
85 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
90$fieldstosearchall = array();
91foreach ($object->fields as $key => $val) {
92 if (!empty($val[
'searchall'])) {
93 $fieldstosearchall[
't.'.$key] = $val[
'label'];
98$arrayfields = array();
99foreach ($object->fields as $key => $val) {
101 if (!empty($val[
'visible'])) {
102 $arrayfields[
't.'.$key] = array(
'label'=>$val[
'label'],
'checked'=>(($val[
'visible'] < 0) ? 0 : 1),
'enabled'=>($val[
'enabled'] && ($val[
'visible'] != 3)),
'position'=>$val[
'position']);
106if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label']) > 0) {
107 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
108 if (!empty($extrafields->attributes[$object->table_element][
'list'][$key])) {
109 $arrayfields[
"ef.".$key] = array(
110 'label'=>$extrafields->attributes[$object->table_element][
'label'][$key],
111 'checked'=>(($extrafields->attributes[$object->table_element][
'list'][$key] < 0) ? 0 : 1),
112 'position'=>$extrafields->attributes[$object->table_element][
'pos'][$key],
113 'enabled'=>(abs($extrafields->attributes[$object->table_element][
'list'][$key]) != 3 && $extrafields->attributes[$object->table_element][
'perms'][$key])
121$permissiontoread = $user->admin;
122$permissiontoadd = $user->admin;
123$permissiontodelete = $user->admin;
131if ($user->socid > 0) {
137 if ($object->id > 0 && $object->private != $user->id) {
147if (
GETPOST(
'cancel',
'alpha')) {
148 $action =
'list'; $massaction =
'';
150if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
154$parameters = array();
155$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
160if (empty($reshook)) {
162 $backurlforlist = $_SERVER[
"PHP_SELF"].
'?action=list';
163 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
166 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
169 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
170 foreach ($object->fields as $key => $val) {
174 $search_array_options = array();
176 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
177 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
182 $objectclass =
'EmailSenderProfile';
183 $objectlabel =
'EmailSenderProfile';
184 $uploaddir = $conf->admin->dir_output.
'/senderprofiles';
185 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
187 if ($action ==
'delete') {
188 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"c_email_senderprofile WHERE rowid = ".
GETPOST(
'id',
'int');
189 $resql = $db->query($sql);
193 setEventMessages($langs->trans(
"Error").
' '.$db->lasterror(),
null,
'errors');
204$form =
new Form($db);
210$title = $langs->trans(
"EMailsSetup");
215$titlepicto =
'title_setup';
223print
'<span class="opacitymedium">'.$langs->trans(
"EMailsSenderProfileDesc").
"</span><br>\n";
229$sql .= $object->getFieldList(
't');
231if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
232 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
233 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
237$parameters = array();
238$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
239$sql .= $hookmanager->resPrint;
240$sql = preg_replace(
'/,\s*$/',
'', $sql);
241$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
242if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
243 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
245if ($object->ismultientitymanaged == 1) {
246 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
248 $sql .=
" WHERE 1 = 1";
250foreach ($search as $key => $val) {
251 if ($key ==
'status' && $search[$key] == -1) {
254 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
255 if (strpos($object->fields[$key][
'type'],
'integer:') === 0 || $key ==
'active') {
256 if ($search[$key] ==
'-1') {
261 if ($search[$key] !=
'') {
262 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
266 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
269if (empty($user->admin)) {
270 $sql .=
" AND private = ".((int) $user->id);
274include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
276$parameters = array();
277$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
278$sql .= $hookmanager->resPrint;
297$sql .= $db->order($sortfield, $sortorder);
300$nbtotalofrecords =
'';
302 $resql = $db->query($sql);
303 $nbtotalofrecords = $db->num_rows($resql);
304 if (($page * $limit) > $nbtotalofrecords) {
310if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
311 $num = $nbtotalofrecords;
314 $sql .= $db->plimit($limit + 1, $offset);
317 $resql = $db->query($sql);
323 $num = $db->num_rows($resql);
330$arrayofselected = is_array($toselect) ? $toselect : array();
333if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
334 $param .=
'&contextpage='.urlencode($contextpage);
336if ($limit > 0 && $limit != $conf->liste_limit) {
337 $param .=
'&limit='.((int) $limit);
339foreach ($search as $key => $val) {
340 if (is_array($search[$key]) && count($search[$key])) {
341 foreach ($search[$key] as $skey) {
342 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
345 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
348if ($optioncss !=
'') {
349 $param .=
'&optioncss='.urlencode($optioncss);
352include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
355$arrayofmassactions = array(
361$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
363print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
364if ($optioncss !=
'') {
365 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
367print
'<input type="hidden" name="token" value="'.newToken().
'">';
368print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
369print
'<input type="hidden" name="action" value="'.($action ==
'create' ?
'add' : ($action ==
'edit' ?
'update' :
'list')).
'">';
370print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
371print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
372print
'<input type="hidden" name="page" value="'.$page.
'">';
373print
'<input type="hidden" name="id" value="'.$id.
'">';
374print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
377if ($action !=
'create') {
378 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', $_SERVER[
'PHP_SELF'].
'?action=create',
'', $permissiontoadd);
380 if ($action ==
'edit') {
381 print
'<table class="border centpercent tableforfield">';
382 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>';
383 print
'<tr><td>'.$langs->trans(
"Email").
'</td><td>';
384 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
385 print
'<input type="text" name="email" value="'.(GETPOSTISSET(
'email') ?
GETPOST(
'email',
'alphanohtml') : $object->email).
'"></td></tr>';
386 print
'<tr><td>'.$langs->trans(
"Signature").
'</td><td>';
387 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
388 $doleditor =
new DolEditor(
'signature', (GETPOSTISSET(
'signature') ?
GETPOST(
'signature',
'restricthtml') : $object->signature),
'', 138,
'dolibarr_notes',
'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4,
'90%');
389 print $doleditor->Create(1);
391 print
'<tr><td>'.$langs->trans(
"User").
'</td><td>';
392 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
393 print $form->select_dolusers((GETPOSTISSET(
'private') ?
GETPOST(
'private',
'int') : $object->private),
'private', 1, null, 0, ($user->admin ?
'' : $user->id));
395 print
'<tr><td>'.$langs->trans(
"Position").
'</td><td><input type="text" name="position" class="maxwidth50" value="'.(GETPOSTISSET(
'position') ?
GETPOST(
'position',
'int') : $object->
position).
'"></td></tr>';
396 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
397 print $form->selectarray(
'active', $object->fields[
'active'][
'arrayofkeyval'], (GETPOSTISSET(
'active') ?
GETPOST(
'active',
'int') : $object->active), 0, 0, 0,
'', 1);
401 print $form->buttonsSaveCancel();
413 print
'<table class="border centpercent tableforfield">';
414 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" name="label" class="width300" value="'.
GETPOST(
'label',
'alphanohtml').
'" autofocus></td></tr>';
415 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Email").
'</td><td>';
416 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
417 print
'<input type="text" name="email" class="width300" value="'.GETPOST(
'email',
'alphanohtml').
'"></td></tr>';
418 print
'<tr><td>'.$langs->trans(
"Signature").
'</td><td>';
419 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
420 $doleditor =
new DolEditor(
'signature',
GETPOST(
'signature'),
'', 138,
'dolibarr_notes',
'In',
true,
true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4,
'90%');
421 print $doleditor->Create(1);
423 print
'<tr><td>'.$langs->trans(
"User").
'</td><td>';
424 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
425 print $form->select_dolusers((GETPOSTISSET(
'private') ?
GETPOST(
'private',
'int') : -1),
'private', 1, null, 0, ($user->admin ?
'' : $user->id));
427 print
'<tr><td>'.$langs->trans(
"Position").
'</td><td><input type="text" name="position" class="maxwidth50" value="'.
GETPOST(
'position',
'int').
'"></td></tr>';
428 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
429 print $form->selectarray(
'active', $object->fields[
'active'][
'arrayofkeyval'],
GETPOST(
'active',
'int'), 0);
433 print $form->buttonsSaveCancel();
437print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_companies', 0, $newcardbutton,
'', $limit);
440$topicmail =
"Information";
444include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
447 foreach ($fieldstosearchall as $key => $val) {
448 $fieldstosearchall[$key] = $langs->trans($val);
450 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
458$parameters = array();
459$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
460if (empty($reshook)) {
461 $moreforfilter .= $hookmanager->resPrint;
463 $moreforfilter = $hookmanager->resPrint;
466if (!empty($moreforfilter)) {
467 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
468 print $moreforfilter;
472$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
473$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
474$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
476print
'<div class="div-table-responsive">';
477print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
482print
'<tr class="liste_titre">';
483foreach ($object->fields as $key => $val) {
484 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
485 if ($key ==
'status') {
486 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
487 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
488 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
489 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
490 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
491 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID') {
492 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
494 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
495 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
496 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
497 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], empty($search[$key]) ?
'' : $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
498 } elseif (strpos($val[
'type'],
'integer:') === 0) {
499 print $object->showInputField($val, $key, empty($search[$key]) ?
'' : $search[$key],
'',
'',
'search_',
'maxwidth150', 1);
500 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
501 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
507include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
509$parameters = array(
'arrayfields'=>$arrayfields);
510$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
511print $hookmanager->resPrint;
513print
'<td class="liste_titre maxwidthsearch">';
514$searchpicto = $form->showFilterButtons();
522print
'<tr class="liste_titre">';
523foreach ($object->fields as $key => $val) {
524 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
525 if ($key ==
'status') {
526 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
527 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
528 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
529 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
530 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
531 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID') {
532 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
534 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
535 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
539include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
542$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
543$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
544print $hookmanager->resPrint;
546print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
551$needToFetchEachLine = 0;
552if (!empty($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
553 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
554 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
555 $needToFetchEachLine++;
564$totalarray = array();
565$totalarray[
'nbfield'] = 0;
566while ($i < ($limit ? min($num, $limit) : $num)) {
567 $obj = $db->fetch_object($resql);
573 $object->setVarsFromFetchObj($obj);
576 print
'<tr class="oddeven">';
577 foreach ($object->fields as $key => $val) {
578 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
579 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
580 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
581 } elseif ($key ==
'status') {
582 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
585 if (in_array($val[
'type'], array(
'timestamp'))) {
586 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
587 } elseif ($key ==
'ref') {
588 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
591 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $key !=
'status') {
592 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
595 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
596 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
597 if ($key ==
'status' || $key ==
'active') {
598 print $object->getLibStatut(5);
600 print $object->showOutputField($val, $key, $object->$key,
'');
604 $totalarray[
'nbfield']++;
606 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
608 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
610 if (!isset($totalarray[
'val'])) {
611 $totalarray[
'val'] = array();
613 if (!isset($totalarray[
'val'][
't.'.$key])) {
614 $totalarray[
'val'][
't.'.$key] = 0;
616 $totalarray[
'val'][
't.'.$key] += $object->$key;
621 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
623 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
624 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
625 print $hookmanager->resPrint;
627 print
'<td class="nowrap center">';
628 $url = $_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid;
630 $url .=
'&limit='.((int) $limit);
633 $url .=
'&page='.urlencode($page);
636 $url .=
'&sortfield='.urlencode($sortfield);
639 $url .=
'&page='.urlencode($sortorder);
641 print
'<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.
'&action=edit&token='.newToken().
'&rowid='.$obj->rowid.
'">'.
img_edit().
'</a>';
643 print
'<a class=" marginrightonly marginleftonly" href="'.$url.
'&action=delete&token='.newToken().
'">'.
img_delete().
'</a> ';
644 if ($massactionbutton || $massaction) {
646 if (in_array($object->id, $arrayofselected)) {
649 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
653 $totalarray[
'nbfield']++;
662include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
668 foreach ($arrayfields as $key => $val) {
669 if (!empty($val[
'checked'])) {
673 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
679$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
680$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
681print $hookmanager->resPrint;
683print
'</table>'.
"\n";
688if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
689 $hidegeneratedfilelistifempty = 1;
690 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
691 $hidegeneratedfilelistifempty = 0;
694 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
698 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
699 $urlsource .= str_replace(
'&',
'&', $param);
701 $filedir = $diroutputmassaction;
702 $genallowed = $permissiontoread;
703 $delallowed = $permissiontoadd;
705 print $formfile->showdocuments(
'massfilesarea_emailsenderprofile',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
email_admin_prepare_head()
Return array head with list of tabs to view object informations.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
Class for EmailSenderProfile.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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 dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $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.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier 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.