27require
'../main.inc.php';
37include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
38include_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39include_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41include_once __DIR__.
'/class/memo.class.php';
46$langs->loadLangs(array(
"quickmemo",
"other"));
49$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
50$massaction =
GETPOST(
'massaction',
'alpha');
52$confirm =
GETPOST(
'confirm',
'alpha');
53$cancel =
GETPOST(
'cancel',
'alpha');
54$toselect =
GETPOST(
'toselect',
'array:int');
56$backtopage =
GETPOST(
'backtopage',
'alpha');
57$optioncss =
GETPOST(
'optioncss',
'aZ');
59$groupby =
GETPOST(
'groupby',
'aZ09');
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $limit * $page;
79$diroutputmassaction =
$conf->quickmemo->dir_output.
'/temp/massgeneration/'.$user->id;
80$hookmanager->initHooks(array($contextpage));
83$extrafields->fetch_name_optionals_label(
$object->table_element);
85$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
90 $sortfield =
"t.".key(
$object->fields);
97$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
99foreach (
$object->fields as $key => $val) {
100 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
101 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
103 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
110$fieldstosearchall = array();
126$arrayfields = array();
127foreach (
$object->fields as $key => $val) {
129 if (!empty($val[
'visible'])) {
130 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
131 $arrayfields[$tableprefix.
'.'.$key] = array(
132 'label' => $val[
'label'],
133 'checked' => (($visible < 0) ?
'0' :
'1'),
134 'enabled' => (
string) (int) (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
135 'position' => $val[
'position'],
136 'help' => isset($val[
'help']) ? $val[
'help'] :
''
142include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
153$permissiontoread = $user->hasRight(
'quickmemo',
'memo',
'read');
154$permissiontoadd = $user->hasRight(
'quickmemo',
'memo',
'write');
155$permissiontodelete = $user->hasRight(
'quickmemo',
'memo',
'delete');
159if ($user->socid > 0) {
169if (!$permissiontoread) {
178if (
GETPOST(
'cancel',
'alpha')) {
182if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
186$parameters = array(
'arrayfields' => &$arrayfields);
187$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
192if (empty($reshook)) {
194 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
197 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
198 foreach (
$object->fields as $key => $val) {
200 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
201 $search[$key.
'_dtstart'] =
'';
202 $search[$key.
'_dtend'] =
'';
207 $search_array_options = array();
209 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
210 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
215 $objectclass =
'Memo';
216 $objectlabel =
'Memo';
217 $uploaddir =
$conf->quickmemo->dir_output;
220 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
225 if ($massaction ===
'unarchive') {
226 if (!empty($toselect)) {
227 $countUnarchived = 0;
228 foreach ($toselect as $idMemo) {
231 if ($selectdModel->fetch($idMemo) <= 0) {
232 $idMemo = (int) $idMemo;
233 setEventMessage($langs->trans(
'QuickMemoLoadMemosError').
' : '. (
int) $idMemo,
'errors');
237 if ($selectdModel->status !== Memo::STATUS_ARCHIVED) {
238 setEventMessage($langs->trans(
'QuickMemoCantChangeThisPrivateNote').
' : '. (
int) $idMemo,
'errors');
242 if ($user->id != $selectdModel->fk_user_creat && $selectdModel->private_tpl) {
243 setEventMessage($langs->trans(
'QuickMemoCantChangeThisPrivateNote').
' : '. (
int) $idMemo,
'errors');
247 if ($selectdModel->setUnArchived($user) <= 0) {
248 setEventMessage($langs->trans(
'QuickMemoUnArchiveError').
' : '. (
int) $idMemo,
'errors');
255 if ($countUnarchived>0) {
256 setEventMessage($langs->trans($countUnarchived > 1 ?
'QuickMemoUnArchiveCount' :
'QuickMemoUnArchived', $countUnarchived));
259 setEventMessage($langs->trans(
'PleaseSelectAtLeastOneRow'),
'warnings');
274$title = $langs->trans(
"Memos");
279 'quickmemo/css/memo.css'
286$sql .=
" ".$object->getFieldList(
't');
288if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
289 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
290 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
294$parameters = array();
295$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
296$sql .= $hookmanager->resPrint;
297$sql = preg_replace(
'/,\s*$/',
'', $sql);
301$sql .=
" FROM ".$db->prefix().$object->table_element.
" as t";
303if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
304 $sql .=
" LEFT JOIN ".$db->prefix().$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
307$parameters = array();
308$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
309$sql .= $hookmanager->resPrint;
311if (!empty(
$object->ismultientitymanaged) && (
int)
$object->ismultientitymanaged == 1) {
312 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
313} elseif (preg_match(
'/^\w+@\w+$/', (
string)
$object->ismultientitymanaged)) {
314 $tmparray = explode(
'@', (
string)
$object->ismultientitymanaged);
315 $sql .=
" LEFT JOIN ".$object->db->prefix().$tmparray[1].
" as pt ON t.".
$db->sanitize($tmparray[0]).
" = pt.rowid";
316 $sql .=
" WHERE pt.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
318 $sql .=
" WHERE 1 = 1";
321$sql .=
' AND ('.implode(
' OR ', [
322 '( t.status = '.Memo::STATUS_ARCHIVED.
' AND t.private = 0 OR t.fk_user_creat = '.(
int) $user->id.
' )',
323 '( t.status = '.Memo::STATUS_VALIDATED.
' AND t.private = 0 OR t.fk_user_creat = '.(
int) $user->id.
' )',
324 '( t.status = '.Memo::STATUS_TPL.
' AND t.private_tpl = 0 OR t.fk_user_creat = '.(
int) $user->id.
' )',
330foreach ($search as $key => $val) {
331 if (array_key_exists($key,
$object->fields)) {
332 if ($key ==
'status' && $search[$key] == -1) {
336 if (empty(
$object->fields[$key])) {
340 $field_spec =
$object->fields[$key];
341 $mode_search = ((
$object->isInt($field_spec) ||
$object->isFloat($field_spec)) ? 1 : 0);
342 if ((strpos($field_spec[
'type'],
'integer:') === 0) || (strpos($field_spec[
'type'],
'sellist:') === 0) || !empty($field_spec[
'arrayofkeyval'])) {
343 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($field_spec[
'arrayofkeyval']) || !array_key_exists(
'0', $field_spec[
'arrayofkeyval'])))) {
348 if ($field_spec[
'type'] ===
'boolean') {
350 if ($search[$key] ==
'-1') {
354 if (empty($field_spec[
'searchmulti'])) {
355 if (!is_array($search[$key]) && $search[$key] !=
'') {
356 $sql .=
natural_search(
"t.".
$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
359 if (is_array($search[$key]) && !empty($search[$key])) {
360 $sql .=
natural_search(
"t.".
$db->escape($key), implode(
',', $search[$key]), (($key ==
'status') ? 2 : $mode_search));
364 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
365 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
366 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
367 if (preg_match(
'/_dtstart$/', $key)) {
368 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate($search[$key]).
"'";
370 if (preg_match(
'/_dtend$/', $key)) {
371 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".
$db->idate($search[$key]).
"'";
378 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
401include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
403$parameters = array();
404$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
405$sql .= $hookmanager->resPrint;
442$nbtotalofrecords =
'';
445 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
446 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
448 $resql =
$db->query($sqlforcount);
450 $objforcount =
$db->fetch_object($resql);
451 $nbtotalofrecords = $objforcount->nbtotalofrecords;
456 if (($page * $limit) > (
int) $nbtotalofrecords) {
464$sql .=
$db->order($sortfield, $sortorder);
466 $sql .=
$db->plimit($limit + 1, $offset);
469$resql =
$db->query($sql);
475$num =
$db->num_rows($resql);
479if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
480 $obj =
$db->fetch_object($resql);
482 header(
"Location: ".
dol_buildpath(
'/quickmemo/memo_card.php', 1).
'?id='.((
int) $id));
490llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-quickmemo page-list bodyforlist');
492$arrayofselected = is_array($toselect) ? $toselect : array();
496 $param .=
'&mode='.urlencode($mode);
499 $param .=
'&contextpage='.urlencode($contextpage);
501if ($limit > 0 && $limit !=
$conf->liste_limit) {
502 $param .=
'&limit='.((int) $limit);
504if ($optioncss !=
'') {
505 $param .=
'&optioncss='.urlencode($optioncss);
508 $param .=
'&groupby='.urlencode($groupby);
510foreach ($search as $key => $val) {
511 if (is_array($search[$key])) {
512 foreach ($search[$key] as $skey) {
514 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
517 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
518 $param .=
'&search_'.$key.
'month='.
GETPOSTINT(
'search_'.$key.
'month');
519 $param .=
'&search_'.$key.
'day='.
GETPOSTINT(
'search_'.$key.
'day');
520 $param .=
'&search_'.$key.
'year='.
GETPOSTINT(
'search_'.$key.
'year');
521 } elseif ($search[$key] !=
'') {
522 $param .=
'&search_'.$key.
'='.urlencode((
string) $search[$key]);
526include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
528$parameters = array(
'param' => &$param);
529$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
530$param .= $hookmanager->resPrint;
533$arrayofmassactions = array(
534 'unarchive'=> $langs->trans(
"UnarchiveMemo"),
539if (!empty($permissiontodelete)) {
540 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
542if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
543 $arrayofmassactions = array();
545$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
547print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
548if ($optioncss !=
'') {
549 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
551print
'<input type="hidden" name="token" value="'.newToken().
'">';
552print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
553print
'<input type="hidden" name="action" value="list">';
554print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
555print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
556print
'<input type="hidden" name="page" value="'.$page.
'">';
557print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
558print
'<input type="hidden" name="page_y" value="">';
559print
'<input type="hidden" name="mode" value="'.$mode.
'">';
563$newcardbutton .= dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
564$newcardbutton .= dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
570print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
573$topicmail =
"SendMemoRef";
576$trackid =
'xxxx'.$object->id;
577include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
582 foreach ($fieldstosearchall as $key => $val) {
583 $fieldstosearchall[$key] = $langs->trans($val);
584 $setupstring .= $key.
"=".$val.
";";
586 print
'<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
587 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
595$parameters = array();
596$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
597if (empty($reshook)) {
598 $moreforfilter .= $hookmanager->resPrint;
600 $moreforfilter = $hookmanager->resPrint;
603 'arrayfields' => &$arrayfields,
606if (!empty($moreforfilter)) {
607 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
608 print $moreforfilter;
612$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
613$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
614$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
615$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
617print
'<div class="div-table-responsive">';
618print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
622print
'<tr class="liste_titre_filter">';
624if (
$conf->main_checkbox_left_column) {
625 print
'<td class="liste_titre center maxwidthsearch">';
626 $searchpicto = $form->showFilterButtons(
'left');
630foreach (
$object->fields as $key => $val) {
632 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
633 if ($key ==
'status') {
634 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
635 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
636 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
637 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
638 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
639 } 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'])) {
640 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
642 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
643 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
644 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
645 if (empty($val[
'searchmulti'])) {
646 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);
648 print $form->multiselectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), 0, 0,
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
650 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
651 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
652 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
653 print
'<div class="nowrap">';
654 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
656 print
'<div class="nowrap">';
657 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
659 } elseif ($key ==
'lang') {
660 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
662 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
663 } elseif ($val[
'type'] ===
'boolean') {
664 print $form->selectyesno(
'search_' . $key, $search[$key] ??
'', 1,
false, 1);
666 print
'<input type="text" class="flat maxwidth'.(in_array($val[
'type'], array(
'integer',
'price')) ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
672include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
675$parameters = array(
'arrayfields' => $arrayfields);
676$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
677print $hookmanager->resPrint;
682if (!
$conf->main_checkbox_left_column) {
683 print
'<td class="liste_titre center maxwidthsearch">';
684 $searchpicto = $form->showFilterButtons();
695print
'<tr class="liste_titre">';
697if (
$conf->main_checkbox_left_column) {
698 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
701foreach (
$object->fields as $key => $val) {
702 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
703 if ($key ==
'status') {
704 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
705 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
706 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
707 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
708 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
709 } 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'])) {
710 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
712 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
713 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
714 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";
719include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
721$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
722$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
723print $hookmanager->resPrint;
729if (!
$conf->main_checkbox_left_column) {
730 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
736$needToFetchEachLine = 0;
737if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
738 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
739 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
740 $needToFetchEachLine++;
752$imaxinloop = ($limit ? min($num, $limit) : $num);
753while ($i < $imaxinloop) {
754 $obj =
$db->fetch_object($resql);
760 $object->setVarsFromFetchObj($obj);
776 if ($mode ==
'kanban' || $mode ==
'kanbangroupby') {
778 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
779 print
'<div class="box-flex-container kanban">';
783 if ($massactionbutton || $massaction) {
785 if (in_array(
$object->id, $arrayofselected)) {
790 print
$object->getKanbanView(
'', array(
'selected' => $selected));
791 if ($i == ($imaxinloop - 1)) {
798 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
801 if (
$conf->main_checkbox_left_column) {
802 print
'<td class="nowrap center">';
803 if ($massactionbutton || $massaction) {
805 if (in_array(
$object->id, $arrayofselected)) {
808 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
816 foreach (
$object->fields as $key => $val) {
817 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
818 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
819 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
820 } elseif ($key ==
'status') {
821 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
824 if (in_array($val[
'type'], array(
'timestamp'))) {
825 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
826 } elseif ($key ==
'ref') {
827 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
830 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'])) {
831 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
835 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
836 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
837 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key) && !in_array($key, array(
'ref'))) {
838 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
841 if ($key ==
'status') {
842 print
$object->getLibStatut(5);
843 } elseif ($key ==
'rowid') {
844 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
846 if ($val[
'type'] ==
'html') {
847 print
'<div class="small lineheightsmall twolinesmax-normallineheight">';
849 print
$object->showOutputField($val, $key, (
string)
$object->$key,
'');
850 if ($val[
'type'] ==
'html') {
858 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
862 if (!isset($totalarray[
'val'])) {
865 if (!isset($totalarray[
'val'][
't.'.$key])) {
873 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
875 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
876 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
877 print $hookmanager->resPrint;
884 if (empty(
$conf->main_checkbox_left_column)) {
885 print
'<td class="nowrap center">';
886 if ($massactionbutton || $massaction) {
888 if (in_array(
$object->id, $arrayofselected)) {
891 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
906include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
911 foreach ($arrayfields as $key => $val) {
912 if (!empty($val[
'checked'])) {
916 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
922$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
923$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
924print $hookmanager->resPrint;
926print
'</table>'.
"\n";
931if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
932 $hidegeneratedfilelistifempty = 1;
933 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
934 $hidegeneratedfilelistifempty = 0;
937 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
941 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
942 $urlsource .= str_replace(
'&',
'&', $param);
944 $filedir = $diroutputmassaction;
945 $genallowed = $permissiontoread;
946 $delallowed = $permissiontoadd;
948 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
getDolDefaultContextPage($s)
Return the default context page string.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.