25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34 require_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');
57 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
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_');
88 if ($user->socid > 0) {
95 $search_all =
GETPOST(
'search_all',
'alphanohtml');
97 foreach ($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();
109 foreach ($object->fields as $key => $val) {
110 if (!empty($val[
'searchall'])) {
111 $fieldstosearchall[
't.'.$key] = $val[
'label'];
116 $arrayfields = array();
117 foreach ($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'] :
''
131 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
139 $permissiontoread = $user->admin;
140 $permissiontoadd = $user->admin;
141 $permissiontodelete = $user->admin;
156 if (
GETPOST(
'cancel',
'alpha')) {
160 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
164 $parameters = array();
165 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
170 if (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';
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');
219 if (!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 .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
228 $sql = preg_replace(
'/,\s*$/',
'', $sql);
229 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
230 if (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)";
233 if ($object->ismultientitymanaged == 1) {
234 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
236 $sql .=
" WHERE 1 = 1";
238 foreach ($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);
271 include 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;
297 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
298 $resql = $db->query($sql);
309 $sql .= $db->order($sortfield, $sortorder);
311 $sql .= $db->plimit($limit + 1, $offset);
314 $resql = $db->query($sql);
320 $num = $db->num_rows(
$resql);
323 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
324 $obj = $db->fetch_object(
$resql);
326 header(
"Location: ".DOL_URL_ROOT.
'/emailcollector/emailcollector_card.php?id='.$id);
336 $arrayofselected = is_array($toselect) ? $toselect : array();
339 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
340 $param .=
'&contextpage='.urlencode($contextpage);
342 if ($limit > 0 && $limit != $conf->liste_limit) {
343 $param .=
'&limit='.urlencode($limit);
345 foreach ($search as $key => $val) {
346 if (is_array($search[$key]) && count($search[$key])) {
347 foreach ($search[$key] as $skey) {
349 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
352 } elseif ($search[$key] !=
'') {
353 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
356 if ($optioncss !=
'') {
357 $param .=
'&optioncss='.urlencode($optioncss);
360 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
362 $parameters = array();
363 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
364 $param .= $hookmanager->resPrint;
367 $arrayofmassactions = array(
371 if ($permissiontodelete) {
372 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
374 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
375 $arrayofmassactions = array();
377 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
379 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
380 if ($optioncss !=
'') {
381 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
383 print
'<input type="hidden" name="token" value="'.newToken().
'">';
384 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
385 print
'<input type="hidden" name="action" value="list">';
386 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
387 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
388 print
'<input type="hidden" name="page" value="'.$page.
'">';
389 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
391 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
393 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
395 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'email', 0, $newcardbutton.
' '.$linkback,
'', $limit, 0, 0, 1);
402 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
409 $parameters = array();
410 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
411 if (empty($reshook)) {
412 $moreforfilter .= $hookmanager->resPrint;
414 $moreforfilter = $hookmanager->resPrint;
417 if (!empty($moreforfilter)) {
418 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
419 print $moreforfilter;
423 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
424 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
425 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
427 print
'<div class="div-table-responsive">';
428 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
433 print
'<tr class="liste_titre">';
435 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
436 print
'<td class="liste_titre maxwidthsearch">';
437 $searchpicto =
$form->showFilterButtons(
'left');
441 foreach ($object->fields as $key => $val) {
442 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
443 if ($key ==
'status') {
444 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
445 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
446 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
447 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
448 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
449 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
450 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
452 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
453 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
454 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
455 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
456 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
457 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
458 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
459 print
'<div class="nowrap">';
460 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
462 print
'<div class="nowrap">';
463 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
465 } elseif ($key ==
'lang') {
466 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
468 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
470 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
476 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
479 $parameters = array(
'arrayfields'=>$arrayfields);
480 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
481 print $hookmanager->resPrint;
483 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
484 print
'<td class="liste_titre maxwidthsearch">';
485 $searchpicto =
$form->showFilterButtons();
491 $totalarray = array();
492 $totalarray[
'nbfield'] = 0;
496 print
'<tr class="liste_titre">';
497 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
498 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
500 foreach ($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')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
509 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
511 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
512 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
513 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
514 $totalarray[
'nbfield']++;
518 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
520 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
521 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
522 print $hookmanager->resPrint;
524 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
525 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
527 $totalarray[
'nbfield']++;
532 $needToFetchEachLine = 0;
533 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
534 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
535 if (preg_match(
'/\$object/', $val)) {
536 $needToFetchEachLine++;
545 $savnbfield = $totalarray[
'nbfield'];
546 $totalarray[
'nbfield'] = 0;
547 $imaxinloop = ($limit ? min($num, $limit) : $num);
548 while ($i < $imaxinloop) {
549 $obj = $db->fetch_object(
$resql);
555 $object->setVarsFromFetchObj($obj);
557 if ($mode ==
'kanban') {
559 print
'<tr><td colspan="'.$savnbfield.
'">';
560 print
'<div class="box-flex-container">';
563 print $object->getKanbanView(
'');
564 if ($i == ($imaxinloop - 1)) {
571 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
573 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
574 print
'<td class="nowrap center">';
575 if ($massactionbutton || $massaction) {
577 if (in_array($object->id, $arrayofselected)) {
580 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
584 foreach ($object->fields as $key => $val) {
585 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
586 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
587 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
588 } elseif ($key ==
'status') {
589 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
592 if (in_array($val[
'type'], array(
'timestamp'))) {
593 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
594 } elseif ($key ==
'ref') {
595 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
598 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
599 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
603 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
604 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'');
605 if (preg_match(
'/tdoverflow/', $cssforfield)) {
606 print
' title="'.dol_escape_htmltag($object->$key).
'"';
609 if ($key ==
'status') {
610 print $object->getLibStatut(5);
611 } elseif ($key ==
'rowid') {
612 print $object->showOutputField($val, $key, $object->id,
'');
614 print $object->showOutputField($val, $key, $object->$key,
'');
618 $totalarray[
'nbfield']++;
620 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
622 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
624 if (!isset($totalarray[
'val'])) {
625 $totalarray[
'val'] = array();
627 if (!isset($totalarray[
'val'][
't.'.$key])) {
628 $totalarray[
'val'][
't.'.$key] = 0;
630 $totalarray[
'val'][
't.'.$key] += $object->$key;
635 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
637 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
638 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
639 print $hookmanager->resPrint;
641 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
642 print
'<td class="nowrap center">';
643 if ($massactionbutton || $massaction) {
645 if (in_array($object->id, $arrayofselected)) {
648 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
653 $totalarray[
'nbfield']++;
663 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
669 foreach ($arrayfields as $key => $val) {
670 if (!empty($val[
'checked'])) {
674 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
680 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
681 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
682 print $hookmanager->resPrint;
684 print
'</table>'.
"\n";
690 print
'<div class="div-table-responsive-no-min">';
691 print
'<table class="noborder centpercent">';
693 print
'<tr class="liste_titre">';
694 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
699 print
'<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans(
"EmailCollectorHideMailHeaders"), $langs->transnoentitiesnoconv(
"EmailCollectorHideMailHeadersHelp")).
'</td>';
700 print
'<td class="left">';
701 if ($conf->use_javascript_ajax) {
704 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
705 print
$form->selectarray(
"MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER", $arrval, $conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND);
715 print
'</form>'.
"\n";
718 $hidegeneratedfilelistifempty = 1;
719 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
720 $hidegeneratedfilelistifempty = 0;
723 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
727 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
728 $urlsource .= str_replace(
'&',
'&', $param);
730 $filedir = $diroutputmassaction;
731 $genallowed = $permissiontoread;
732 $delallowed = $permissiontoadd;
734 print $formfile->showdocuments(
'massfilesarea_emailcollector',
'', $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.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class for EmailCollector.
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.
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_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.
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...
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$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.