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') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'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 ($key ==
'status') {
180 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
181 $search[$key.
'_dtstart'] =
'';
182 $search[$key.
'_dtend'] =
'';
186 $search_array_options = array();
188 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
189 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
196 $uploaddir = $conf->mrp->dir_output;
197 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
212 $title = $langs->trans(
'ListOfManufacturingOrders');
220 $sql .= $object->getFieldList(
't');
222 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
223 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
224 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
228 $parameters = array();
229 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
230 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
231 $sql = preg_replace(
'/,\s*$/',
'', $sql);
232 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
233 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
234 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
236 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
237 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
239 $parameters = array();
240 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
241 $sql .= $hookmanager->resPrint;
242 if ($object->ismultientitymanaged == 1) {
243 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
245 $sql .=
" WHERE 1 = 1";
248 foreach ($search as $key => $val) {
249 if (array_key_exists($key, $object->fields)) {
250 if ($key ==
'status' && $search[$key] == -1) {
253 if ($key ==
'fk_parent_line' && $search[$key] !=
'') {
258 if ($key ==
'status') {
264 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
265 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
266 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
271 if ($search[$key] !=
'') {
272 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
275 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
276 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
277 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
278 if (preg_match(
'/_dtstart$/', $key)) {
279 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
281 if (preg_match(
'/_dtend$/', $key)) {
282 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
289 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
293 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
295 $parameters = array();
296 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
297 $sql .= $hookmanager->resPrint;
317 $sql .= $db->order($sortfield, $sortorder);
320 $nbtotalofrecords =
'';
321 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
322 $resql = $db->query($sql);
323 $nbtotalofrecords = $db->num_rows(
$resql);
324 if (($page * $limit) > $nbtotalofrecords) {
330 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
331 $num = $nbtotalofrecords;
334 $sql .= $db->plimit($limit + 1, $offset);
337 $resql = $db->query($sql);
343 $num = $db->num_rows(
$resql);
347 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
348 $obj = $db->fetch_object(
$resql);
350 header(
"Location: ".
dol_buildpath(
'/mrp/mo_card.php', 1).
'?id='.$id);
361 $arrayofselected = is_array($toselect) ? $toselect : array();
364 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
365 $param .=
'&contextpage='.urlencode($contextpage);
367 if ($limit > 0 && $limit != $conf->liste_limit) {
368 $param .=
'&limit='.urlencode($limit);
370 foreach ($search as $key => $val) {
371 if (is_array($search[$key]) && count($search[$key])) {
372 foreach ($search[$key] as $skey) {
374 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
377 } elseif ($search[$key] !=
'') {
378 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
381 if ($optioncss !=
'') {
382 $param .=
'&optioncss='.urlencode($optioncss);
385 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
387 $parameters = array();
388 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
389 $param .= $hookmanager->resPrint;
392 $arrayofmassactions = array(
398 if ($permissiontodelete) {
399 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
401 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
402 $arrayofmassactions = array();
404 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
406 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
407 if ($optioncss !=
'') {
408 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
410 print
'<input type="hidden" name="token" value="'.newToken().
'">';
411 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
412 print
'<input type="hidden" name="action" value="list">';
413 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
414 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
415 print
'<input type="hidden" name="page" value="'.$page.
'">';
416 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
418 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
420 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
423 $topicmail =
"SendMoRef";
425 $objecttmp =
new Mo($db);
426 $trackid =
'mo'.$object->id;
427 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
430 foreach ($fieldstosearchall as $key => $val) {
431 $fieldstosearchall[$key] = $langs->trans($val);
433 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
441 $parameters = array();
442 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
443 if (empty($reshook)) {
444 $moreforfilter .= $hookmanager->resPrint;
446 $moreforfilter = $hookmanager->resPrint;
449 if (!empty($moreforfilter)) {
450 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
451 print $moreforfilter;
455 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
456 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
457 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
459 print
'<div class="div-table-responsive">';
460 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
465 print
'<tr class="liste_titre">';
466 foreach ($object->fields as $key => $val) {
467 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
468 if ($key ==
'status') {
469 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
470 } elseif ($key ==
'fk_parent_line') {
471 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
472 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
473 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
474 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
475 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
476 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
477 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
479 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
480 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
481 if ($key ==
'fk_parent_line') {
482 print
'<input type="text" class="flat maxwidth75" name="search_fk_parent_line">';
486 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
487 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
488 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
489 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
490 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
491 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
492 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
493 print
'<div class="nowrap">';
494 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
496 print
'<div class="nowrap">';
497 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
504 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
507 $parameters = array(
'arrayfields'=>$arrayfields);
508 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
509 print $hookmanager->resPrint;
511 print
'<td class="liste_titre maxwidthsearch">';
512 $searchpicto =
$form->showFilterButtons();
520 print
'<tr class="liste_titre">';
521 foreach ($object->fields as $key => $val) {
522 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
523 if ($key ==
'status') {
524 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
525 } elseif ($key ==
'fk_parent_line') {
526 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
527 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
528 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
529 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
530 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
531 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
532 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
534 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
535 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
539 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
541 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
542 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
543 print $hookmanager->resPrint;
545 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
550 $needToFetchEachLine = 0;
551 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
552 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
553 if (preg_match(
'/\$object/', $val)) {
554 $needToFetchEachLine++;
563 $totalarray = array();
564 $totalarray[
'nbfield'] = 0;
565 while ($i < ($limit ? min($num, $limit) : $num)) {
566 $obj = $db->fetch_object(
$resql);
572 $object->setVarsFromFetchObj($obj);
575 print
'<tr class="oddeven">';
576 foreach ($object->fields as $key => $val) {
577 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
578 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
579 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
580 } elseif ($key ==
'status') {
581 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
582 } elseif ($key ==
'fk_parent_line') {
583 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
586 if (in_array($val[
'type'], array(
'timestamp'))) {
587 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
588 } elseif ($key ==
'ref') {
589 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
592 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
593 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
596 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
597 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
598 if ($key ==
'status') {
599 print $object->getLibStatut(5);
600 } elseif ($key ==
'fk_parent_line') {
601 $moparent = $object->getMoParent();
602 if (is_object($moparent)) print $moparent->getNomUrl(1);
603 } elseif ($key ==
'rowid') {
604 print $object->showOutputField($val, $key, $object->id,
'');
606 print $object->showOutputField($val, $key, $object->$key,
'');
610 $totalarray[
'nbfield']++;
612 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
614 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
616 if (!isset($totalarray[
'val'])) {
617 $totalarray[
'val'] = array();
619 if (!isset($totalarray[
'val'][
't.'.$key])) {
620 $totalarray[
'val'][
't.'.$key] = 0;
622 $totalarray[
'val'][
't.'.$key] += $object->$key;
627 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
629 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
630 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
631 print $hookmanager->resPrint;
633 print
'<td class="nowrap center">';
634 if ($massactionbutton || $massaction) {
636 if (in_array($object->id, $arrayofselected)) {
639 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
643 $totalarray[
'nbfield']++;
652 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
658 foreach ($arrayfields as $key => $val) {
659 if (!empty($val[
'checked'])) {
663 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
669 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
670 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
671 print $hookmanager->resPrint;
673 print
'</table>'.
"\n";
676 print
'</form>'.
"\n";
678 if (in_array(
'builddoc', $arrayofmassactions) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
679 $hidegeneratedfilelistifempty = 1;
680 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
681 $hidegeneratedfilelistifempty = 0;
684 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
688 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
689 $urlsource .= str_replace(
'&',
'&', $param);
691 $filedir = $diroutputmassaction;
692 $genallowed = $permissiontoread;
693 $delallowed = $permissiontoadd;
695 print $formfile->showdocuments(
'massfilesarea_mrp',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);