32require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/hrm/class/job.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/hrm/class/position.class.php';
49$langs->loadLangs(array(
'hrm',
'other'));
52$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'positionlist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
75$offset = $limit * $page;
82$userstatic =
new User($db);
83$diroutputmassaction =
$conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
84$hookmanager->initHooks(array($contextpage));
87$extrafields->fetch_name_optionals_label(
$object->table_element);
90$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
95 $sortfield =
"t.".key(
$object->fields);
102$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
104foreach (
$object->fields as $key => $val) {
105 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
106 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
108 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
115$fieldstosearchall = array();
116foreach (
$object->fields as $key => $val) {
117 if (!empty($val[
'searchall'])) {
118 $fieldstosearchall[
't.'.$key] = $val[
'label'];
124$arrayfields = array();
125foreach (
$object->fields as $key => $val) {
127 if (!empty($val[
'visible'])) {
128 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
129 $arrayfields[$tableprefix.
'.'.$key] = array(
130 'label' => $val[
'label'],
131 'checked' => (($visible < 0) ? 0 : 1),
132 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
133 'position' => $val[
'position'],
134 'help' => isset($val[
'help']) ? $val[
'help'] :
''
139include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
145$permissiontoread = $user->hasRight(
'hrm',
'all',
'read');
146$permissiontoadd = $user->hasRight(
'hrm',
'all',
'write');
147$permissiontodelete = $user->hasRight(
'hrm',
'all',
'delete');
150if ($user->socid > 0) {
157if (!isModEnabled(
'hrm')) {
160if (!$permissiontoread) {
170if (
GETPOST(
'cancel',
'alpha')) {
174if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
178$parameters = array(
'arrayfields' => &$arrayfields);
179$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
184if (empty($reshook)) {
186 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
189 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
190 foreach (
$object->fields as $key => $val) {
192 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
193 $search[$key.
'_dtstart'] =
'';
194 $search[$key.
'_dtend'] =
'';
199 $search_array_options = array();
201 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
202 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
207 $objectclass =
'Position';
208 $objectlabel =
'Position';
209 $uploaddir =
$conf->hrm->dir_output;
210 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
219$form =
new Form($db);
220$jobstatic =
new Job($db);
224$title = $langs->trans(
'EmployeePositions');
234$sql .=
$object->getFieldList(
't');
236$sql .= $userstatic->getFieldList(
'u', array(
'rowid'));
237$sql .=
', u.email, u.statut, u.photo, u.login';
238$sql .=
', j.rowid as job_id, j.label as job_label';
240if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
241 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
242 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
246$parameters = array();
247$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
248$sql .= $hookmanager->resPrint;
249$sql = preg_replace(
'/,\s*$/',
'', $sql);
253$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t LEFT JOIN ".MAIN_DB_PREFIX.$userstatic->table_element.
" as u on t.fk_user = u.rowid, ".MAIN_DB_PREFIX.
"hrm_job as j";
256if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
257 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
260$parameters = array();
261$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
262$sql .= $hookmanager->resPrint;
263if (
$object->ismultientitymanaged == 1) {
264 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
266 $sql .=
" WHERE 1 = 1";
268$sql .=
" AND t.fk_job = j.rowid";
269foreach ($search as $key => $val) {
270 if (array_key_exists($key,
$object->fields)) {
271 if ($key ==
'status' && $search[$key] == -1) {
275 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
276 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
281 if (empty(
$object->fields[$key][
'searchmulti'])) {
282 if (!is_array($search[$key]) && $search[$key] !=
'') {
283 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
286 if (is_array($search[$key]) && !empty($search[$key])) {
287 $sql .=
natural_search(
"t.".$db->escape($key), implode(
',', $search[$key]), (($key ==
'status') ? 2 : $mode_search));
291 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
292 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
293 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
294 if (preg_match(
'/_dtstart$/', $key)) {
295 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".$db->idate($search[$key]).
"'";
297 if (preg_match(
'/_dtend$/', $key)) {
298 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".$db->idate($search[$key]).
"'";
304$vacant =
GETPOST(
'search_fk_uservacant',
'alphanohtml') ===
'on';
306 $sql .=
' AND t.fk_user = 0';
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;
338$nbtotalofrecords =
'';
341 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
342 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
344 $resql = $db->query($sqlforcount);
346 $objforcount = $db->fetch_object($resql);
347 $nbtotalofrecords = $objforcount->nbtotalofrecords;
352 if (($page * $limit) > $nbtotalofrecords) {
360$sql .= $db->order($sortfield, $sortorder);
362 $sql .= $db->plimit($limit + 1, $offset);
365$resql = $db->query($sql);
371$num = $db->num_rows($resql);
375if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
376 $obj = $db->fetch_object($resql);
378 header(
"Location: ".
dol_buildpath(
'/hrm/position.php', 1).
'?id='.$id);
386llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
403$arrayofselected = is_array($toselect) ? $toselect : array();
407 $param .=
'&mode='.urlencode($mode);
409if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
410 $param .=
'&contextpage='.urlencode($contextpage);
412if ($limit > 0 && $limit !=
$conf->liste_limit) {
413 $param .=
'&limit='.((int) $limit);
415if ($optioncss !=
'') {
416 $param .=
'&optioncss='.urlencode($optioncss);
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="page_y" value="">';
468print
'<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/position.php', 1).
'?action=create',
'', $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 =
"SendPositionRef";
480$modelmail =
"position";
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;
509if (!empty($moreforfilter)) {
510 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
511 print $moreforfilter;
515$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
516$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
517$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
518$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
520print
'<div class="div-table-responsive">';
521print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
524$totalarray = array();
525$totalarray[
'nbfield'] = 0;
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);
571 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] :
'').
'">';
577include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
580$parameters = array(
'arrayfields' => $arrayfields);
581$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
582print $hookmanager->resPrint;
584if (!
$conf->main_checkbox_left_column) {
585 print
'<td class="liste_titre center maxwidthsearch">';
586 $searchpicto = $form->showFilterButtons();
592$totalarray = array();
593$totalarray[
'nbfield'] = 0;
597print
'<tr class="liste_titre">';
599if (
$conf->main_checkbox_left_column) {
600 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
601 $totalarray[
'nbfield']++;
603foreach (
$object->fields as $key => $val) {
604 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
605 if ($key ==
'status') {
606 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
607 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
608 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
609 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
610 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
611 } 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'])) {
612 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
614 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
615 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
616 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";
617 $totalarray[
'nbfield']++;
621include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
623$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
624$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
625print $hookmanager->resPrint;
631if (!
$conf->main_checkbox_left_column) {
632 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
633 $totalarray[
'nbfield']++;
639$needToFetchEachLine = 0;
640if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
641 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
642 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
643 $needToFetchEachLine++;
652$savnbfield = $totalarray[
'nbfield'];
653$totalarray = array();
654$totalarray[
'nbfield'] = 0;
655$imaxinloop = ($limit ? min($num, $limit) : $num);
656while ($i < $imaxinloop) {
657 $obj = $db->fetch_object($resql);
663 $object->setVarsFromFetchObj($obj);
665 if ($mode ==
'kanban') {
667 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
668 print
'<div class="box-flex-container kanban">';
671 $object->date_start = $obj->date_start;
672 $object->date_end = $obj->date_end;
673 $object->fk_job = $obj->job_id;
675 $jobstatic->id = $obj->job_id;
676 $jobstatic->label = $obj->job_label;
677 $jobstatic->status = $obj->job_status;
679 $userstatic->id = $obj->fk_user;
680 $userstatic->ref = $obj->fk_user;
681 $userstatic->firstname = $obj->firstname;
682 $userstatic->lastname = $obj->lastname;
683 $userstatic->email = $obj->email;
684 $userstatic->statut = $obj->statut;
685 $userstatic->status = $obj->statut;
686 $userstatic->login = $obj->login;
687 $userstatic->photo = $obj->photo;
691 if ($massactionbutton || $massaction) {
693 if (in_array(
$object->id, $arrayofselected)) {
697 print
$object->getKanbanView(
'', array(
'user' => $userstatic->getNomUrl(-1),
'job' => $jobstatic->getNomUrl(1),
'selected' => $selected));
698 if ($i == ($imaxinloop - 1)) {
705 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
707 if (
$conf->main_checkbox_left_column) {
708 print
'<td class="nowrap center">';
709 if ($massactionbutton || $massaction) {
711 if (in_array(
$object->id, $arrayofselected)) {
714 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
718 $totalarray[
'nbfield']++;
721 foreach (
$object->fields as $key => $val) {
722 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
723 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
724 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
725 } elseif ($key ==
'status') {
726 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
729 if (in_array($val[
'type'], array(
'timestamp'))) {
730 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
731 } elseif ($key ==
'ref') {
732 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
735 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'])) {
736 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
740 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
741 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
742 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key) && !in_array($key, array(
'ref'))) {
743 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
746 if ($key ==
'status') {
747 print
$object->getLibStatut(5);
748 } elseif ($key ==
'rowid') {
755 $totalarray[
'nbfield']++;
757 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
759 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
761 if (!isset($totalarray[
'val'])) {
762 $totalarray[
'val'] = array();
764 if (!isset($totalarray[
'val'][
't.'.$key])) {
765 $totalarray[
'val'][
't.'.$key] = 0;
767 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
772 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
774 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
775 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
776 print $hookmanager->resPrint;
778 if (empty(
$conf->main_checkbox_left_column)) {
779 print
'<td class="nowrap center">';
780 if ($massactionbutton || $massaction) {
782 if (in_array(
$object->id, $arrayofselected)) {
785 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
789 $totalarray[
'nbfield']++;
800include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
805 foreach ($arrayfields as $key => $val) {
806 if (!empty($val[
'checked'])) {
810 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
816$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
817$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
818print $hookmanager->resPrint;
820print
'</table>'.
"\n";
825if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
826 $hidegeneratedfilelistifempty = 1;
827 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
828 $hidegeneratedfilelistifempty = 0;
831 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
835 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
836 $urlsource .= str_replace(
'&',
'&', $param);
838 $filedir = $diroutputmassaction;
839 $genallowed = $permissiontoread;
840 $delallowed = $permissiontoadd;
842 print $formfile->showdocuments(
'massfilesarea_hrm',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
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.
Class to manage Dolibarr users.
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.