32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_once __DIR__.
'/class/job.class.php';
48$langs->loadLangs(array(
'hrm',
'other'));
51$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
52$massaction =
GETPOST(
'massaction',
'alpha');
54$confirm =
GETPOST(
'confirm',
'alpha');
55$cancel =
GETPOST(
'cancel',
'alpha');
56$toselect =
GETPOST(
'toselect',
'array:int');
57$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
58$backtopage =
GETPOST(
'backtopage',
'alpha');
59$optioncss =
GETPOST(
'optioncss',
'aZ');
61$groupby =
GETPOST(
'groupby',
'aZ');
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
74$offset = $limit * $page;
81$diroutputmassaction =
$conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
82$hookmanager->initHooks(array(
'joblist'));
85$extrafields->fetch_name_optionals_label(
$object->table_element);
88$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
93 $sortfield =
"t.".key(
$object->fields);
100$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
102foreach (
$object->fields as $key => $val) {
103 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
104 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
106 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
112$fieldstosearchall = array();
114foreach (
$object->fields as $key => $val) {
115 if (!empty($val[
'searchall'])) {
116 $fieldstosearchall[
't.'.$key] = $val[
'label'];
122$arrayfields = array();
123foreach (
$object->fields as $key => $val) {
125 if (!empty($val[
'visible'])) {
126 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
127 $arrayfields[$tableprefix.
'.'.$key] = array(
128 'label' => $val[
'label'],
129 'checked' => (($visible < 0) ? 0 : 1),
130 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
131 'position' => $val[
'position'],
132 'help' => isset($val[
'help']) ? $val[
'help'] :
''
137include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
143$permissiontoread = $user->hasRight(
'hrm',
'all',
'read');
144$permissiontoadd = $user->hasRight(
'hrm',
'all',
'write');
145$permissiontodelete = $user->hasRight(
'hrm',
'all',
'delete');
148if ($user->socid > 0) {
155if (!isModEnabled(
'hrm')) {
158if (!$permissiontoread) {
168if (
GETPOST(
'cancel',
'alpha')) {
172if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
176$parameters = array(
'arrayfields' => &$arrayfields);
177$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
182if (empty($reshook)) {
184 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
188 foreach (
$object->fields as $key => $val) {
190 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
191 $search[$key.
'_dtstart'] =
'';
192 $search[$key.
'_dtend'] =
'';
197 $search_array_options = array();
199 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
200 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
205 $objectclass =
'Job';
206 $objectlabel =
'Job';
207 $uploaddir =
$conf->hrm->dir_output;
210 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
219$form =
new Form($db);
223$title = $langs->trans(
"JobsProfiles");
233$sql .=
" ".$object->getFieldList(
't');
235if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
236 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
237 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
241$parameters = array();
242$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
243$sql .= $hookmanager->resPrint;
244$sql = preg_replace(
'/,\s*$/',
'', $sql);
248$sql .=
", COUNT(ju.rowid) as nbofskills";
249$sql .=
" FROM ".$db->prefix().$object->table_element.
" as t";
250if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
251 $sql .=
" LEFT JOIN ".$db->prefix().$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
253$sql .=
" LEFT JOIN ".$db->prefix().
"hrm_job_user as ju ON ju.fk_job = t.rowid";
255$parameters = array();
256$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
257$sql .= $hookmanager->resPrint;
258if (
$object->ismultientitymanaged == 1) {
259 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
261 $sql .=
" WHERE 1 = 1";
263foreach ($search as $key => $val) {
264 if (array_key_exists($key,
$object->fields)) {
265 if ($key ==
'status' && $search[$key] == -1) {
268 $field_spec =
$object->fields[$key];
269 if ($field_spec ===
null) {
272 $mode_search = ((
$object->isInt($field_spec) ||
$object->isFloat($field_spec)) ? 1 : 0);
273 if ((strpos($field_spec[
'type'],
'integer:') === 0) || (strpos($field_spec[
'type'],
'sellist:') === 0) || !empty($field_spec[
'arrayofkeyval'])) {
274 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($field_spec[
'arrayofkeyval']) || !array_key_exists(
'0', $field_spec[
'arrayofkeyval'])))) {
279 if ($field_spec[
'type'] ===
'boolean') {
281 if ($search[$key] ==
'-1') {
285 if (empty($field_spec[
'searchmulti'])) {
286 if (!is_array($search[$key]) && $search[$key] !=
'') {
287 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
290 if (is_array($search[$key]) && !empty($search[$key])) {
291 $sql .=
natural_search(
"t.".$db->escape($key), implode(
',', $search[$key]), (($key ==
'status') ? 2 : $mode_search));
295 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
296 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
297 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
298 if (preg_match(
'/_dtstart$/', $key)) {
299 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".$db->idate($search[$key]).
"'";
301 if (preg_match(
'/_dtend$/', $key)) {
302 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".$db->idate($search[$key]).
"'";
309 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
313include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
315$parameters = array();
316$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
317$sql .= $hookmanager->resPrint;
320foreach (
$object->fields as $key => $val) {
321 $sql .=
"t.".$db->sanitize($key).
", ";
324if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
325 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
326 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
', ' :
'');
330$parameters = array();
331$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
332$sql .= $hookmanager->resPrint;
333$sql = preg_replace(
'/,\s*$/',
'', $sql);
336$nbtotalofrecords =
'';
339 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
340 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
342 $resql = $db->query($sqlforcount);
344 $objforcount = $db->fetch_object($resql);
345 $nbtotalofrecords = $objforcount->nbtotalofrecords;
350 if (($page * $limit) > $nbtotalofrecords) {
358$sql .= $db->order($sortfield, $sortorder);
360 $sql .= $db->plimit($limit + 1, $offset);
363$resql = $db->query($sql);
369$num = $db->num_rows($resql);
373if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
374 $obj = $db->fetch_object($resql);
376 header(
"Location: ".
dol_buildpath(
'/hrm/job_card.php', 1).
'?id='.((
int) $id));
384llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-hrm page-list bodyforlist');
401$arrayofselected = is_array($toselect) ? $toselect : array();
405 $param .=
'&mode='.urlencode($mode);
407if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
408 $param .=
'&contextpage='.urlencode($contextpage);
410if ($limit > 0 && $limit !=
$conf->liste_limit) {
411 $param .=
'&limit='.((int) $limit);
413if ($optioncss !=
'') {
414 $param .=
'&optioncss='.urlencode($optioncss);
417 $param .=
'&groupby='.urlencode($groupby);
419foreach ($search as $key => $val) {
420 if (is_array($search[$key])) {
421 foreach ($search[$key] as $skey) {
423 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
426 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
427 $param .=
'&search_'.$key.
'month='.
GETPOSTINT(
'search_'.$key.
'month');
428 $param .=
'&search_'.$key.
'day='.
GETPOSTINT(
'search_'.$key.
'day');
429 $param .=
'&search_'.$key.
'year='.
GETPOSTINT(
'search_'.$key.
'year');
430 } elseif ($search[$key] !=
'') {
431 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
435include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
437$parameters = array(
'param' => &$param);
438$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
439$param .= $hookmanager->resPrint;
442$arrayofmassactions = array(
448if (!empty($permissiontodelete)) {
449 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
451if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
452 $arrayofmassactions = array();
454$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
456print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
457if ($optioncss !=
'') {
458 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
460print
'<input type="hidden" name="token" value="'.newToken().
'">';
461print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
462print
'<input type="hidden" name="action" value="list">';
463print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
464print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
465print
'<input type="hidden" name="page" value="'.$page.
'">';
466print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
467print
'<input type="hidden" name="mode" value="'.$mode.
'">';
471$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'));
472$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'));
474$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/job_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
476print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
479$topicmail =
"SendJobRef";
481$objecttmp =
new Job($db);
482$trackid =
'xxxx'.$object->id;
483include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
488 foreach ($fieldstosearchall as $key => $val) {
489 $fieldstosearchall[$key] = $langs->trans($val);
490 $setupstring .= $key.
"=".$val.
";";
492 print
'<!-- Search done like if JOBPOSITION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
493 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
501$parameters = array();
502$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
503if (empty($reshook)) {
504 $moreforfilter .= $hookmanager->resPrint;
506 $moreforfilter = $hookmanager->resPrint;
509 'arrayfields' => &$arrayfields,
512if (!empty($moreforfilter)) {
513 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
514 print $moreforfilter;
518$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
519$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
520$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
521$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
523print
'<div class="div-table-responsive">';
524print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
529print
'<tr class="liste_titre_filter">';
531if (
$conf->main_checkbox_left_column) {
532 print
'<td class="liste_titre center maxwidthsearch">';
533 $searchpicto = $form->showFilterButtons(
'left');
537foreach (
$object->fields as $key => $val) {
539 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
540 if ($key ==
'status') {
541 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
542 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
543 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
544 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
545 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
546 } 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'])) {
547 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
549 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
550 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
551 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
552 if (empty($val[
'searchmulti'])) {
553 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);
555 print $form->multiselectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), 0, 0,
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
557 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
558 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
559 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
560 print
'<div class="nowrap">';
561 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
563 print
'<div class="nowrap">';
564 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
566 } elseif ($key ==
'lang') {
567 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
569 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
570 } elseif ($val[
'type'] ===
'boolean') {
571 print $form->selectyesno(
'search_' . $key, $search[$key] ??
'', 1,
false, 1);
573 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] :
'').
'">';
579include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
581$parameters = array(
'arrayfields' => $arrayfields);
582$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
583print $hookmanager->resPrint;
585print
'<td class="liste_titre"></td>';
588if (!
$conf->main_checkbox_left_column) {
589 print
'<td class="liste_titre center maxwidthsearch">';
590 $searchpicto = $form->showFilterButtons();
601print
'<tr class="liste_titre">';
603if (
$conf->main_checkbox_left_column) {
604 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
607foreach (
$object->fields as $key => $val) {
608 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
609 if ($key ==
'status') {
610 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
611 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
612 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
613 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
614 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
615 } 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'])) {
616 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
618 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
619 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
620 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";
625include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
627$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
628$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
629print $hookmanager->resPrint;
631print
'<th class="liste_titre right">'.$langs->trans(
"NbOfExpectedSkills").
'</th>';
635if (!
$conf->main_checkbox_left_column) {
636 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
643$needToFetchEachLine = 0;
644if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
645 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
646 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
647 $needToFetchEachLine++;
659$imaxinloop = ($limit ? min($num, $limit) : $num);
660while ($i < $imaxinloop) {
661 $obj = $db->fetch_object($resql);
667 $object->setVarsFromFetchObj($obj);
669 if ($mode ==
'kanban') {
670 $object->deplacement = $obj->deplacement;
671 $object->description = $obj->description;
674 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
675 print
'<div class="box-flex-container kanban">';
679 if ($massactionbutton || $massaction) {
681 if (in_array(
$object->id, $arrayofselected)) {
685 print
$object->getKanbanView(
'', array(
'selected' => $selected));
686 if ($i == ($imaxinloop - 1)) {
693 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
695 if (
$conf->main_checkbox_left_column) {
696 print
'<td class="nowrap center">';
697 if ($massactionbutton || $massaction) {
699 if (in_array(
$object->id, $arrayofselected)) {
702 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
710 foreach (
$object->fields as $key => $val) {
711 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
712 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
713 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
714 } elseif ($key ==
'status') {
715 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
718 if (in_array($val[
'type'], array(
'timestamp'))) {
719 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
720 } elseif ($key ==
'ref') {
721 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
724 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'])) {
725 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
729 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
730 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
731 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key) && !in_array($key, array(
'ref'))) {
732 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
735 if ($key ==
'status') {
736 print
$object->getLibStatut(5);
737 } elseif ($key ==
'rowid') {
738 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
739 } elseif ($key ==
'label') {
742 print
$object->showOutputField($val, $key, (
string)
$object->$key,
'');
748 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
752 if (!isset($totalarray[
'val'])) {
755 if (!isset($totalarray[
'val'][
't.'.$key])) {
763 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
765 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
766 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
767 print $hookmanager->resPrint;
772 print
'<td class="right">'.$obj->nbofskills.
'</td>';
775 if (empty(
$conf->main_checkbox_left_column)) {
776 print
'<td class="nowrap center">';
777 if ($massactionbutton || $massaction) {
779 if (in_array(
$object->id, $arrayofselected)) {
782 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
797include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
802 foreach ($arrayfields as $key => $val) {
803 if (!empty($val[
'checked'])) {
807 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
813$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
814$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
815print $hookmanager->resPrint;
817print
'</table>'.
"\n";
822if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
823 $hidegeneratedfilelistifempty = 1;
824 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
825 $hidegeneratedfilelistifempty = 0;
828 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
832 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
833 $urlsource .= str_replace(
'&',
'&', $param);
835 $filedir = $diroutputmassaction;
836 $genallowed = $permissiontoread;
837 $delallowed = $permissiontoadd;
839 print $formfile->showdocuments(
'massfilesarea_hrm',
'', $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( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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_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.
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_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...
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.