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';
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');
54 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
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');
83 foreach ($object->fields as $key => $val) {
84 if (
GETPOST(
'search_'.$key,
'alpha')) {
85 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
90 $fieldstosearchall = array();
91 foreach ($object->fields as $key => $val) {
92 if (!empty($val[
'searchall'])) {
93 $fieldstosearchall[
't.'.$key] = $val[
'label'];
98 $arrayfields = array();
99 foreach ($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']);
106 if (!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;
131 if ($user->socid > 0) {
137 if ($object->id > 0 && $object->private != $user->id) {
147 if (
GETPOST(
'cancel',
'alpha')) {
148 $action =
'list'; $massaction =
'';
150 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
154 $parameters = array();
155 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
160 if (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');
210 $title = $langs->trans(
"EMailsSetup");
215 $titlepicto =
'title_setup';
223 print
'<span class="opacitymedium">'.$langs->trans(
"EMailsSenderProfileDesc").
"</span><br>\n";
229 foreach ($object->fields as $key => $val) {
230 $sql .=
"t.".$key.
", ";
233 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
234 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
235 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
" as options_".$key.
', ' :
'');
239 $parameters = array();
240 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
241 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
242 $sql = preg_replace(
'/,\s*$/',
'', $sql);
243 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
244 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
245 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
247 if ($object->ismultientitymanaged == 1) {
248 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
250 $sql .=
" WHERE 1 = 1";
252 foreach ($search as $key => $val) {
253 if ($key ==
'status' && $search[$key] == -1) {
256 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
257 if (strpos($object->fields[$key][
'type'],
'integer:') === 0 || $key ==
'active') {
258 if ($search[$key] ==
'-1') {
263 if ($search[$key] !=
'') {
264 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
268 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
271 if (empty($user->admin)) {
272 $sql .=
" AND private = ".((int) $user->id);
276 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
278 $parameters = array();
279 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
280 $sql .= $hookmanager->resPrint;
299 $sql .= $db->order($sortfield, $sortorder);
303 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
304 $resql = $db->query($sql);
316 $sql .= $db->plimit($limit + 1, $offset);
319 $resql = $db->query($sql);
325 $num = $db->num_rows(
$resql);
332 $arrayofselected = is_array($toselect) ? $toselect : array();
335 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
336 $param .=
'&contextpage='.urlencode($contextpage);
338 if ($limit > 0 && $limit != $conf->liste_limit) {
339 $param .=
'&limit='.urlencode($limit);
341 foreach ($search as $key => $val) {
342 if (is_array($search[$key]) && count($search[$key])) {
343 foreach ($search[$key] as $skey) {
344 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
347 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
350 if ($optioncss !=
'') {
351 $param .=
'&optioncss='.urlencode($optioncss);
354 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
357 $arrayofmassactions = array(
363 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
365 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
366 if ($optioncss !=
'') {
367 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
369 print
'<input type="hidden" name="token" value="'.newToken().
'">';
370 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
371 print
'<input type="hidden" name="action" value="'.($action ==
'create' ?
'add' : ($action ==
'edit' ?
'update' :
'list')).
'">';
372 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
373 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
374 print
'<input type="hidden" name="page" value="'.$page.
'">';
375 print
'<input type="hidden" name="id" value="'.$id.
'">';
376 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
379 if ($action !=
'create') {
380 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', $_SERVER[
'PHP_SELF'].
'?action=create',
'', $permissiontoadd);
382 if ($action ==
'edit') {
383 print
'<table class="border centpercent tableforfield">';
384 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>';
385 print
'<tr><td>'.$langs->trans(
"Email").
'</td><td>';
386 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
387 print
'<input type="text" name="email" value="'.(GETPOSTISSET(
'email') ?
GETPOST(
'email',
'alphanohtml') : $object->email).
'"></td></tr>';
388 print
'<tr><td>'.$langs->trans(
"Signature").
'</td><td>';
389 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
390 $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%');
391 print $doleditor->Create(1);
393 print
'<tr><td>'.$langs->trans(
"User").
'</td><td>';
394 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
395 print
$form->select_dolusers((
GETPOSTISSET(
'private') ?
GETPOST(
'private',
'int') : $object->private),
'private', 1,
null, 0, ($user->admin ?
'' : $user->id));
397 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>';
398 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
399 print
$form->selectarray(
'active', $object->fields[
'active'][
'arrayofkeyval'], (
GETPOSTISSET(
'active') ?
GETPOST(
'active',
'int') : $object->active), 0, 0, 0,
'', 1);
403 print
$form->buttonsSaveCancel();
415 print
'<table class="border centpercent tableforfield">';
416 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td><input type="text" name="label" class="width300" value="'.
GETPOST(
'label',
'alphanohtml').
'" autofocus></td></tr>';
417 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Email").
'</td><td>';
418 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
419 print
'<input type="text" name="email" value="'.GETPOST(
'email',
'alphanohtml').
'"></td></tr>';
420 print
'<tr><td>'.$langs->trans(
"Signature").
'</td><td>';
421 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
422 $doleditor =
new DolEditor(
'signature',
GETPOST(
'signature'),
'', 138,
'dolibarr_notes',
'In',
true,
true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4,
'90%');
423 print $doleditor->Create(1);
425 print
'<tr><td>'.$langs->trans(
"User").
'</td><td>';
426 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
427 print
$form->select_dolusers((
GETPOSTISSET(
'private') ?
GETPOST(
'private',
'int') : -1),
'private', 1,
null, 0, ($user->admin ?
'' : $user->id));
429 print
'<tr><td>'.$langs->trans(
"Position").
'</td><td><input type="text" name="position" class="maxwidth50" value="'.
GETPOST(
'position',
'int').
'"></td></tr>';
430 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
431 print
$form->selectarray(
'active', $object->fields[
'active'][
'arrayofkeyval'],
GETPOST(
'active',
'int'), 0);
435 print
$form->buttonsSaveCancel();
439 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'title_companies', 0, $newcardbutton,
'', $limit);
442 $topicmail =
"Information";
446 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
449 foreach ($fieldstosearchall as $key => $val) {
450 $fieldstosearchall[$key] = $langs->trans($val);
452 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
460 $parameters = array();
461 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
462 if (empty($reshook)) {
463 $moreforfilter .= $hookmanager->resPrint;
465 $moreforfilter = $hookmanager->resPrint;
468 if (!empty($moreforfilter)) {
469 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
470 print $moreforfilter;
474 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
475 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
476 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
478 print
'<div class="div-table-responsive">';
479 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
484 print
'<tr class="liste_titre">';
485 foreach ($object->fields as $key => $val) {
486 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
487 if ($key ==
'status') {
488 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
489 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
490 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
491 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
492 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
493 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID') {
494 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
496 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
497 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
498 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
499 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], empty($search[$key]) ?
'' : $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
500 } elseif (strpos($val[
'type'],
'integer:') === 0) {
501 print $object->showInputField($val, $key, empty($search[$key]) ?
'' : $search[$key],
'',
'',
'search_',
'maxwidth150', 1);
502 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
503 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
509 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
511 $parameters = array(
'arrayfields'=>$arrayfields);
512 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
513 print $hookmanager->resPrint;
515 print
'<td class="liste_titre maxwidthsearch">';
516 $searchpicto =
$form->showFilterButtons();
524 print
'<tr class="liste_titre">';
525 foreach ($object->fields as $key => $val) {
526 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
527 if ($key ==
'status') {
528 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
529 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
530 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
531 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
532 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
533 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID') {
534 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
536 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
537 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
541 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
544 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
545 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
546 print $hookmanager->resPrint;
548 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
553 $needToFetchEachLine = 0;
554 if (!empty($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
555 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
556 if (preg_match(
'/\$object/', $val)) {
557 $needToFetchEachLine++;
566 $totalarray = array();
567 $totalarray[
'nbfield'] = 0;
568 while ($i < ($limit ? min($num, $limit) : $num)) {
569 $obj = $db->fetch_object(
$resql);
575 $object->setVarsFromFetchObj($obj);
578 print
'<tr class="oddeven">';
579 foreach ($object->fields as $key => $val) {
580 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
581 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
582 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
583 } elseif ($key ==
'status') {
584 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
587 if (in_array($val[
'type'], array(
'timestamp'))) {
588 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
589 } elseif ($key ==
'ref') {
590 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
593 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $key !=
'status') {
594 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
597 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
598 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
599 if ($key ==
'status' || $key ==
'active') {
600 print $object->getLibStatut(5);
602 print $object->showOutputField($val, $key, $object->$key,
'');
606 $totalarray[
'nbfield']++;
608 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
610 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
612 if (!isset($totalarray[
'val'])) {
613 $totalarray[
'val'] = array();
615 if (!isset($totalarray[
'val'][
't.'.$key])) {
616 $totalarray[
'val'][
't.'.$key] = 0;
618 $totalarray[
'val'][
't.'.$key] += $object->$key;
623 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
625 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
626 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
627 print $hookmanager->resPrint;
629 print
'<td class="nowrap center">';
630 $url = $_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid;
632 $url .=
'&limit='.urlencode($limit);
635 $url .=
'&page='.urlencode($page);
638 $url .=
'&sortfield='.urlencode($sortfield);
641 $url .=
'&page='.urlencode($sortorder);
643 print
'<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.
'&action=edit&token='.
newToken().
'&rowid='.$obj->rowid.
'">'.
img_edit().
'</a>';
645 print
'<a class=" marginrightonly marginleftonly" href="'.$url.
'&action=delete&token='.
newToken().
'">'.
img_delete().
'</a> ';
646 if ($massactionbutton || $massaction) {
648 if (in_array($object->id, $arrayofselected)) {
651 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
655 $totalarray[
'nbfield']++;
664 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
670 foreach ($arrayfields as $key => $val) {
671 if (!empty($val[
'checked'])) {
675 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
681 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
682 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
683 print $hookmanager->resPrint;
685 print
'</table>'.
"\n";
688 print
'</form>'.
"\n";
691 $hidegeneratedfilelistifempty = 1;
692 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
693 $hidegeneratedfilelistifempty = 0;
696 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
700 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
701 $urlsource .= str_replace(
'&',
'&', $param);
703 $filedir = $diroutputmassaction;
704 $genallowed = $permissiontoread;
705 $delallowed = $permissiontoadd;
707 print $formfile->showdocuments(
'massfilesarea_emailsenderprofile',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_now($mode='auto')
Return date for now.
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...
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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.