28require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/intracommreport/class/intracommreport.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
39require_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');
53$groupby =
GETPOST(
'groupby',
'aZ09');
55$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
56$search_ref =
GETPOST(
"search_ref",
'alpha');
57$search_type =
GETPOST(
"search_type",
'int');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'intracommreportlist';
74$diroutputmassaction =
$conf->product->dir_output.
'/temp/massgeneration/'.$user->id;
78$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
79$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
81if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
85$offset = $limit * $page;
93$diroutputmassaction =
$conf->intracommreport->dir_output.
'/temp/massgeneration/'.$user->id;
94$hookmanager->initHooks(array($contextpage));
97$extrafields->fetch_name_optionals_label(
$object->table_element);
100$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
105 $sortfield =
"t.".key(
$object->fields);
112$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
114foreach (
$object->fields as $key => $val) {
115 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
116 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
118 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
124$fieldstosearchall = array(
130$hookmanager->initHooks(array(
'intracommreportlist'));
147$arrayfields = array();
148foreach (
$object->fields as $key => $val) {
150 if (!empty($val[
'visible'])) {
151 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
152 $arrayfields[
't.'.$key] = array(
153 'label' => $val[
'label'],
154 'checked' => (($visible < 0) ? 0 : 1),
155 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
156 'position' => $val[
'position'],
157 'help' => isset($val[
'help']) ? $val[
'help'] :
''
162include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
172$permissiontoread = $user->hasRight(
'intracommreport',
'read');
173$permissiontoadd = $user->hasRight(
'intracommreport',
'write');
174$permissiontodelete = $user->hasRight(
'intracommreport',
'delete');
177if ($search_type ==
'0') {
178 $result =
restrictedArea($user,
'produit',
'',
'',
'',
'',
'', 0);
179} elseif ($search_type ==
'1') {
180 $result =
restrictedArea($user,
'service',
'',
'',
'',
'',
'', 0);
182 $result =
restrictedArea($user,
'produit|service',
'',
'',
'',
'',
'', 0);
195if (
GETPOST(
'cancel',
'alpha')) {
199if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
203$parameters = array();
204$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
209if (empty($reshook)) {
211 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
214 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
221 $search_array_options = array();
225 $objectclass =
'Product';
226 if ((
string) $search_type ==
'1') {
227 $objectlabel =
'Services';
229 if ((
string) $search_type ==
'0') {
230 $objectlabel =
'Products';
233 $uploaddir =
$conf->product->dir_output;
234 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
246$title = $langs->trans(
"IntraCommReports");
256$sql .=
$object->getFieldList(
't');
258if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
259 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
260 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
264$parameters = array();
265$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
266$sql .= $hookmanager->resPrint;
267$sql = preg_replace(
'/,\s*$/',
'', $sql);
271$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
273if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
274 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
277$parameters = array();
278$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
279$sql .= $hookmanager->resPrint;
280if (
$object->ismultientitymanaged == 1) {
281 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
283 $sql .=
" WHERE 1 = 1";
285foreach ($search as $key => $val) {
286 if (array_key_exists($key,
$object->fields)) {
287 if ($key ==
'status' && $search[$key] == -1) {
291 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
292 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
297 if ($search[$key] !=
'') {
298 $sql .=
natural_search(
"t.".
$db->sanitize($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
301 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
302 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
303 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
304 if (preg_match(
'/_dtstart$/', $key)) {
305 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate($search[$key]).
"'";
307 if (preg_match(
'/_dtend$/', $key)) {
308 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".
$db->idate($search[$key]).
"'";
315 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
338include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
340$parameters = array();
341$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
342$sql .= $hookmanager->resPrint;
345$nbtotalofrecords =
'';
348 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
349 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
351 $resql =
$db->query($sqlforcount);
353 $objforcount =
$db->fetch_object($resql);
354 $nbtotalofrecords = $objforcount->nbtotalofrecords;
359 if (($page * $limit) > (
int) $nbtotalofrecords) {
367$sql .=
$db->order($sortfield, $sortorder);
369 $sql .=
$db->plimit($limit + 1, $offset);
372$resql =
$db->query($sql);
378$num =
$db->num_rows($resql);
382if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
383 $obj =
$db->fetch_object($resql);
385 header(
"Location: ".
dol_buildpath(
'/intracommreport/card.php', 1).
'?id='.((
int)
$id));
393llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-mymodule page-list bodyforlist');
395$arrayofselected = is_array($toselect) ? $toselect : array();
399 $param .=
'&mode='.urlencode($mode);
401if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
402 $param .=
'&contextpage='.urlencode($contextpage);
404if ($limit > 0 && $limit !=
$conf->liste_limit) {
405 $param .=
'&limit='.((int) $limit);
407if ($optioncss !=
'') {
408 $param .=
'&optioncss='.urlencode($optioncss);
411 $param .=
'&groupby='.urlencode($groupby);
413foreach ($search as $key => $val) {
414 if (is_array($search[$key])) {
415 foreach ($search[$key] as $skey) {
417 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
420 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
421 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
422 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
423 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
424 } elseif ($search[$key] !=
'') {
425 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
429include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
431$parameters = array(
'param' => &$param);
432$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
433$param .= $hookmanager->resPrint;
436$arrayofmassactions = array(
442if (!empty($permissiontodelete)) {
443 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
445if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
446 $arrayofmassactions = array();
448$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
450print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
451if ($optioncss !=
'') {
452 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
454print
'<input type="hidden" name="token" value="'.newToken().
'">';
455print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
456print
'<input type="hidden" name="action" value="list">';
457print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
458print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
459print
'<input type="hidden" name="page" value="'.$page.
'">';
460print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
461print
'<input type="hidden" name="page_y" value="">';
462print
'<input type="hidden" name="mode" value="'.$mode.
'">';
466$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'));
467$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'));
468$newcardbutton .= dolGetButtonTitleSeparator();
469$newcardbutton .= dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/intracommreport/card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
471print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
474$topicmail =
"SendIntraCommReportRef";
475$modelmail =
"intracommreport";
477$trackid =
'xxxx'.$object->id;
478include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
482 foreach ($fieldstosearchall as $key => $val) {
483 $fieldstosearchall[$key] = $langs->trans($val);
484 $setupstring .= $key.
"=".$val.
";";
486 print
'<!-- Search done like if INTRACOMMREPORT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
487 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
495$parameters = array();
496$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
497if (empty($reshook)) {
498 $moreforfilter .= $hookmanager->resPrint;
500 $moreforfilter = $hookmanager->resPrint;
503if (!empty($moreforfilter)) {
504 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
505 print $moreforfilter;
509$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
510$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, (
string)
$conf->main_checkbox_left_column ?
'left' :
'');
511$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
512$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
514print
'<div class="div-table-responsive">';
515print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
519print
'<tr class="liste_titre_filter">';
521if (
$conf->main_checkbox_left_column) {
522 print
'<td class="liste_titre center maxwidthsearch">';
523 $searchpicto = $form->showFilterButtons(
'left');
527foreach (
$object->fields as $key => $val) {
529 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
530 if ($key ==
'status') {
531 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
532 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
533 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
534 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
535 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
536 } 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'])) {
537 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
539 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
540 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
541 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
542 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);
543 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
544 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
545 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
546 print
'<div class="nowrap">';
547 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
549 print
'<div class="nowrap">';
550 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
552 } elseif ($key ==
'lang') {
553 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
555 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
557 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
563include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
566$parameters = array(
'arrayfields' => $arrayfields);
567$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
568print $hookmanager->resPrint;
573if (!
$conf->main_checkbox_left_column) {
574 print
'<td class="liste_titre center maxwidthsearch">';
575 $searchpicto = $form->showFilterButtons();
586print
'<tr class="liste_titre">';
588if (
$conf->main_checkbox_left_column) {
589 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
592foreach (
$object->fields as $key => $val) {
593 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
594 if ($key ==
'status') {
595 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
596 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
597 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
598 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
599 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
600 } 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'])) {
601 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
603 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
604 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
605 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";
610include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
612$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &
$totalarray);
613$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
614print $hookmanager->resPrint;
620if (!
$conf->main_checkbox_left_column) {
621 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
627$needToFetchEachLine = 0;
628if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
629 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
630 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
631 $needToFetchEachLine++;
643$imaxinloop = ($limit ? min($num, $limit) : $num);
644while ($i < $imaxinloop) {
645 $obj =
$db->fetch_object($resql);
651 $object->setVarsFromFetchObj($obj);
667 if ($mode ==
'kanban') {
669 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
670 print
'<div class="box-flex-container kanban">';
674 if ($massactionbutton || $massaction) {
676 if (in_array(
$object->id, $arrayofselected)) {
681 print
$object->getKanbanView(
'', array(
'selected' => $selected));
682 if ($i == ($imaxinloop - 1)) {
689 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
692 if (
$conf->main_checkbox_left_column) {
693 print
'<td class="nowrap center">';
694 if ($massactionbutton || $massaction) {
696 if (in_array(
$object->id, $arrayofselected)) {
699 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
707 foreach (
$object->fields as $key => $val) {
708 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
709 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
710 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
711 } elseif ($key ==
'status') {
712 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
715 if (in_array($val[
'type'], array(
'timestamp'))) {
716 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
717 } elseif ($key ==
'ref') {
718 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
721 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'])) {
722 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
726 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
727 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
728 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
729 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
732 if ($key ==
'status') {
733 print
$object->getLibStatut(5);
734 } elseif ($key ==
'rowid') {
735 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
743 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
758 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
760 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
761 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
762 print $hookmanager->resPrint;
769 if (empty(
$conf->main_checkbox_left_column)) {
770 print
'<td class="nowrap center">';
771 if ($massactionbutton || $massaction) {
773 if (in_array(
$object->id, $arrayofselected)) {
776 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
791include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
796 foreach ($arrayfields as $key => $val) {
797 if (!empty($val[
'checked'])) {
801 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
807$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
808$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
809print $hookmanager->resPrint;
811print
'</table>'.
"\n";
816if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
817 $hidegeneratedfilelistifempty = 1;
818 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
819 $hidegeneratedfilelistifempty = 0;
822 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
826 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
827 $urlsource .= str_replace(
'&',
'&', $param);
829 $filedir = $diroutputmassaction;
830 $genallowed = $permissiontoread;
831 $delallowed = $permissiontoadd;
833 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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_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...
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
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.