26require
'../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/compta/cashcontrol/class/cashcontrol.class.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';
33$langs->loadLangs(array(
"banks",
"other"));
35$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
36$massaction =
GETPOST(
'massaction',
'alpha');
38$confirm =
GETPOST(
'confirm',
'alpha');
39$cancel =
GETPOST(
'cancel',
'alpha');
40$toselect =
GETPOST(
'toselect',
'array');
41$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'cashcontrol';
42$backtopage =
GETPOST(
'backtopage',
'alpha');
43$optioncss =
GETPOST(
'optioncss',
'aZ');
44$mode =
GETPOST(
'mode',
'alpha');
49$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
50$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
52if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
56$offset = $limit * $page;
66$hookmanager->initHooks(array(
'cashcontrol'));
69$extrafields->fetch_name_optionals_label(
$object->table_element);
72$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
77 $sortfield =
"t.".key(
$object->fields);
84$search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
86foreach (
$object->fields as $key => $val) {
87 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
88 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
90 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
97$fieldstosearchall = array();
98foreach (
$object->fields as $key => $val) {
99 if (!empty($val[
'searchall'])) {
100 $fieldstosearchall[
't.'.$key] = $val[
'label'];
105$arrayfields = array();
106foreach (
$object->fields as $key => $val) {
108 if (!empty($val[
'visible'])) {
109 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
110 $arrayfields[
't.'.$key] = array(
111 'label'=>$val[
'label'],
112 'checked'=>(($visible < 0) ? 0 : 1),
113 'enabled'=>(abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
114 'position'=>$val[
'position'],
115 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
120include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
125$permissiontoread = ($user->hasRight(
'cashdesk',
'run') || $user->hasRight(
'takepos',
'run'));
126$permissiontoadd = ($user->hasRight(
'cashdesk',
'run') || $user->hasRight(
'takepos',
'run'));
127$permissiontodelete = ($user->hasRight(
'cashdesk',
'run') || $user->hasRight(
'takepos',
'run'));
130if ($user->socid > 0) {
134if (!$user->hasRight(
'cashdesk',
'run') && !$user->hasRight(
'takepos',
'run')) {
143if (
GETPOST(
'cancel',
'alpha')) {
147if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
151$parameters = array();
152$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
157if (empty($reshook)) {
159 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
162 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
163 foreach (
$object->fields as $key => $val) {
165 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
166 $search[$key.
'_dtstart'] =
'';
167 $search[$key.
'_dtend'] =
'';
171 $search_array_options = array();
173 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
174 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
179 $objectclass =
'CashControl';
180 $objectlabel =
'CashControl';
181 $uploaddir = $conf->bank->dir_output;
182 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
191$form =
new Form($db);
197$title = $langs->trans(
'CashControl');
204$sql .=
$object->getFieldList(
't');
206if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
207 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
208 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
212$parameters = array();
213$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
214$sql .= $hookmanager->resPrint;
215$sql = preg_replace(
'/,\s*$/',
'', $sql);
219$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
220if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
221 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
224$parameters = array();
225$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
226$sql .= $hookmanager->resPrint;
227if (
$object->ismultientitymanaged == 1) {
228 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
230 $sql .=
" WHERE 1 = 1";
232foreach ($search as $key => $val) {
233 if (array_key_exists($key,
$object->fields)) {
234 if ($key ==
'status' && $search[$key] == -1) {
238 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
239 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
244 if ($search[$key] !=
'') {
245 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
248 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
249 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
250 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
251 if (preg_match(
'/_dtstart$/', $key)) {
252 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
254 if (preg_match(
'/_dtend$/', $key)) {
255 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
262 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
266include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
268$parameters = array();
269$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
270$sql .= $hookmanager->resPrint;
292$nbtotalofrecords =
'';
295 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
296 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
297 $resql = $db->query($sqlforcount);
299 $objforcount = $db->fetch_object($resql);
300 $nbtotalofrecords = $objforcount->nbtotalofrecords;
305 if (($page * $limit) > $nbtotalofrecords) {
313$sql .= $db->order($sortfield, $sortorder);
315 $sql .= $db->plimit($limit + 1, $offset);
318$resql = $db->query($sql);
324$num = $db->num_rows($resql);
328if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
329 $obj = $db->fetch_object($resql);
331 header(
"Location: ".DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.$id);
339llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'classforhorizontalscrolloftabs');
341$arrayofselected = is_array($toselect) ? $toselect : array();
345 $param .=
'&mode='.urlencode($mode);
347if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
348 $param .=
'&contextpage='.urlencode($contextpage);
350if ($limit > 0 && $limit != $conf->liste_limit) {
351 $param .=
'&limit='.((int) $limit);
353foreach ($search as $key => $val) {
354 if (is_array($search[$key])) {
355 foreach ($search[$key] as $skey) {
357 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
360 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
361 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
362 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
363 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
364 } elseif ($search[$key] !=
'') {
365 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
368if ($optioncss !=
'') {
369 $param .=
'&optioncss='.urlencode($optioncss);
372include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
374$parameters = array(
'param' => &$param);
375$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
376$param .= $hookmanager->resPrint;
379$arrayofmassactions = array();
380if (!empty($permissiontodelete)) {
381 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
383$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
385print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
386if ($optioncss !=
'') {
387 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
389print
'<input type="hidden" name="token" value="'.newToken().
'">';
390print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
391print
'<input type="hidden" name="action" value="list">';
392print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
393print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
394print
'<input type="hidden" name="page" value="'.$page.
'">';
395print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
396print
'<input type="hidden" name="mode" value="'.$mode.
'">';
398$permforcashfence = 1;
401$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'));
402$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'));
404$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permforcashfence);
406print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'cash-register', 0, $newcardbutton,
'', $limit, 0, 0, 1);
409$topicmail =
"SendCashControlRef";
410$modelmail =
"cashcontrol";
412$trackid =
'cashfence'.$object->id;
413include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
417 foreach ($fieldstosearchall as $key => $val) {
418 $fieldstosearchall[$key] = $langs->trans($val);
419 $setupstring .= $key.
"=".$val.
";";
421 print
'<!-- Search done like if BOOKCAL_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
422 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
430$parameters = array();
431$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
432if (empty($reshook)) {
433 $moreforfilter .= $hookmanager->resPrint;
435 $moreforfilter = $hookmanager->resPrint;
438if (!empty($moreforfilter)) {
439 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
440 print $moreforfilter;
444$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
445$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
446$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
448print
'<div class="div-table-responsive">';
449print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
454print
'<tr class="liste_titre">';
457 print
'<td class="liste_titre maxwidthsearch">';
458 $searchpicto = $form->showFilterButtons(
'left');
462foreach (
$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 (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
468 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
469 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
470 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
471 } 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'])) {
472 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
474 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
475 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
476 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
477 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);
478 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
479 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
480 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
481 print
'<div class="nowrap">';
482 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
484 print
'<div class="nowrap">';
485 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
487 } elseif ($key ==
'lang') {
488 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
490 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
492 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
498include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
501$parameters = array(
'arrayfields'=>$arrayfields);
502$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
503print $hookmanager->resPrint;
506 print
'<td class="liste_titre maxwidthsearch">';
507 $searchpicto = $form->showFilterButtons();
514$totalarray = array();
515$totalarray[
'nbfield'] = 0;
519print
'<tr class="liste_titre">';
522 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
523 $totalarray[
'nbfield']++;
525foreach (
$object->fields as $key => $val) {
526 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
527 if ($key ==
'status') {
528 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
529 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
530 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
531 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
532 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
533 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
534 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
536 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
537 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
538 $totalarray[
'nbfield']++;
542include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
544$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
545$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
546print $hookmanager->resPrint;
549 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
550 $totalarray[
'nbfield']++;
556$needToFetchEachLine = 0;
557if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
558 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
559 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
560 $needToFetchEachLine++;
569$savnbfield = $totalarray[
'nbfield'];
570$totalarray = array();
571$totalarray[
'nbfield'] = 0;
572while ($i < ($limit ? min($num, $limit) : $num)) {
573 $obj = $db->fetch_object($resql);
579 $object->setVarsFromFetchObj($obj);
582 if ($mode ==
'kanban') {
584 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
585 print
'<div class="box-flex-container kanban">';
588 $object->posmodule = $obj->posmodule;
590 $object->cheque = $obj->cheque;
592 $object->opening = $obj->opening;
593 $object->year_close = $obj->year_close;
597 if ($massactionbutton || $massaction) {
599 if (in_array(
$object->id, $arrayofselected)) {
603 print
$object->getKanbanView(
'', array(
'selected' => $selected));
604 if ($i == (min($num, $limit) - 1)) {
611 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
615 print
'<td class="nowrap center">';
616 if ($massactionbutton || $massaction) {
618 if (in_array(
$object->id, $arrayofselected)) {
621 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
626 foreach (
$object->fields as $key => $val) {
627 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
628 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
629 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
630 } elseif ($key ==
'status') {
631 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
634 if (in_array($val[
'type'], array(
'timestamp'))) {
635 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
636 } elseif ($key ==
'ref') {
637 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
640 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
641 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
645 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
646 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
647 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
648 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
651 if ($key ==
'status') {
652 print
$object->getLibStatut(5);
653 } elseif ($key ==
'rowid') {
660 $totalarray[
'nbfield']++;
662 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
664 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
666 if (!isset($totalarray[
'val'])) {
667 $totalarray[
'val'] = array();
669 if (!isset($totalarray[
'val'][
't.'.$key])) {
670 $totalarray[
'val'][
't.'.$key] = 0;
672 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
677 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
679 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
680 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
681 print $hookmanager->resPrint;
684 print
'<td class="nowrap center">';
685 if ($massactionbutton || $massaction) {
687 if (in_array(
$object->id, $arrayofselected)) {
690 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
695 $totalarray[
'nbfield']++;
704include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
710 foreach ($arrayfields as $key => $val) {
711 if (!empty($val[
'checked'])) {
715 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
720$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
721$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
722print $hookmanager->resPrint;
724print
'</table>'.
"\n";
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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage cash fence.
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)
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_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 a 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.