28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/intracommreport/class/intracommreport.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
42$langs->loadLangs(array(
'intracommreport'));
45$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
46$massaction =
GETPOST(
'massaction',
'alpha');
47$show_files =
GETPOST(
'show_files',
'int');
48$confirm =
GETPOST(
'confirm',
'alpha');
49$cancel =
GETPOST(
'cancel',
'alpha');
50$toselect =
GETPOST(
'toselect',
'array:int');
51$optioncss =
GETPOST(
'optioncss',
'alpha');
54$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
55$search_ref =
GETPOST(
"search_ref",
'alpha');
56$search_type =
GETPOST(
"search_type",
'int');
59$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'intracommreportlist';
60if ((
string) $type ==
'1') {
61 $contextpage =
'DESlist';
62 if ($search_type ==
'') {
66if ((
string) $type ==
'0') {
67 $contextpage =
'DEBlist';
68 if ($search_type ==
'') {
73$diroutputmassaction = $conf->product->dir_output.
'/temp/massgeneration/'.$user->id;
77$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
78$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
80if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
84$offset = $limit * $page;
92$diroutputmassaction = $conf->mymodule->dir_output.
'/temp/massgeneration/'.$user->id;
93$hookmanager->initHooks(array($contextpage));
96$extrafields->fetch_name_optionals_label(
$object->table_element);
99$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
104 $sortfield =
"t.".key(
$object->fields);
111$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
113foreach (
$object->fields as $key => $val) {
114 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
115 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
117 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
123$fieldstosearchall = array(
129$hookmanager->initHooks(array(
'intracommreportlist'));
131$form =
new Form($db);
146$arrayfields = array();
147foreach (
$object->fields as $key => $val) {
149 if (!empty($val[
'visible'])) {
150 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
151 $arrayfields[
't.'.$key] = array(
152 'label' => $val[
'label'],
153 'checked' => (($visible < 0) ? 0 : 1),
154 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
155 'position' => $val[
'position'],
156 'help' => isset($val[
'help']) ? $val[
'help'] :
''
161include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
171$permissiontoread = $user->hasRight(
'intracommreport',
'read');
172$permissiontoadd = $user->hasRight(
'intracommreport',
'write');
173$permissiontodelete = $user->hasRight(
'intracommreport',
'delete');
176if ($search_type ==
'0') {
177 $result =
restrictedArea($user,
'produit',
'',
'',
'',
'',
'', 0);
178} elseif ($search_type ==
'1') {
179 $result =
restrictedArea($user,
'service',
'',
'',
'',
'',
'', 0);
181 $result =
restrictedArea($user,
'produit|service',
'',
'',
'',
'',
'', 0);
194if (
GETPOST(
'cancel',
'alpha')) {
198if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
202$parameters = array();
203$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
208if (empty($reshook)) {
210 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
213 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
220 $search_array_options = array();
224 $objectclass =
'Product';
225 if ((
string) $search_type ==
'1') {
226 $objectlabel =
'Services';
228 if ((
string) $search_type ==
'0') {
229 $objectlabel =
'Products';
232 $uploaddir = $conf->product->dir_output;
233 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
241$form =
new Form($db);
245$title = $langs->trans(
"IntraCommReports");
255$sql .=
$object->getFieldList(
't');
257if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
258 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
259 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
263$parameters = array();
264$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
265$sql .= $hookmanager->resPrint;
266$sql = preg_replace(
'/,\s*$/',
'', $sql);
270$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
272if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
273 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
276$parameters = array();
277$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
278$sql .= $hookmanager->resPrint;
279if (
$object->ismultientitymanaged == 1) {
280 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
282 $sql .=
" WHERE 1 = 1";
284foreach ($search as $key => $val) {
285 if (array_key_exists($key,
$object->fields)) {
286 if ($key ==
'status' && $search[$key] == -1) {
290 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
291 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
296 if ($search[$key] !=
'') {
297 $sql .=
natural_search(
"t.".$db->sanitize($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
300 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
301 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
302 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
303 if (preg_match(
'/_dtstart$/', $key)) {
304 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".$db->idate($search[$key]).
"'";
306 if (preg_match(
'/_dtend$/', $key)) {
307 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".$db->idate($search[$key]).
"'";
314 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
337include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
339$parameters = array();
340$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
341$sql .= $hookmanager->resPrint;
344$nbtotalofrecords =
'';
347 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
348 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
350 $resql = $db->query($sqlforcount);
352 $objforcount = $db->fetch_object($resql);
353 $nbtotalofrecords = $objforcount->nbtotalofrecords;
358 if (($page * $limit) > (
int) $nbtotalofrecords) {
366$sql .= $db->order($sortfield, $sortorder);
368 $sql .= $db->plimit($limit + 1, $offset);
371$resql = $db->query($sql);
377$num = $db->num_rows($resql);
381if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
382 $obj = $db->fetch_object($resql);
384 header(
"Location: ".
dol_buildpath(
'/intracommreport/card.php', 1).
'?id='.((
int)
$id));
392llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-mymodule page-list bodyforlist');
409$arrayofselected = is_array($toselect) ? $toselect : array();
413 $param .=
'&mode='.urlencode($mode);
415if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
416 $param .=
'&contextpage='.urlencode($contextpage);
418if ($limit > 0 && $limit != $conf->liste_limit) {
419 $param .=
'&limit='.((int) $limit);
421if ($optioncss !=
'') {
422 $param .=
'&optioncss='.urlencode($optioncss);
425 $param .=
'&groupby='.urlencode($groupby);
427foreach ($search as $key => $val) {
428 if (is_array($search[$key])) {
429 foreach ($search[$key] as $skey) {
431 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
434 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
435 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
436 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
437 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
438 } elseif ($search[$key] !=
'') {
439 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
443include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
445$parameters = array(
'param' => &$param);
446$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
447$param .= $hookmanager->resPrint;
450$arrayofmassactions = array(
456if (!empty($permissiontodelete)) {
457 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
459if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
460 $arrayofmassactions = array();
462$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
464print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
465if ($optioncss !=
'') {
466 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
468print
'<input type="hidden" name="token" value="'.newToken().
'">';
469print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
470print
'<input type="hidden" name="action" value="list">';
471print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
472print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
473print
'<input type="hidden" name="page" value="'.$page.
'">';
474print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
475print
'<input type="hidden" name="page_y" value="">';
476print
'<input type="hidden" name="mode" value="'.$mode.
'">';
480$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
481$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
483$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/intracommreport/card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
485print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
488$topicmail =
"SendIntraCommReportRef";
489$modelmail =
"intracommreport";
491$trackid =
'xxxx'.$object->id;
492include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
496 foreach ($fieldstosearchall as $key => $val) {
497 $fieldstosearchall[$key] = $langs->trans($val);
498 $setupstring .= $key.
"=".$val.
";";
500 print
'<!-- Search done like if INTRACOMMREPORT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
501 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
509$parameters = array();
510$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
511if (empty($reshook)) {
512 $moreforfilter .= $hookmanager->resPrint;
514 $moreforfilter = $hookmanager->resPrint;
517if (!empty($moreforfilter)) {
518 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
519 print $moreforfilter;
523$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
524$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, (
string) $conf->main_checkbox_left_column ?
'left' :
'');
525$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
526$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
528print
'<div class="div-table-responsive">';
529print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
533print
'<tr class="liste_titre_filter">';
535if ($conf->main_checkbox_left_column) {
536 print
'<td class="liste_titre center maxwidthsearch">';
537 $searchpicto = $form->showFilterButtons(
'left');
541foreach (
$object->fields as $key => $val) {
543 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
544 if ($key ==
'status') {
545 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
546 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
547 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
548 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
549 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
550 } 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'])) {
551 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
553 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
554 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
555 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
556 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);
557 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
558 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
559 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
560 print
'<div class="nowrap">';
561 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
563 print
'<div class="nowrap">';
564 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
566 } elseif ($key ==
'lang') {
567 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
569 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
571 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
577include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
580$parameters = array(
'arrayfields' => $arrayfields);
581$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
582print $hookmanager->resPrint;
587if (!$conf->main_checkbox_left_column) {
588 print
'<td class="liste_titre center maxwidthsearch">';
589 $searchpicto = $form->showFilterButtons();
600print
'<tr class="liste_titre">';
602if ($conf->main_checkbox_left_column) {
603 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
606foreach (
$object->fields as $key => $val) {
607 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
608 if ($key ==
'status') {
609 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
610 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
611 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
612 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
613 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
614 } 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'])) {
615 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
617 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
618 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
619 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";
624include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
626$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
627$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
628print $hookmanager->resPrint;
634if (!$conf->main_checkbox_left_column) {
635 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
641$needToFetchEachLine = 0;
642if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
643 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
644 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
645 $needToFetchEachLine++;
657$imaxinloop = ($limit ? min($num, $limit) : $num);
658while ($i < $imaxinloop) {
659 $obj = $db->fetch_object($resql);
665 $object->setVarsFromFetchObj($obj);
681 if ($mode ==
'kanban') {
683 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
684 print
'<div class="box-flex-container kanban">';
688 if ($massactionbutton || $massaction) {
690 if (in_array(
$object->id, $arrayofselected)) {
695 print
$object->getKanbanView(
'', array(
'selected' => $selected));
696 if ($i == ($imaxinloop - 1)) {
703 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
706 if ($conf->main_checkbox_left_column) {
707 print
'<td class="nowrap center">';
708 if ($massactionbutton || $massaction) {
710 if (in_array(
$object->id, $arrayofselected)) {
713 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
721 foreach (
$object->fields as $key => $val) {
722 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
723 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
724 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
725 } elseif ($key ==
'status') {
726 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
729 if (in_array($val[
'type'], array(
'timestamp'))) {
730 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
731 } elseif ($key ==
'ref') {
732 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
735 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'])) {
736 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
740 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
741 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
742 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
743 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
746 if ($key ==
'status') {
747 print
$object->getLibStatut(5);
748 } elseif ($key ==
'rowid') {
749 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
757 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
761 if (!isset($totalarray[
'val'])) {
764 if (!isset($totalarray[
'val'][
't.'.$key])) {
772 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
774 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
775 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
776 print $hookmanager->resPrint;
783 if (empty($conf->main_checkbox_left_column)) {
784 print
'<td class="nowrap center">';
785 if ($massactionbutton || $massaction) {
787 if (in_array(
$object->id, $arrayofselected)) {
790 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
805include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
810 foreach ($arrayfields as $key => $val) {
811 if (!empty($val[
'checked'])) {
815 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
821$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
822$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
823print $hookmanager->resPrint;
825print
'</table>'.
"\n";
830if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
831 $hidegeneratedfilelistifempty = 1;
832 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
833 $hidegeneratedfilelistifempty = 0;
836 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
840 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
841 $urlsource .= str_replace(
'&',
'&', $param);
843 $filedir = $diroutputmassaction;
844 $genallowed = $permissiontoread;
845 $delallowed = $permissiontoadd;
847 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $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 to manage intracomm report.
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.
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_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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.