28require
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/emailcollector/class/emailcollector.class.php';
49$langs->loadLangs(array(
"admin",
"other"));
51$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
52$massaction =
GETPOST(
'massaction',
'alpha');
54$confirm =
GETPOST(
'confirm',
'alpha');
55$cancel =
GETPOST(
'cancel',
'alpha');
56$toselect =
GETPOST(
'toselect',
'array:int');
58$backtopage =
GETPOST(
'backtopage',
'alpha');
59$optioncss =
GETPOST(
'optioncss',
'aZ');
61$groupby =
GETPOST(
'mode',
'aZ09');
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
74$offset = $limit * $page;
83$diroutputmassaction =
$conf->emailcollector->dir_output.
'/temp/massgeneration/'.$user->id;
84$hookmanager->initHooks(array(
'emailcollectorlist'));
87$extrafields->fetch_name_optionals_label(
$object->table_element);
89$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
101if ($user->socid > 0) {
108$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
110foreach (
$object->fields as $key => $val) {
111 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
112 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
114 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
121$fieldstosearchall = array();
122foreach (
$object->fields as $key => $val) {
123 if (!empty($val[
'searchall'])) {
124 $fieldstosearchall[
't.'.$key] = $val[
'label'];
130$arrayfields = array();
131foreach (
$object->fields as $key => $val) {
133 if (!empty($val[
'visible'])) {
134 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
135 $arrayfields[$tableprefix.
'.'.$key] = array(
136 'label' => $val[
'label'],
137 'checked' => (($visible < 0) ?
'0' :
'1'),
138 'enabled' => (
string) (int) (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
139 'position' => $val[
'position'],
140 'help' => isset($val[
'help']) ? $val[
'help'] :
''
146include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
151$permissiontoread = $user->admin;
152$permissiontoadd = $user->admin;
153$permissiontodelete = $user->admin;
169if (
GETPOST(
'cancel',
'alpha')) {
173if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
177$parameters = array(
'arrayfields' => &$arrayfields);
178$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
183if (empty($reshook)) {
185 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
188 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
189 foreach (
$object->fields as $key => $val) {
191 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
192 $search[$key.
'_dtstart'] =
'';
193 $search[$key.
'_dtend'] =
'';
198 $search_array_options = array();
200 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
201 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
206 $objectclass =
'EmailCollector';
207 $objectlabel =
'EmailCollector';
208 $uploaddir =
$conf->emailcollector->dir_output;
211 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
224$help_url =
"EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector";
225$title = $langs->trans(
'EmailCollectors');
233$sql .=
" ".$object->getFieldList(
't');
235if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
236 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
237 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
241$parameters = array();
242$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
243$sql .= $hookmanager->resPrint;
244$sql = preg_replace(
'/,\s*$/',
'', $sql);
248$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
249if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
250 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
252if (
$object->ismultientitymanaged == 1) {
253 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
255 $sql .=
" WHERE 1 = 1";
257foreach ($search as $key => $val) {
258 if (array_key_exists($key,
$object->fields)) {
259 if ($key ==
'status' && $search[$key] == -1) {
262 $field_spec =
$object->fields[$key];
264 if ($field_spec ===
null) {
267 $mode_search = ((
$object->isInt($field_spec) ||
$object->isFloat($field_spec)) ? 1 : 0);
268 if ((strpos($field_spec[
'type'],
'integer:') === 0) || (strpos($field_spec[
'type'],
'sellist:') === 0) || !empty($field_spec[
'arrayofkeyval'])) {
269 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($field_spec[
'arrayofkeyval']) || !array_key_exists(
'0', $field_spec[
'arrayofkeyval'])))) {
274 if ($field_spec[
'type'] ===
'boolean') {
276 if ($search[$key] ==
'-1') {
280 if (empty($field_spec[
'searchmulti'])) {
281 if (!is_array($search[$key]) && $search[$key] !=
'') {
282 $sql .=
natural_search(
"t.".
$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
285 if (is_array($search[$key]) && !empty($search[$key])) {
286 $sql .=
natural_search(
"t.".
$db->escape($key), implode(
',', $search[$key]), (($key ==
'status') ? 2 : $mode_search));
290 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
291 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
292 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
293 if (preg_match(
'/_dtstart$/', $key)) {
294 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate($search[$key]).
"'";
296 if (preg_match(
'/_dtend$/', $key)) {
297 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".
$db->idate($search[$key]).
"'";
304 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
307include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
309$parameters = array();
310$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
311$sql .= $hookmanager->resPrint;
314$nbtotalofrecords =
'';
317 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
318 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
320 $resql =
$db->query($sqlforcount);
322 $objforcount =
$db->fetch_object($resql);
323 $nbtotalofrecords = $objforcount->nbtotalofrecords;
328 if (($page * $limit) > (
int) $nbtotalofrecords) {
336$sql .=
$db->order($sortfield, $sortorder);
338 $sql .=
$db->plimit($limit + 1, $offset);
341$resql =
$db->query($sql);
347$num =
$db->num_rows($resql);
350if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
351 $obj =
$db->fetch_object($resql);
353 header(
"Location: ".DOL_URL_ROOT.
'/emailcollector/emailcollector_card.php?id='.$id);
361llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist mod-user page-emailcollector_list');
364$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
371$head[$h][0] = DOL_URL_ROOT.
"/admin/emailcollector_list.php";
372$head[$h][1] = $langs->trans(
"Setup");
373$head[$h][2] =
'common';
380$arrayofselected = is_array($toselect) ? $toselect : array();
384 $param .=
'&mode='.urlencode($mode);
387 $param .=
'&contextpage='.urlencode($contextpage);
389if ($limit > 0 && $limit !=
$conf->liste_limit) {
390 $param .=
'&limit='.((int) $limit);
392if ($optioncss !=
'') {
393 $param .=
'&optioncss='.urlencode($optioncss);
396 $param .=
'&groupby='.urlencode($groupby);
398foreach ($search as $key => $val) {
399 if (is_array($search[$key])) {
400 foreach ($search[$key] as $skey) {
402 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
405 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
406 $param .=
'&search_'.$key.
'month='.
GETPOSTINT(
'search_'.$key.
'month');
407 $param .=
'&search_'.$key.
'day='.
GETPOSTINT(
'search_'.$key.
'day');
408 $param .=
'&search_'.$key.
'year='.
GETPOSTINT(
'search_'.$key.
'year');
409 } elseif ($search[$key] !=
'') {
410 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
414include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
416$parameters = array(
'param' => &$param);
417$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
418$param .= $hookmanager->resPrint;
421$arrayofmassactions = array(
425if (!empty($permissiontodelete)) {
426 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
428if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
429 $arrayofmassactions = array();
431$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
433print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
434if ($optioncss !=
'') {
435 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
437print
'<input type="hidden" name="token" value="'.newToken().
'">';
438print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
439print
'<input type="hidden" name="action" value="list">';
440print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
441print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
442print
'<input type="hidden" name="page" value="'.$page.
'">';
443print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
444print
'<input type="hidden" name="page_y" value="">';
445print
'<input type="hidden" name="mode" value="'.$mode.
'">';
448$newcardbutton .= dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
450print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'email', 0, $newcardbutton,
'', $limit, 0, 0, 1);
457include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
464$parameters = array();
465$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
466if (empty($reshook)) {
467 $moreforfilter .= $hookmanager->resPrint;
469 $moreforfilter = $hookmanager->resPrint;
472 'arrayfields' => &$arrayfields,
475if (!empty($moreforfilter)) {
476 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
477 print $moreforfilter;
481$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
482$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
483$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
484$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
486print
'<div class="div-table-responsive">';
487print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
492print
'<tr class="liste_titre_filter">';
494if (
$conf->main_checkbox_left_column) {
495 print
'<td class="liste_titre center maxwidthsearch">';
496 $searchpicto = $form->showFilterButtons(
'left');
500foreach (
$object->fields as $key => $val) {
501 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
502 if ($key ==
'status') {
503 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
504 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
505 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
506 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
507 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
508 } 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'])) {
509 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
511 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
512 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
513 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
514 if (empty($val[
'searchmulti'])) {
515 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);
517 print $form->multiselectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] : array()), 0, 0,
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
519 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
520 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth125', 1);
521 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
522 print
'<div class="nowrap">';
523 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
525 print
'<div class="nowrap">';
526 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
528 } elseif ($key ==
'lang') {
529 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
531 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
532 } elseif ($val[
'type'] ===
'boolean') {
533 print $form->selectyesno(
'search_' . $key, $search[$key] ??
'', 1,
false, 1);
535 print
'<input type="text" class="flat maxwidth'.(in_array($val[
'type'], array(
'integer',
'price')) ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
541include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
544$parameters = array(
'arrayfields' => $arrayfields);
545$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
546print $hookmanager->resPrint;
548if (!
$conf->main_checkbox_left_column) {
549 print
'<td class="liste_titre center maxwidthsearch">';
550 $searchpicto = $form->showFilterButtons();
561print
'<tr class="liste_titre">';
563if (
$conf->main_checkbox_left_column) {
564 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
567foreach (
$object->fields as $key => $val) {
568 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
569 if ($key ==
'status') {
570 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
571 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
572 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
573 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
574 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
575 } 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'])) {
576 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
578 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
579 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
580 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";
585include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
587$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
588$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
589print $hookmanager->resPrint;
591if (!
$conf->main_checkbox_left_column) {
592 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
599$needToFetchEachLine = 0;
600if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
601 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
602 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
603 $needToFetchEachLine++;
615$imaxinloop = ($limit ? min($num, $limit) : $num);
616while ($i < $imaxinloop) {
617 $obj =
$db->fetch_object($resql);
623 $object->setVarsFromFetchObj($obj);
625 if ($mode ==
'kanban' || $mode ==
'kanbangroupby') {
627 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
628 print
'<div class="box-flex-container kanban">';
632 if ($massactionbutton || $massaction) {
634 if (in_array(
$object->id, $arrayofselected)) {
638 print
$object->getKanbanView(
'', array(
'selected' => $selected));
639 if ($i == ($imaxinloop - 1)) {
646 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
648 if (
$conf->main_checkbox_left_column) {
649 print
'<td class="nowrap center">';
650 if ($massactionbutton || $massaction) {
652 if (in_array(
$object->id, $arrayofselected)) {
655 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
663 foreach (
$object->fields as $key => $val) {
664 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
665 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
666 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
667 } elseif ($key ==
'status') {
668 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
671 if (in_array($val[
'type'], array(
'timestamp'))) {
672 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
673 } elseif ($key ==
'ref') {
674 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
677 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'])) {
678 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
682 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
683 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
684 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key) && !in_array($key, array(
'ref'))) {
685 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
688 if ($key ==
'status') {
689 print
$object->getLibStatut(5);
690 } elseif ($key ==
'rowid') {
691 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
693 if ($val[
'type'] ==
'html' || $key ==
'lastresult') {
694 print
'<div class="small lineheightsmall twolinesmax-normallineheight">';
696 print
$object->showOutputField($val, $key, (
string)
$object->$key,
'');
697 if ($val[
'type'] ==
'html' || $key ==
'lastresult') {
705 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
709 if (!isset($totalarray[
'val'])) {
712 if (!isset($totalarray[
'val'][
't.'.$key])) {
720 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
722 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
723 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
724 print $hookmanager->resPrint;
726 if (!
$conf->main_checkbox_left_column) {
727 print
'<td class="nowrap center">';
728 if ($massactionbutton || $massaction) {
730 if (in_array(
$object->id, $arrayofselected)) {
733 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
748include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
754 foreach ($arrayfields as $key => $val) {
755 if (!empty($val[
'checked'])) {
759 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
765$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
766$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
767print $hookmanager->resPrint;
769print
'</table>'.
"\n";
775print
'<div class="div-table-responsive-no-min">';
776print
'<table class="noborder centpercent">';
778print
'<tr class="liste_titre">';
779print
'<td>'.$langs->trans(
"Parameter").
'</td>';
784print
'<tr class="oddeven"><td>';
786print $langs->trans(
"MAIN_IMAP_USE_PHPIMAP");
788print
'<td class="left">';
789if (
$conf->use_javascript_ajax) {
790 print ajax_constantonoff(
'MAIN_IMAP_USE_PHPIMAP');
792 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
793 print $form->selectarray(
"MAIN_IMAP_USE_PHPIMAP", $arrval,
getDolGlobalString(
"MAIN_IMAP_USE_PHPIMAP"));
799print
'<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans(
"EmailCollectorHideMailHeaders"), $langs->transnoentitiesnoconv(
"EmailCollectorHideMailHeadersHelp")).
'</td>';
800print
'<td class="left">';
801if (
$conf->use_javascript_ajax) {
802 print ajax_constantonoff(
'MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER');
804 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
805 print $form->selectarray(
"MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER", $arrval,
getDolGlobalString(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND'));
811print
'<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans(
"EmailCollectorIsNotAnswerUseReferences"), $langs->transnoentitiesnoconv(
"EmailCollectorIsNotAnswerUseReferencesHelp")).
'</td>';
812print
'<td class="left">';
813if (
$conf->use_javascript_ajax) {
814 print ajax_constantonoff(
'EMAILCOLLECTOR_ISNOTANSWER_USE_REFERENCES');
816 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
817 print $form->selectarray(
"EMAILCOLLECTOR_ISNOTANSWER_USE_REFERENCES", $arrval,
getDolGlobalInt(
'EMAILCOLLECTOR_ISNOTANSWER_USE_REFERENCES', 0));
829if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
830 $hidegeneratedfilelistifempty = 1;
831 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
832 $hidegeneratedfilelistifempty = 0;
835 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
839 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
840 $urlsource .= str_replace(
'&',
'&', $param);
842 $filedir = $diroutputmassaction;
843 $genallowed = $permissiontoread;
844 $delallowed = $permissiontoadd;
846 print $formfile->showdocuments(
'massfilesarea_emailcollector',
'', $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
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 for EmailCollector.
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)
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.
getDolDefaultContextPage($s)
Return the default context page string.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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.