25 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once __DIR__.
'/class/mo.class.php';
38 $langs->loadLangs(array(
"mrp",
"other"));
40 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
41 $massaction =
GETPOST(
'massaction',
'alpha');
42 $show_files =
GETPOST(
'show_files',
'int');
43 $confirm =
GETPOST(
'confirm',
'alpha');
44 $cancel =
GETPOST(
'cancel',
'alpha');
45 $toselect =
GETPOST(
'toselect',
'array');
46 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'molist';
47 $backtopage =
GETPOST(
'backtopage',
'alpha');
48 $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')) {
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
68 $object =
new Mo($db);
70 $diroutputmassaction = $conf->mrp->dir_output.
'/temp/massgeneration/'.$user->id;
71 $hookmanager->initHooks(array(
'molist'));
74 $extrafields->fetch_name_optionals_label($object->table_element);
76 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
87 $search_all =
GETPOST(
'search_all',
'alphanohtml');
89 foreach ($object->fields as $key => $val) {
90 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
91 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
93 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
94 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
95 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
100 $fieldstosearchall = array();
101 foreach ($object->fields as $key => $val) {
102 if (!empty($val[
'searchall'])) {
103 $fieldstosearchall[
't.'.$key] = $val[
'label'];
108 $arrayfields = array();
109 foreach ($object->fields as $key => $val) {
111 if (!empty($val[
'visible'])) {
112 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
113 $arrayfields[
't.'.$key] = array(
114 'label'=>$val[
'label'],
115 'checked'=>(($visible < 0) ? 0 : 1),
116 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
117 'position'=>$val[
'position'],
118 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
122 if ($key ==
'fk_parent_line') {
123 $visible = (int)
dol_eval($val[
'visible'], 1);
124 $arrayfields[
't.'.$key] = array(
125 'label'=>$val[
'label'],
126 'checked'=>(($visible < 0) ? 0 : 1),
127 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1)),
128 'position'=>$val[
'position'],
129 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
134 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
139 $permissiontoread = $user->rights->mrp->read;
140 $permissiontoadd = $user->rights->mrp->write;
141 $permissiontodelete = $user->rights->mrp->delete;
144 if ($user->socid > 0) {
155 if (
GETPOST(
'cancel',
'alpha')) {
159 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
163 $parameters = array();
164 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
169 if (empty($reshook)) {
171 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
174 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
175 foreach ($object->fields as $key => $val) {
177 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
178 $search[$key.
'_dtstart'] =
'';
179 $search[$key.
'_dtend'] =
'';
183 $search_array_options = array();
185 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
186 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
193 $uploaddir = $conf->mrp->dir_output;
194 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
209 $title = $langs->trans(
'ListOfManufacturingOrders');
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 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"mrp_production lineparent ON t.fk_parent_line = lineparent.rowid";
234 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"mrp_mo moparent ON lineparent.fk_mo = moparent.rowid";
236 $parameters = array();
237 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
238 $sql .= $hookmanager->resPrint;
239 if ($object->ismultientitymanaged == 1) {
240 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
242 $sql .=
" WHERE 1 = 1";
245 foreach ($search as $key => $val) {
246 if (array_key_exists($key, $object->fields)) {
247 if ($key ==
'status' && $search[$key] == -1) {
250 if ($key ==
'fk_parent_line') {
255 if ($key ==
'status') {
261 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
262 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
263 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
268 if ($search[$key] !=
'') {
269 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
272 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
273 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
274 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
275 if (preg_match(
'/_dtstart$/', $key)) {
276 $sql .=
" AND t.".$columnName.
" >= '".$db->idate($search[$key]).
"'";
278 if (preg_match(
'/_dtend$/', $key)) {
279 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
286 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
290 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
292 $parameters = array();
293 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
294 $sql .= $hookmanager->resPrint;
314 $sql .= $db->order($sortfield, $sortorder);
317 $nbtotalofrecords =
'';
318 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
319 $resql = $db->query($sql);
320 $nbtotalofrecords = $db->num_rows(
$resql);
321 if (($page * $limit) > $nbtotalofrecords) {
327 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
328 $num = $nbtotalofrecords;
331 $sql .= $db->plimit($limit + 1, $offset);
334 $resql = $db->query($sql);
340 $num = $db->num_rows(
$resql);
344 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
345 $obj = $db->fetch_object(
$resql);
347 header(
"Location: ".
dol_buildpath(
'/mrp/mo_card.php', 1).
'?id='.$id);
358 $arrayofselected = is_array($toselect) ? $toselect : array();
361 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
362 $param .=
'&contextpage='.urlencode($contextpage);
364 if ($limit > 0 && $limit != $conf->liste_limit) {
365 $param .=
'&limit='.urlencode($limit);
367 foreach ($search as $key => $val) {
368 if (is_array($search[$key]) && count($search[$key])) {
369 foreach ($search[$key] as $skey) {
371 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
374 } elseif ($search[$key] !=
'') {
375 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
378 if ($optioncss !=
'') {
379 $param .=
'&optioncss='.urlencode($optioncss);
382 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
384 $parameters = array();
385 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
386 $param .= $hookmanager->resPrint;
389 $arrayofmassactions = array(
395 if ($permissiontodelete) {
396 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
398 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
399 $arrayofmassactions = array();
401 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
403 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
404 if ($optioncss !=
'') {
405 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
407 print
'<input type="hidden" name="token" value="'.newToken().
'">';
408 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
409 print
'<input type="hidden" name="action" value="list">';
410 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
411 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
412 print
'<input type="hidden" name="page" value="'.$page.
'">';
413 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
415 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
417 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
420 $topicmail =
"SendMoRef";
422 $objecttmp =
new Mo($db);
423 $trackid =
'mo'.$object->id;
424 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
427 foreach ($fieldstosearchall as $key => $val) {
428 $fieldstosearchall[$key] = $langs->trans($val);
430 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
438 $parameters = array();
439 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
440 if (empty($reshook)) {
441 $moreforfilter .= $hookmanager->resPrint;
443 $moreforfilter = $hookmanager->resPrint;
446 if (!empty($moreforfilter)) {
447 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
448 print $moreforfilter;
452 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
453 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
454 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
456 print
'<div class="div-table-responsive">';
457 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
462 print
'<tr class="liste_titre">';
463 foreach ($object->fields as $key => $val) {
464 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
465 if ($key ==
'status') {
466 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
467 } elseif ($key ==
'fk_parent_line') {
468 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
469 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
470 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
471 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
472 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
473 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
474 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
476 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
477 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
478 if ($key ==
'fk_parent_line') {
479 print
'<input type="text" class="flat maxwidth75" name="search_fk_parent_line">';
483 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
484 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
485 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
486 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
487 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
488 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
489 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
490 print
'<div class="nowrap">';
491 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
493 print
'<div class="nowrap">';
494 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
501 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
504 $parameters = array(
'arrayfields'=>$arrayfields);
505 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
506 print $hookmanager->resPrint;
508 print
'<td class="liste_titre maxwidthsearch">';
509 $searchpicto =
$form->showFilterButtons();
517 print
'<tr class="liste_titre">';
518 foreach ($object->fields as $key => $val) {
519 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
520 if ($key ==
'status') {
521 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
522 } elseif ($key ==
'fk_parent_line') {
523 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
524 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
525 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
526 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
527 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
528 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
529 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
531 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
532 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
536 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
538 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
539 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
540 print $hookmanager->resPrint;
542 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
547 $needToFetchEachLine = 0;
548 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
549 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
550 if (preg_match(
'/\$object/', $val)) {
551 $needToFetchEachLine++;
560 $totalarray = array();
561 $totalarray[
'nbfield'] = 0;
562 while ($i < ($limit ? min($num, $limit) : $num)) {
563 $obj = $db->fetch_object(
$resql);
569 $object->setVarsFromFetchObj($obj);
572 print
'<tr class="oddeven">';
573 foreach ($object->fields as $key => $val) {
574 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
575 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
576 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
577 } elseif ($key ==
'status') {
578 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
579 } elseif ($key ==
'fk_parent_line') {
580 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
583 if (in_array($val[
'type'], array(
'timestamp'))) {
584 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
585 } elseif ($key ==
'ref') {
586 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
589 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
590 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
593 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
594 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
595 if ($key ==
'status') {
596 print $object->getLibStatut(5);
597 } elseif ($key ==
'fk_parent_line') {
598 $moparent = $object->getMoParent();
599 if (is_object($moparent)) print $moparent->getNomUrl(1);
600 } elseif ($key ==
'rowid') {
601 print $object->showOutputField($val, $key, $object->id,
'');
603 print $object->showOutputField($val, $key, $object->$key,
'');
607 $totalarray[
'nbfield']++;
609 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
611 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
613 if (!isset($totalarray[
'val'])) {
614 $totalarray[
'val'] = array();
616 if (!isset($totalarray[
'val'][
't.'.$key])) {
617 $totalarray[
'val'][
't.'.$key] = 0;
619 $totalarray[
'val'][
't.'.$key] += $object->$key;
624 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
626 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
627 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
628 print $hookmanager->resPrint;
630 print
'<td class="nowrap center">';
631 if ($massactionbutton || $massaction) {
633 if (in_array($object->id, $arrayofselected)) {
636 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
640 $totalarray[
'nbfield']++;
649 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
655 foreach ($arrayfields as $key => $val) {
656 if (!empty($val[
'checked'])) {
660 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
666 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
667 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
668 print $hookmanager->resPrint;
670 print
'</table>'.
"\n";
673 print
'</form>'.
"\n";
675 if (in_array(
'builddoc', $arrayofmassactions) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
676 $hidegeneratedfilelistifempty = 1;
677 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
678 $hidegeneratedfilelistifempty = 0;
681 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
685 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
686 $urlsource .= str_replace(
'&',
'&', $param);
688 $filedir = $diroutputmassaction;
689 $genallowed = $permissiontoread;
690 $delallowed = $permissiontoadd;
692 print $formfile->showdocuments(
'massfilesarea_mrp',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'', null, $hidegeneratedfilelistifempty);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
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_now($mode= 'auto')
Return date for now.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring= '1')
Replace eval function to add more security.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
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...
restrictedArea($user, $features, $objectid=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.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
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_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip= '', $forcenowrapcolumntitle=0)
Get title line of an array.