27require
'../../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/class/stocktransfer.class.php';
35$langs->loadLangs(array(
"stocks",
"other"));
38$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
39$massaction =
GETPOST(
'massaction',
'alpha');
41$confirm =
GETPOST(
'confirm',
'alpha');
42$cancel =
GETPOST(
'cancel',
'alpha');
43$toselect =
GETPOST(
'toselect',
'array');
44$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'stocktransferlist';
45$backtopage =
GETPOST(
'backtopage',
'alpha');
46$optioncss =
GETPOST(
'optioncss',
'aZ');
53$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
54$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
56if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
60$offset = $limit * $page;
67$diroutputmassaction =
getMultidirOutput($object).
'/temp/massgeneration/'.$user->id;
68$hookmanager->initHooks(array(
'stocktransferlist'));
71$extrafields->fetch_name_optionals_label(
$object->table_element);
74$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
79 $sortfield =
"t.".key(
$object->fields);
86$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
88foreach (
$object->fields as $key => $val) {
89 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
90 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
92 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
99$fieldstosearchall = array();
100foreach (
$object->fields as $key => $val) {
101 if (!empty($val[
'searchall'])) {
102 $fieldstosearchall[
't.'.$key] = $val[
'label'];
107$arrayfields = array();
108foreach (
$object->fields as $key => $val) {
110 if (!empty($val[
'visible'])) {
111 $visible = (int)
dol_eval($val[
'visible'], 1);
112 $arrayfields[
't.'.$key] = array(
113 'label' => $val[
'label'],
114 'checked' => (($visible < 0) ? 0 : 1),
115 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
116 'position' => $val[
'position'],
117 'help' => isset($val[
'help']) ? $val[
'help'] :
''
122include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
127$permissiontoread = $user->hasRight(
'stocktransfer',
'stocktransfer',
'read');
128$permissiontoadd = $user->hasRight(
'stocktransfer',
'stocktransfer',
'write');
129$permissiontodelete = $user->hasRight(
'stocktransfer',
'stocktransfer',
'delete');
132if (empty($conf->stocktransfer->enabled)) {
137if ($user->socid > 0) {
141if (!$permissiontoread) {
151if (
GETPOST(
'cancel',
'alpha')) {
155if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
159$parameters = array();
160$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
165if (empty($reshook)) {
167 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
170 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
171 foreach (
$object->fields as $key => $val) {
173 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
174 $search[$key.
'_dtstart'] =
'';
175 $search[$key.
'_dtend'] =
'';
179 $search_array_options = array();
181 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
182 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
187 $objectclass =
'StockTransfer';
188 $objectlabel =
'StockTransfer';
189 $uploaddir = $conf->stocktransfer->dir_output;
190 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
199$form =
new Form($db);
203$title = $langs->trans(
'StockTransferList');
213$sql .=
$object->getFieldList(
't');
215if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
216 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
217 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
221$parameters = array();
222$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
223$sql .= $hookmanager->resPrint;
224$sql = preg_replace(
'/,\s*$/',
'', $sql);
228$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
229if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
230 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
233$parameters = array();
234$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
235$sql .= $hookmanager->resPrint;
236if (
$object->ismultientitymanaged == 1) {
237 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
239 $sql .=
" WHERE 1 = 1";
241foreach ($search as $key => $val) {
242 if (array_key_exists($key,
$object->fields)) {
243 if ($key ==
'status' && $search[$key] == -1) {
247 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
248 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
253 if ($search[$key] !=
'') {
254 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
257 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
258 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
259 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
260 if (preg_match(
'/_dtstart$/', $key)) {
261 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
263 if (preg_match(
'/_dtend$/', $key)) {
264 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
271 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
275include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
277$parameters = array();
278$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
279$sql .= $hookmanager->resPrint;
300$nbtotalofrecords =
'';
303 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
304 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
305 $resql = $db->query($sqlforcount);
307 $objforcount = $db->fetch_object($resql);
308 $nbtotalofrecords = $objforcount->nbtotalofrecords;
313 if (($page * $limit) > $nbtotalofrecords) {
321$sql .= $db->order($sortfield, $sortorder);
323 $sql .= $db->plimit($limit + 1, $offset);
326$resql = $db->query($sql);
332$num = $db->num_rows($resql);
335if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
336 $obj = $db->fetch_object($resql);
338 header(
"Location: ".
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_card.php', 1).
'?id='.$id);
346llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist mod-product page-stock-stocktransfer_stocktransfer_list');
363$arrayofselected = is_array($toselect) ? $toselect : array();
367 $param .=
'&mode='.urlencode($mode);
369if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
370 $param .=
'&contextpage='.urlencode($contextpage);
372if ($limit > 0 && $limit != $conf->liste_limit) {
373 $param .=
'&limit='.((int) $limit);
375if ($optioncss !=
'') {
376 $param .=
'&optioncss='.urlencode($optioncss);
378foreach ($search as $key => $val) {
379 if (is_array($search[$key])) {
380 foreach ($search[$key] as $skey) {
382 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
385 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
386 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
387 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
388 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
389 } elseif ($search[$key] !=
'') {
390 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
394include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
396$parameters = array(
'param' => &$param);
397$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
398$param .= $hookmanager->resPrint;
401$arrayofmassactions = array(
407if (!empty($permissiontodelete)) {
408 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
410if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
411 $arrayofmassactions = array();
413$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
415print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
416if ($optioncss !=
'') {
417 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
419print
'<input type="hidden" name="token" value="'.newToken().
'">';
420print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
421print
'<input type="hidden" name="action" value="list">';
422print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
423print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
424print
'<input type="hidden" name="page" value="'.$page.
'">';
425print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
426print
'<input type="hidden" name="page_y" value="">';
427print
'<input type="hidden" name="mode" value="'.$mode.
'">';
430$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
432print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
435$topicmail =
"SendStockTransferRef";
436$modelmail =
"stocktransfer";
438$trackid =
'xxxx'.$object->id;
439include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
443 foreach ($fieldstosearchall as $key => $val) {
444 $fieldstosearchall[$key] = $langs->trans($val);
445 $setupstring .= $key.
"=".$val.
";";
447 print
'<!-- Search done like if STOCKTRANSFER_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
448 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
456$parameters = array();
457$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
458if (empty($reshook)) {
459 $moreforfilter .= $hookmanager->resPrint;
461 $moreforfilter = $hookmanager->resPrint;
464if (!empty($moreforfilter)) {
465 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
466 print $moreforfilter;
470$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
471$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
472$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
473$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
475print
'<div class="div-table-responsive">';
476print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
481print
'<tr class="liste_titre_filter">';
484 print
'<td class="liste_titre center maxwidthsearch">';
485 $searchpicto = $form->showFilterButtons(
'left');
489foreach (
$object->fields as $key => $val) {
490 $searchkey = empty($search[$key]) ?
'' : $search[$key];
491 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
492 if ($key ==
'status') {
493 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
494 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
495 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
496 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
497 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
498 } 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'])) {
499 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
501 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
502 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
503 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
504 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);
505 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
506 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
507 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
508 print
'<div class="nowrap">';
509 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
511 print
'<div class="nowrap">';
512 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
514 } elseif ($key ==
'lang') {
515 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
517 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
519 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
525include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
528$parameters = array(
'arrayfields'=>$arrayfields);
529$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
530print $hookmanager->resPrint;
533 print
'<td class="liste_titre center maxwidthsearch">';
534 $searchpicto = $form->showFilterButtons();
540$totalarray = array();
541$totalarray[
'nbfield'] = 0;
545print
'<tr class="liste_titre">';
548 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
549 $totalarray[
'nbfield']++;
551foreach (
$object->fields as $key => $val) {
552 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
553 if ($key ==
'status') {
554 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
555 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
556 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
557 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
558 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
559 } 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'])) {
560 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
562 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
563 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
564 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";
565 $totalarray[
'nbfield']++;
569include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
571$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
572$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
573print $hookmanager->resPrint;
576 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
577 $totalarray[
'nbfield']++;
583$needToFetchEachLine = 0;
584if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
585 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
586 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
587 $needToFetchEachLine++;
596$savnbfield = $totalarray[
'nbfield'];
597$totalarray = array();
598$totalarray[
'nbfield'] = 0;
599$imaxinloop = ($limit ? min($num, $limit) : $num);
600while ($i < $imaxinloop) {
601 $obj = $db->fetch_object($resql);
607 $object->setVarsFromFetchObj($obj);
609 if ($mode ==
'kanban') {
611 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
612 print
'<div class="box-flex-container kanban">';
616 if ($massactionbutton || $massaction) {
618 if (in_array(
$object->id, $arrayofselected)) {
623 print
$object->getKanbanView(
'', array(
'selected' => $selected));
624 if ($i == ($imaxinloop - 1)) {
631 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
635 print
'<td class="nowrap center">';
636 if ($massactionbutton || $massaction) {
638 if (in_array(
$object->id, $arrayofselected)) {
641 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
645 $totalarray[
'nbfield']++;
648 foreach (
$object->fields as $key => $val) {
649 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
650 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
651 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
652 } elseif ($key ==
'status') {
653 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
656 if (in_array($val[
'type'], array(
'timestamp'))) {
657 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
658 } elseif ($key ==
'ref') {
659 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
662 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'])) {
663 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
667 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
668 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
669 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
670 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
673 if ($key ==
'status') {
674 print
$object->getLibStatut(5);
675 } elseif ($key ==
'rowid') {
682 $totalarray[
'nbfield']++;
684 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
686 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
688 if (!isset($totalarray[
'val'])) {
689 $totalarray[
'val'] = array();
691 if (!isset($totalarray[
'val'][
't.'.$key])) {
692 $totalarray[
'val'][
't.'.$key] = 0;
694 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
699 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
701 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
702 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
703 print $hookmanager->resPrint;
706 print
'<td class="nowrap center">';
707 if ($massactionbutton || $massaction) {
709 if (in_array(
$object->id, $arrayofselected)) {
712 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
716 $totalarray[
'nbfield']++;
727include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
732 foreach ($arrayfields as $key => $val) {
733 if (!empty($val[
'checked'])) {
737 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
743$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
744$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
745print $hookmanager->resPrint;
747print
'</table>'.
"\n";
752if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
753 $hidegeneratedfilelistifempty = 1;
754 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
755 $hidegeneratedfilelistifempty = 0;
758 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
762 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
763 $urlsource .= str_replace(
'&',
'&', $param);
765 $filedir = $diroutputmassaction;
766 $genallowed = $permissiontoread;
767 $delallowed = $permissiontoadd;
769 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
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.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists( 'utf8_encode')) if(!function_exists('utf8_decode')) if(!function_exists( 'str_starts_with')) if(!function_exists('str_ends_with')) if(!function_exists( 'str_contains')) getMultidirOutput($object, $module='', $forobject=0, $mode='output')
Return the full path of the directory where a module (or an object of a module) stores its files,...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.