25require
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/emailcollector/class/emailcollector.class.php';
37$langs->loadLangs(array(
"admin",
"other"));
39$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
40$massaction =
GETPOST(
'massaction',
'alpha');
41$show_files =
GETPOST(
'show_files',
'int');
42$confirm =
GETPOST(
'confirm',
'alpha');
43$cancel =
GETPOST(
'cancel',
'alpha');
44$toselect =
GETPOST(
'toselect',
'array');
45$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'emailcollectorlist';
46$backtopage =
GETPOST(
'backtopage',
'alpha');
47$optioncss =
GETPOST(
'optioncss',
'aZ');
53$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
54$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
56$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
57if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
61$offset = $limit * $page;
70$diroutputmassaction = $conf->emailcollector->dir_output.
'/temp/massgeneration/'.$user->id;
71$hookmanager->initHooks(array(
'emailcollectorlist'));
74$extrafields->fetch_name_optionals_label($object->table_element);
76$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
88if ($user->socid > 0) {
95$search_all =
GETPOST(
'search_all',
'alphanohtml');
97foreach ($object->fields as $key => $val) {
98 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
99 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
101 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
102 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
103 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
108$fieldstosearchall = array();
109foreach ($object->fields as $key => $val) {
110 if (!empty($val[
'searchall'])) {
111 $fieldstosearchall[
't.'.$key] = $val[
'label'];
116$arrayfields = array();
117foreach ($object->fields as $key => $val) {
119 if (!empty($val[
'visible'])) {
120 $visible = (int)
dol_eval($val[
'visible'], 1);
121 $arrayfields[
't.'.$key] = array(
122 'label'=>$val[
'label'],
123 'checked'=>(($visible < 0) ? 0 : 1),
124 'enabled'=>(abs($visible) != 3 &&
dol_eval($val[
'enabled'], 1)),
125 'position'=>$val[
'position'],
126 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
131include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
139$permissiontoread = $user->admin;
140$permissiontoadd = $user->admin;
141$permissiontodelete = $user->admin;
146if (!isModEnabled(
'emailcollector')) {
156if (
GETPOST(
'cancel',
'alpha')) {
160if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
164$parameters = array();
165$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
170if (empty($reshook)) {
172 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
175 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
176 foreach ($object->fields as $key => $val) {
178 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
179 $search[$key.
'_dtstart'] =
'';
180 $search[$key.
'_dtend'] =
'';
184 $search_array_options = array();
186 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
187 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
192 $objectclass =
'EmailCollector';
193 $objectlabel =
'EmailCollector';
194 $uploaddir = $conf->emailcollector->dir_output;
195 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
204$form =
new Form($db);
208$help_url =
"EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector";
209$title = $langs->trans(
'EmailCollectors');
217$sql .= $object->getFieldList(
't');
219if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
220 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
221 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
225$parameters = array();
226$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
227$sql .= $hookmanager->resPrint;
228$sql = preg_replace(
'/,\s*$/',
'', $sql);
229$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
230if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
231 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
233if ($object->ismultientitymanaged == 1) {
234 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
236 $sql .=
" WHERE 1 = 1";
238foreach ($search as $key => $val) {
239 if (array_key_exists($key, $object->fields)) {
240 if ($key ==
'status' && $search[$key] == -1) {
243 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
244 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
245 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
250 if ($search[$key] !=
'') {
251 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
254 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
255 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
256 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
257 if (preg_match(
'/_dtstart$/', $key)) {
258 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
260 if (preg_match(
'/_dtend$/', $key)) {
261 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
268 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
271include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
273$parameters = array();
274$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
275$sql .= $hookmanager->resPrint;
277$nbtotalofrecords =
'';
279 $resql = $db->query($sql);
280 $nbtotalofrecords = $db->num_rows($resql);
282 if (($page * $limit) > $nbtotalofrecords) {
290$sql .= $db->order($sortfield, $sortorder);
292 $sql .= $db->plimit($limit + 1, $offset);
295$resql = $db->query($sql);
301$num = $db->num_rows($resql);
304if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
305 $obj = $db->fetch_object($resql);
307 header(
"Location: ".DOL_URL_ROOT.
'/emailcollector/emailcollector_card.php?id='.$id);
315llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
318$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
324$head[$h][0] = DOL_URL_ROOT.
"/admin/emailcollector_list.php";
325$head[$h][1] = $langs->trans(
"Setup");
326$head[$h][2] =
'common';
333$arrayofselected = is_array($toselect) ? $toselect : array();
336if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
337 $param .=
'&contextpage='.urlencode($contextpage);
339if ($limit > 0 && $limit != $conf->liste_limit) {
340 $param .=
'&limit='.((int) $limit);
342foreach ($search as $key => $val) {
343 if (is_array($search[$key]) && count($search[$key])) {
344 foreach ($search[$key] as $skey) {
346 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
349 } elseif ($search[$key] !=
'') {
350 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
353if ($optioncss !=
'') {
354 $param .=
'&optioncss='.urlencode($optioncss);
357include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
359$parameters = array();
360$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
361$param .= $hookmanager->resPrint;
364$arrayofmassactions = array(
368if ($permissiontodelete) {
369 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
371if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
372 $arrayofmassactions = array();
374$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
376print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
377if ($optioncss !=
'') {
378 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
380print
'<input type="hidden" name="token" value="'.newToken().
'">';
381print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
382print
'<input type="hidden" name="action" value="list">';
383print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
384print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
385print
'<input type="hidden" name="page" value="'.$page.
'">';
386print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388$newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
390print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'email', 0, $newcardbutton,
'', $limit, 0, 0, 1);
397include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
404$parameters = array();
405$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
406if (empty($reshook)) {
407 $moreforfilter .= $hookmanager->resPrint;
409 $moreforfilter = $hookmanager->resPrint;
412if (!empty($moreforfilter)) {
413 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
414 print $moreforfilter;
418$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
419$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
420$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
422print
'<div class="div-table-responsive">';
423print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
428print
'<tr class="liste_titre">';
430if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
431 print
'<td class="liste_titre maxwidthsearch">';
432 $searchpicto = $form->showFilterButtons(
'left');
436foreach ($object->fields as $key => $val) {
437 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
438 if ($key ==
'status') {
439 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
440 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
441 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
442 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
443 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
444 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
445 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
447 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
448 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
449 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
450 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
451 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
452 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
453 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
454 print
'<div class="nowrap">';
455 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
457 print
'<div class="nowrap">';
458 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
460 } elseif ($key ==
'lang') {
461 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
463 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
465 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
471include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
474$parameters = array(
'arrayfields'=>$arrayfields);
475$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
476print $hookmanager->resPrint;
478if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
479 print
'<td class="liste_titre maxwidthsearch">';
480 $searchpicto = $form->showFilterButtons();
486$totalarray = array();
487$totalarray[
'nbfield'] = 0;
491print
'<tr class="liste_titre">';
492if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
493 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
495foreach ($object->fields as $key => $val) {
496 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
497 if ($key ==
'status') {
498 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
499 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
500 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
501 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
502 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
503 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
504 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
506 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
507 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
508 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
509 $totalarray[
'nbfield']++;
513include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
515$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
516$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
517print $hookmanager->resPrint;
519if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
520 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
522$totalarray[
'nbfield']++;
527$needToFetchEachLine = 0;
528if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
529 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
530 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
531 $needToFetchEachLine++;
540$savnbfield = $totalarray[
'nbfield'];
541$totalarray[
'nbfield'] = 0;
542$imaxinloop = ($limit ? min($num, $limit) : $num);
543while ($i < $imaxinloop) {
544 $obj = $db->fetch_object($resql);
550 $object->setVarsFromFetchObj($obj);
552 if ($mode ==
'kanban') {
554 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
555 print
'<div class="box-flex-container kanban">';
558 print $object->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
559 if ($i == ($imaxinloop - 1)) {
566 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
568 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
569 print
'<td class="nowrap center">';
570 if ($massactionbutton || $massaction) {
572 if (in_array($object->id, $arrayofselected)) {
575 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
579 foreach ($object->fields as $key => $val) {
580 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
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')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
594 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
598 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
599 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
600 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
601 print
' title="'.dol_escape_htmltag($object->$key).
'"';
604 if ($key ==
'status') {
605 print $object->getLibStatut(5);
606 } elseif ($key ==
'lastresult') {
607 print
'<div class="twolinesmax">';
608 print $object->showOutputField($val, $key, $object->$key,
'');
610 } elseif ($key ==
'rowid') {
611 print $object->showOutputField($val, $key, $object->id,
'');
613 print $object->showOutputField($val, $key, $object->$key,
'');
617 $totalarray[
'nbfield']++;
619 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
621 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
623 if (!isset($totalarray[
'val'])) {
624 $totalarray[
'val'] = array();
626 if (!isset($totalarray[
'val'][
't.'.$key])) {
627 $totalarray[
'val'][
't.'.$key] = 0;
629 $totalarray[
'val'][
't.'.$key] += $object->$key;
634 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
636 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
637 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
638 print $hookmanager->resPrint;
640 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
641 print
'<td class="nowrap center">';
642 if ($massactionbutton || $massaction) {
644 if (in_array($object->id, $arrayofselected)) {
647 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
652 $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";
689print
'<div class="div-table-responsive-no-min">';
690print
'<table class="noborder centpercent">';
692print
'<tr class="liste_titre">';
693print
'<td>'.$langs->trans(
"Parameter").
'</td>';
698print
'<tr class="oddeven"><td>';
700print $langs->trans(
"MAIN_IMAP_USE_PHPIMAP");
702print
'<td class="left">';
703if ($conf->use_javascript_ajax) {
704 print ajax_constantonoff(
'MAIN_IMAP_USE_PHPIMAP');
706 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
707 print $form->selectarray(
"MAIN_IMAP_USE_PHPIMAP", $arrval, $conf->global->MAIN_IMAP_USE_PHPIMAP);
713print
'<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans(
"EmailCollectorHideMailHeaders"), $langs->transnoentitiesnoconv(
"EmailCollectorHideMailHeadersHelp")).
'</td>';
714print
'<td class="left">';
715if ($conf->use_javascript_ajax) {
716 print ajax_constantonoff(
'MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER');
718 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
719 print $form->selectarray(
"MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER", $arrval, $conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND);
731if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
732 $hidegeneratedfilelistifempty = 1;
733 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
734 $hidegeneratedfilelistifempty = 0;
737 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
741 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
742 $urlsource .= str_replace(
'&',
'&', $param);
744 $filedir = $diroutputmassaction;
745 $genallowed = $permissiontoread;
746 $delallowed = $permissiontoadd;
748 print $formfile->showdocuments(
'massfilesarea_emailcollector',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class for EmailCollector.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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='', $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...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.