28require
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/emailsenderprofile.class.php';
45$langs->loadLangs(array(
"errors",
"admin",
"mails",
"languages"));
47$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
48$massaction =
GETPOST(
'massaction',
'alpha');
50$confirm =
GETPOST(
'confirm',
'alpha');
51$cancel =
GETPOST(
'cancel',
'alpha');
52$toselect =
GETPOST(
'toselect',
'array:int');
53$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'emailsenderprofilelist';
54$backtopage =
GETPOST(
'backtopage',
'alpha');
55$optioncss =
GETPOST(
'optioncss',
'aZ');
62$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69$offset = $limit * $page;
76$diroutputmassaction =
$conf->admin->dir_output.
'/temp/massgeneration/'.$user->id;
77$hookmanager->initHooks(array(
'emailsenderprofilelist'));
80$extrafields->fetch_name_optionals_label(
$object->table_element);
82$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
87 $sortfield =
"t.position";
94$search_all = trim(
GETPOST(
"search_all",
'alphanohtml'));
96foreach (
$object->fields as $key => $val) {
97 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
98 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
100 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
106$fieldstosearchall = array();
108foreach (
$object->fields as $key => $val) {
109 if (!empty($val[
'searchall'])) {
110 $fieldstosearchall[
't.'.$key] = $val[
'label'];
115$arrayfields = array();
116foreach (
$object->fields as $key => $val) {
118 if (!empty($val[
'visible'])) {
119 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
120 $arrayfields[
't.'.$key] = array(
121 'label' => $val[
'label'],
122 'checked' => (($visible < 0) ? 0 : 1),
123 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
124 'position' => $val[
'position'],
125 'help' => isset($val[
'help']) ? $val[
'help'] :
''
130include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
135$permissiontoread = $user->admin;
136$permissiontoadd = $user->admin;
137$permissiontodelete = $user->admin;
145if ($user->socid > 0) {
160if (
GETPOST(
'cancel',
'alpha')) {
164if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
168$parameters = array();
169$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
174if (empty($reshook)) {
176 $backurlforlist = $_SERVER[
"PHP_SELF"];
177 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
180 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
183 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
184 foreach (
$object->fields as $key => $val) {
186 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
187 $search[$key.
'_dtstart'] =
'';
188 $search[$key.
'_dtend'] =
'';
192 $search_array_options = array();
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')) {
200 $objectclass =
'EmailSenderProfile';
201 $objectlabel =
'EmailSenderProfile';
202 $uploaddir =
$conf->admin->dir_output.
'/senderprofiles';
203 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
205 if ($action ==
'delete') {
206 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"c_email_senderprofile WHERE rowid = ".
GETPOSTINT(
'id');
207 $resql =
$db->query($sql);
228$title = $langs->trans(
"EMailsSetup");
230llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-mails_senderprofile_list');
233$titlepicto =
'title_setup';
241print
'<span class="opacitymedium">'.$langs->trans(
"EMailsSenderProfileDesc").
"</span><br>\n";
247$sql .=
$object->getFieldList(
't');
249if (!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 :
'');
255$parameters = array();
256$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
257$sql .= $hookmanager->resPrint;
258$sql = preg_replace(
'/,\s*$/',
'', $sql);
262$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
263if (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)";
267$parameters = array();
268$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
269$sql .= $hookmanager->resPrint;
270if (
$object->ismultientitymanaged == 1) {
271 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
273 $sql .=
" WHERE 1 = 1";
275foreach ($search as $key => $val) {
276 if (array_key_exists($key,
$object->fields)) {
277 if ($key ==
'status' && $search[$key] == -1) {
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'])))) {
287 if ($search[$key] !=
'') {
288 $sql .=
natural_search(
"t.".
$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
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]).
"'";
297 if (preg_match(
'/_dtend$/', $key)) {
298 $sql .=
" AND t.".$db->escape($columnName).
" <= '".
$db->idate($search[$key]).
"'";
305 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
308if (empty($user->admin)) {
309 $sql .=
" AND private = ".((int) $user->id);
313include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
315$parameters = array();
316$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
317$sql .= $hookmanager->resPrint;
338$nbtotalofrecords =
'';
341 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
342 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
344 $resql =
$db->query($sqlforcount);
346 $objforcount =
$db->fetch_object($resql);
347 $nbtotalofrecords = $objforcount->nbtotalofrecords;
352 if (($page * $limit) > (
int) $nbtotalofrecords) {
360$sql .=
$db->order($sortfield, $sortorder);
362 $sql .=
$db->plimit($limit + 1, $offset);
365$resql =
$db->query($sql);
371$num =
$db->num_rows($resql);
377$arrayofselected = is_array($toselect) ? $toselect : array();
381 $param .=
'&mode='.urlencode($mode);
383if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
384 $param .=
'&contextpage='.urlencode($contextpage);
386if ($limit > 0 && $limit !=
$conf->liste_limit) {
387 $param .=
'&limit='.((int) $limit);
389if ($optioncss !=
'') {
390 $param .=
'&optioncss='.urlencode($optioncss);
392foreach ($search as $key => $val) {
393 if (is_array($search[$key])) {
394 foreach ($search[$key] as $skey) {
396 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
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]);
408include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
410$parameters = array();
411$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
412$param .= $hookmanager->resPrint;
415$arrayofmassactions = array(
421$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
423print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
424if ($optioncss !=
'') {
425 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
427print
'<input type="hidden" name="token" value="'.newToken().
'">';
428print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
429print
'<input type="hidden" name="action" value="'.($action ==
'create' ?
'add' : ($action ==
'edit' ?
'update' :
'list')).
'">';
430print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
431print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
432print
'<input type="hidden" name="page" value="'.$page.
'">';
433print
'<input type="hidden" name="id" value="'.$id.
'">';
434print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
435print
'<input type="hidden" name="page_y" value="">';
436print
'<input type="hidden" name="mode" value="'.$mode.
'">';
440if ($action !=
'create') {
441 $newcardbutton .= dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', $_SERVER[
'PHP_SELF'].
'?action=create',
'', $permissiontoadd);
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);
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));
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);
464 print $form->buttonsSaveCancel();
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);
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));
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);
496 print $form->buttonsSaveCancel();
500print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_companies', 0, $newcardbutton,
'', $limit);
503$topicmail =
"Information";
507include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
510 foreach ($fieldstosearchall as $key => $val) {
511 $fieldstosearchall[$key] = $langs->trans($val);
513 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
521$parameters = array();
522$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
523if (empty($reshook)) {
524 $moreforfilter .= $hookmanager->resPrint;
526 $moreforfilter = $hookmanager->resPrint;
529if (!empty($moreforfilter)) {
530 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
531 print $moreforfilter;
535$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
536$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
537$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
538$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
540print
'<div class="div-table-responsive">';
541print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
546print
'<tr class="liste_titre">';
548if (
$conf->main_checkbox_left_column) {
549 print
'<td class="liste_titre center maxwidthsearch">';
550 $searchpicto = $form->showFilterButtons(
'left');
554foreach (
$object->fields as $key => $val) {
555 $searchkey = empty($search[$key]) ?
'' : $search[$key];
556 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
557 if ($key ==
'status' || $key ==
'active') {
558 $cssforfield .= ($cssforfield ?
' ' :
'').
'center parentonrightofpage';
559 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
560 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
561 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
562 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
563 } 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'])) {
564 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
566 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
567 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
568 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
569 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), 1, 0, 0,
'', 1, 0, 0,
'',
'maxwidth100'.($key ==
'status' || $key ==
'active' ?
' search_status width100 onrightofpage' :
''), 1);
570 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
571 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
572 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
573 print
'<div class="nowrap">';
574 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
576 print
'<div class="nowrap">';
577 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
579 } elseif ($key ==
'lang') {
580 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
582 print $formadmin->select_language($search[$key],
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
584 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
590include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
592$parameters = array(
'arrayfields' => $arrayfields);
593$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
594print $hookmanager->resPrint;
596if (!
$conf->main_checkbox_left_column) {
597 print
'<td class="liste_titre center maxwidthsearch">';
598 $searchpicto = $form->showFilterButtons();
609print
'<tr class="liste_titre">';
611if (
$conf->main_checkbox_left_column) {
612 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
615foreach (
$object->fields as $key => $val) {
616 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
617 if ($key ==
'status' || $key ==
'active') {
618 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
619 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
620 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
621 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
622 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
623 } 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'])) {
624 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
626 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
627 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
628 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";
633include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
636$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
637$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
638print $hookmanager->resPrint;
640if (!
$conf->main_checkbox_left_column) {
641 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
648$needToFetchEachLine = 0;
649if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
650 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
651 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
652 $needToFetchEachLine++;
664$imaxinloop = ($limit ? min($num, $limit) : $num);
665while ($i < $imaxinloop) {
666 $obj =
$db->fetch_object($resql);
672 $object->setVarsFromFetchObj($obj);
674 if ($mode ==
'kanban') {
676 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
677 print
'<div class="box-flex-container kanban">';
681 if ($massactionbutton || $massaction) {
683 if (in_array(
$object->id, $arrayofselected)) {
688 print
$object->getKanbanView(
'', array(
'selected' => $selected));
689 if ($i == ($imaxinloop - 1)) {
696 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
699 if (
$conf->main_checkbox_left_column) {
700 print
'<td class="nowrap center">';
702 $url = $_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid;
704 $url .=
'&limit='.((int) $limit);
707 $url .=
'&page='.urlencode((
string) ($page));
710 $url .=
'&sortfield='.urlencode($sortfield);
713 $url .=
'&page='.urlencode($sortorder);
715 print
'<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.
'&action=edit&token='.newToken().
'&rowid='.$obj->rowid.
'">'.
img_edit().
'</a>';
717 print
'<a class=" marginrightonly marginleftonly" href="'.$url.
'&action=delete&token='.newToken().
'">'.
img_delete().
'</a> ';
718 if ($massactionbutton || $massaction) {
720 if (in_array(
$object->id, $arrayofselected)) {
723 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
731 foreach (
$object->fields as $key => $val) {
732 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
733 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
734 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
735 } elseif ($key ==
'status' || $key ==
'active') {
736 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
738 if (in_array($val[
'type'], array(
'timestamp'))) {
739 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
740 } elseif ($key ==
'ref') {
741 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
744 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'])) {
745 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
749 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
750 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
751 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
752 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
755 if ($key ==
'status') {
756 print
$object->getLibStatut(5);
757 } elseif ($key ==
'rowid') {
758 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
766 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
770 if (!isset($totalarray[
'val'])) {
773 if (!isset($totalarray[
'val'][
't.'.$key])) {
781 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
783 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
784 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
785 print $hookmanager->resPrint;
788 if (!
$conf->main_checkbox_left_column) {
789 print
'<td class="nowrap center">';
791 $url = $_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid;
793 $url .=
'&limit='.((int) $limit);
796 $url .=
'&page='.urlencode((
string) $page);
798 $url .=
'&sortfield='.urlencode((
string) $sortfield);
799 $url .=
'&page='.urlencode((
string) $sortorder);
801 print
'<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.
'&action=edit&token='.newToken().
'&rowid='.$obj->rowid.
'">'.
img_edit().
'</a>';
803 print
'<a class=" marginrightonly marginleftonly" href="'.$url.
'&action=delete&token='.newToken().
'">'.
img_delete().
'</a> ';
804 if ($massactionbutton || $massaction) {
806 if (in_array(
$object->id, $arrayofselected)) {
809 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
824include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
830 foreach ($arrayfields as $key => $val) {
831 if (!empty($val[
'checked'])) {
835 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
841$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
842$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
843print $hookmanager->resPrint;
845print
'</table>'.
"\n";
850if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
851 $hidegeneratedfilelistifempty = 1;
852 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
853 $hidegeneratedfilelistifempty = 0;
856 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
860 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
861 $urlsource .= str_replace(
'&',
'&', $param);
863 $filedir = $diroutputmassaction;
864 $genallowed = $permissiontoread;
865 $delallowed = $permissiontoadd;
867 print $formfile->showdocuments(
'massfilesarea_emailsenderprofile',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
email_admin_prepare_head()
Return array head with list of tabs to view object information.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
Class for EmailSenderProfile.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
dol_now($mode='gmt')
Return date for now.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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, $morecssdiv='')
Show tabs of a record.
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, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.