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:int');
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;
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((
string) $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) {
160if (!$permissiontoread) {
167$object->fields[
'fk_user'][
'type'] =
'integer:User:user/class/user.class.php:0';
174if (
GETPOST(
'cancel',
'alpha')) {
178if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
182$parameters = array(
'arrayfields' => &$arrayfields);
183$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
188if (empty($reshook)) {
190 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
193 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
194 foreach (
$object->fields as $key => $val) {
196 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
197 $search[$key.
'_dtstart'] =
'';
198 $search[$key.
'_dtend'] =
'';
203 $search_array_options = array();
205 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
206 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
211 $objectclass =
'Position';
212 $objectlabel =
'Position';
213 $uploaddir =
$conf->hrm->dir_output;
214 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
228$title = $langs->trans(
'EmployeePositions');
238$sql .=
$object->getFieldList(
't');
240$sql .= $userstatic->getFieldList(
'u', array(
'rowid'));
241$sql .=
', u.email, u.statut, u.photo, u.login';
242$sql .=
', j.rowid as job_id, j.label as job_label';
244if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
245 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
246 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
250$parameters = array();
251$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
252$sql .= $hookmanager->resPrint;
253$sql = preg_replace(
'/,\s*$/',
'', $sql);
257$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";
260if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
261 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
264$parameters = array();
265$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
266$sql .= $hookmanager->resPrint;
267if (
$object->ismultientitymanaged == 1) {
268 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element, (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
")";
270 $sql .=
" WHERE 1 = 1";
272$sql .=
" AND t.fk_job = j.rowid";
273foreach ($search as $key => $val) {
274 if (array_key_exists($key,
$object->fields)) {
275 if ($key ==
'status' && $search[$key] == -1) {
279 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
280 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
285 if (empty(
$object->fields[$key][
'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]).
"'";
308$vacant =
GETPOST(
'search_fk_uservacant',
'alphanohtml') ===
'on';
310 $sql .=
' AND t.fk_user = 0';
313 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
317include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
319$parameters = array();
320$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
321$sql .= $hookmanager->resPrint;
342$nbtotalofrecords =
'';
345 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
346 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
348 $resql =
$db->query($sqlforcount);
350 $objforcount =
$db->fetch_object($resql);
351 $nbtotalofrecords = $objforcount->nbtotalofrecords;
356 if (($page * $limit) > (
int) $nbtotalofrecords) {
364$sql .=
$db->order($sortfield, $sortorder);
366 $sql .=
$db->plimit($limit + 1, $offset);
369$resql =
$db->query($sql);
375$num =
$db->num_rows($resql);
379if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
380 $obj =
$db->fetch_object($resql);
382 header(
"Location: ".
dol_buildpath(
'/hrm/position.php', 1).
'?id='.$id);
390llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
407$arrayofselected = is_array($toselect) ? $toselect : array();
411 $param .=
'&mode='.urlencode($mode);
413if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
414 $param .=
'&contextpage='.urlencode($contextpage);
416if ($limit > 0 && $limit !=
$conf->liste_limit) {
417 $param .=
'&limit='.((int) $limit);
419if ($optioncss !=
'') {
420 $param .=
'&optioncss='.urlencode($optioncss);
423foreach ($search as $key => $val) {
424 if (is_array($search[$key])) {
425 foreach ($search[$key] as $skey) {
427 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
430 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
431 $param .=
'&search_'.$key.
'month='.
GETPOSTINT(
'search_'.$key.
'month');
432 $param .=
'&search_'.$key.
'day='.
GETPOSTINT(
'search_'.$key.
'day');
433 $param .=
'&search_'.$key.
'year='.
GETPOSTINT(
'search_'.$key.
'year');
434 } elseif ($search[$key] !=
'') {
435 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
439include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
441$parameters = array(
'param' => &$param);
442$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
443$param .= $hookmanager->resPrint;
446$arrayofmassactions = array(
452if (!empty($permissiontodelete)) {
453 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
455if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
456 $arrayofmassactions = array();
458$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
460print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
461if ($optioncss !=
'') {
462 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
464print
'<input type="hidden" name="token" value="'.newToken().
'">';
465print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
466print
'<input type="hidden" name="action" value="list">';
467print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
468print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
469print
'<input type="hidden" name="page" value="'.$page.
'">';
470print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
471print
'<input type="hidden" name="page_y" value="">';
472print
'<input type="hidden" name="mode" value="'.$mode.
'">';
475$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'));
476$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'));
477$newcardbutton .= dolGetButtonTitleSeparator();
478$newcardbutton .= dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/position.php', 1).
'?action=create',
'', $permissiontoadd);
480print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
483$topicmail =
"SendPositionRef";
484$modelmail =
"position";
486$trackid =
'xxxx'.$object->id;
487include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
492 foreach ($fieldstosearchall as $key => $val) {
493 $fieldstosearchall[$key] = $langs->trans($val);
494 $setupstring .= $key.
"=".$val.
";";
496 print
'<!-- Search done like if JOBPOSITION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
497 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
505$parameters = array();
506$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
507if (empty($reshook)) {
508 $moreforfilter .= $hookmanager->resPrint;
510 $moreforfilter = $hookmanager->resPrint;
513if (!empty($moreforfilter)) {
514 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
515 print $moreforfilter;
519$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
520$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column ?
'left' :
'');
521$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
522$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
524print
'<div class="div-table-responsive">';
525print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
533print
'<tr class="liste_titre_filter">';
535if (
$conf->main_checkbox_left_column) {
536 print
'<td class="liste_titre center maxwidthsearch">';
537 $searchpicto = $form->showFilterButtons(
'left');
541foreach (
$object->fields as $key => $val) {
543 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
544 if ($key ==
'status') {
545 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
546 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
547 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
548 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
549 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
550 } 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'])) {
551 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
553 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
554 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
555 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
556 if (empty($val[
'searchmulti'])) {
557 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);
559 print $form->multiselectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), 0, 0,
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
561 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
562 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
563 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
564 print
'<div class="nowrap">';
565 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
567 print
'<div class="nowrap">';
568 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
570 } elseif ($key ==
'lang') {
571 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
573 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
575 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] :
'').
'">';
581include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
584$parameters = array(
'arrayfields' => $arrayfields);
585$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
586print $hookmanager->resPrint;
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;
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') {
671 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
672 print
'<div class="box-flex-container kanban">';
675 $object->date_start = $obj->date_start;
676 $object->date_end = $obj->date_end;
677 $object->fk_job = $obj->job_id;
679 $jobstatic->id = $obj->job_id;
680 $jobstatic->label = $obj->job_label;
681 $jobstatic->status = $obj->job_status;
683 $userstatic->id = $obj->fk_user;
684 $userstatic->ref = (
string) $obj->fk_user;
685 $userstatic->firstname = $obj->firstname;
686 $userstatic->lastname = $obj->lastname;
687 $userstatic->email = $obj->email;
688 $userstatic->statut = (int) $obj->statut;
689 $userstatic->status = (int) $obj->statut;
690 $userstatic->login = $obj->login;
691 $userstatic->photo = $obj->photo;
695 if ($massactionbutton || $massaction) {
697 if (in_array(
$object->id, $arrayofselected)) {
701 print
$object->getKanbanView(
'', array(
'user' => $userstatic->getNomUrl(-1),
'job' => $jobstatic->getNomUrl(1),
'selected' => $selected));
702 if ($i == ($imaxinloop - 1)) {
709 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
711 if (
$conf->main_checkbox_left_column) {
712 print
'<td class="nowrap center">';
713 if ($massactionbutton || $massaction) {
715 if (in_array(
$object->id, $arrayofselected)) {
718 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
725 foreach (
$object->fields as $key => $val) {
726 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
727 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
728 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
729 } elseif ($key ==
'status') {
730 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
733 if (in_array($val[
'type'], array(
'timestamp'))) {
734 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
735 } elseif ($key ==
'ref') {
736 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
739 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'])) {
740 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
744 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
745 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
746 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key) && !in_array($key, array(
'ref'))) {
747 print
' title="'.dolPrintHTMLForAttribute((
string)
$object->$key).
'"';
750 if ($key ==
'status') {
751 print
$object->getLibStatut(5);
752 } elseif ($key ==
'rowid') {
753 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
761 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
765 if (!isset($totalarray[
'val'])) {
768 if (!isset($totalarray[
'val'][
't.'.$key])) {
776 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
778 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
779 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
780 print $hookmanager->resPrint;
782 if (empty(
$conf->main_checkbox_left_column)) {
783 print
'<td class="nowrap center">';
784 if ($massactionbutton || $massaction) {
786 if (in_array(
$object->id, $arrayofselected)) {
789 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
804include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
809 foreach ($arrayfields as $key => $val) {
810 if (!empty($val[
'checked'])) {
814 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
820$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
821$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
822print $hookmanager->resPrint;
824print
'</table>'.
"\n";
829if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
830 $hidegeneratedfilelistifempty = 1;
831 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
832 $hidegeneratedfilelistifempty = 0;
835 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
839 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
840 $urlsource .= str_replace(
'&',
'&', $param);
842 $filedir = $diroutputmassaction;
843 $genallowed = $permissiontoread;
844 $delallowed = $permissiontoadd;
846 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(! $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.
Class to manage Dolibarr users.
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.
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.
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.