25require_once 
'../main.inc.php';
 
   26require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
 
   27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
 
   28require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
 
   30require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
 
   33$langs->loadLangs(array(
"recruitment", 
"other"));
 
   35$action     = 
GETPOST(
'action', 
'aZ09') ? 
GETPOST(
'action', 
'aZ09') : 
'view'; 
 
   36$massaction = 
GETPOST(
'massaction', 
'alpha'); 
 
   37$show_files = 
GETPOST(
'show_files', 
'int'); 
 
   38$confirm    = 
GETPOST(
'confirm', 
'alpha'); 
 
   39$cancel     = 
GETPOST(
'cancel', 
'alpha'); 
 
   40$toselect   = 
GETPOST(
'toselect', 
'array'); 
 
   41$contextpage = 
GETPOST(
'contextpage', 
'aZ') ? 
GETPOST(
'contextpage', 
'aZ') : 
'recruitmentjobpositionlist'; 
 
   42$backtopage = 
GETPOST(
'backtopage', 
'alpha'); 
 
   43$optioncss  = 
GETPOST(
'optioncss', 
'aZ'); 
 
   49$limit = 
GETPOST(
'limit', 
'int') ? 
GETPOST(
'limit', 
'int') : $conf->liste_limit;
 
   50$sortfield = 
GETPOST(
'sortfield', 
'aZ09comma');
 
   51$sortorder = 
GETPOST(
'sortorder', 
'aZ09comma');
 
   52$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) : 
GETPOST(
"page", 
'int');
 
   53if (empty($page) || $page < 0 || 
GETPOST(
'button_search', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) {
 
   57$offset = $limit * $page;
 
   64$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
 
   65$hookmanager->initHooks(array(
'recruitmentjobpositionlist')); 
 
   68$extrafields->fetch_name_optionals_label($object->table_element);
 
   71$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, 
'', 
'search_');
 
   82$search_all = 
GETPOST(
'search_all', 
'alphanohtml');
 
   84foreach ($object->fields as $key => $val) {
 
   85  if (
GETPOST(
'search_'.$key, 
'alpha') !== 
'') {
 
   86    $search[$key] = 
GETPOST(
'search_'.$key, 
'alpha');
 
   88  if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
 
   89    $search[$key.
'_dtstart'] = 
dol_mktime(0, 0, 0, 
GETPOST(
'search_'.$key.
'_dtstartmonth', 
'int'), 
GETPOST(
'search_'.$key.
'_dtstartday', 
'int'), 
GETPOST(
'search_'.$key.
'_dtstartyear', 
'int'));
 
   90    $search[$key.
'_dtend'] = 
dol_mktime(23, 59, 59, 
GETPOST(
'search_'.$key.
'_dtendmonth', 
'int'), 
GETPOST(
'search_'.$key.
'_dtendday', 
'int'), 
GETPOST(
'search_'.$key.
'_dtendyear', 
'int'));
 
   95$fieldstosearchall = array();
 
   96foreach ($object->fields as $key => $val) {
 
   97  if (!empty($val[
'searchall'])) {
 
   98    $fieldstosearchall[
't.'.$key] = $val[
'label'];
 
  103$arrayfields = array();
 
  104foreach ($object->fields as $key => $val) {
 
  106  if (!empty($val[
'visible'])) {
 
  107    $visible = (int) 
dol_eval($val[
'visible'], 1, 1, 
'1');
 
  108    $arrayfields[
't.'.$key] = array(
 
  109      'label'=>$val[
'label'],
 
  110      'checked'=>(($visible < 0) ? 0 : 1),
 
  111      'enabled'=>($visible != 3 && 
dol_eval($val[
'enabled'], 1, 1, 
'1')),
 
  112      'position'=>$val[
'position'],
 
  113      'help'=> isset($val[
'help']) ? $val[
'help'] : 
'' 
  118include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
 
  121include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php'; 
 
  124$arrayfields[
'nbapplications'] = array(
'type'=>
'integer', 
'label'=>
'Applications', 
'checked'=>1, 
'enabled'=>1, 
'position'=>90, 
'csslist'=>
'right');
 
  127$permissiontoread = $user->hasRight(
'recruitment', 
'recruitmentjobposition', 
'read');
 
  128$permissiontoadd = $user->hasRight(
'recruitment', 
'recruitmentjobposition', 
'write');
 
  129$permissiontodelete = $user->hasRight(
'recruitment', 
'recruitmentjobposition', 
'delete');
 
  135restrictedArea($user, 
'recruitment', 0, 
'recruitment_recruitmentjobposition', 
'recruitmentjobposition');
 
  143if (
GETPOST(
'cancel', 
'alpha')) {
 
  147if (!
GETPOST(
'confirmmassaction', 
'alpha') && $massaction != 
'presend' && $massaction != 
'confirm_presend') {
 
  151$parameters = array();
 
  152$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action); 
 
  157if (empty($reshook)) {
 
  159  include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
 
  162  if (
GETPOST(
'button_removefilter_x', 
'alpha') || 
GETPOST(
'button_removefilter.x', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) { 
 
  163    foreach ($object->fields as $key => $val) {
 
  165      if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
 
  166        $search[$key.
'_dtstart'] = 
'';
 
  167        $search[$key.
'_dtend'] = 
'';
 
  171    $search_array_options = array();
 
  173  if (
GETPOST(
'button_removefilter_x', 
'alpha') || 
GETPOST(
'button_removefilter.x', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')
 
  174    || 
GETPOST(
'button_search_x', 
'alpha') || 
GETPOST(
'button_search.x', 
'alpha') || 
GETPOST(
'button_search', 
'alpha')) {
 
  179  $objectclass = 
'RecruitmentJobPosition';
 
  180  $objectlabel = 
'RecruitmentJobPosition';
 
  181  $uploaddir = $conf->recruitment->dir_output;
 
  182  include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
 
  191$form = 
new Form($db);
 
  197$title = $langs->trans(
'PositionsToBeFilled');
 
  205$sql .= $object->getFieldList(
't');
 
  208if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
 
  209  foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
 
  210    $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] != 
'separate' ? 
", ef.".$key.
" as options_".$key : 
'');
 
  214$parameters = array();
 
  215$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object); 
 
  216$sql .= $hookmanager->resPrint;
 
  217$sql = preg_replace(
'/,\s*$/', 
'', $sql);
 
  218$sql .= 
", COUNT(rc.rowid) as nbapplications";
 
  219$sql .= 
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
 
  220$sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = t.rowid";
 
  221if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
 
  222  $sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
 
  225$parameters = array();
 
  226$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object); 
 
  227$sql .= $hookmanager->resPrint;
 
  228if ($object->ismultientitymanaged == 1) {
 
  229  $sql .= 
" WHERE t.entity IN (".getEntity($object->element).
")";
 
  231  $sql .= 
" WHERE 1 = 1";
 
  233foreach ($search as $key => $val) {
 
  234  if (array_key_exists($key, $object->fields)) {
 
  235    if ($key == 
'status' && $search[$key] == -1) {
 
  238    $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
 
  239    if ((strpos($object->fields[$key][
'type'], 
'integer:') === 0) || (strpos($object->fields[$key][
'type'], 
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
 
  240      if ($search[$key] == 
'-1' || ($search[$key] === 
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
 
  245    if ($search[$key] != 
'') {
 
  246      $sql .= 
natural_search(
"t.".$db->escape($key), $search[$key], (($key == 
'status') ? 2 : $mode_search));
 
  249    if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] != 
'') {
 
  250      $columnName = preg_replace(
'/(_dtstart|_dtend)$/', 
'', $key);
 
  251      if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
 
  252        if (preg_match(
'/_dtstart$/', $key)) {
 
  253          $sql .= 
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
 
  255        if (preg_match(
'/_dtend$/', $key)) {
 
  256          $sql .= 
" AND t.".$db->escape($columnName).
" <= '" . $db->idate($search[$key]).
"'";
 
  263  $sql .= 
natural_search(array_keys($fieldstosearchall), $search_all);
 
  267include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
 
  269$parameters = array();
 
  270$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object); 
 
  271$sql .= $hookmanager->resPrint;
 
  275foreach ($object->fields as $key => $val) {
 
  276  $sql .= 
"t.".$db->escape($key).
", ";
 
  279if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
 
  280  foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
 
  281    $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] != 
'separate' ? 
"ef.".$key.
', ' : 
'');
 
  285$parameters = array();
 
  286$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object); 
 
  287$sql .= $hookmanager->resPrint;
 
  288$sql = preg_replace(
'/,\s*$/', 
'', $sql);
 
  291$nbtotalofrecords = 
'';
 
  294  $resql = $db->query($sql);
 
  295  $nbtotalofrecords = $db->num_rows($resql);
 
  310  if (($page * $limit) > $nbtotalofrecords) { 
 
  318$sql .= $db->order($sortfield, $sortorder);
 
  320  $sql .= $db->plimit($limit + 1, $offset);
 
  323$resql = $db->query($sql);
 
  329$num = $db->num_rows($resql);
 
  333if ($num == 1 && 
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
 
  334  $obj = $db->fetch_object($resql);
 
  336  header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.$id);
 
  344llxHeader(
'', $title, $help_url, 
'', 0, 0, $morejs, $morecss, 
'', 
'');
 
  346$arrayofselected = is_array($toselect) ? $toselect : array();
 
  350  $param .= 
'&mode='.urlencode($mode);
 
  352if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
 
  353  $param .= 
'&contextpage='.urlencode($contextpage);
 
  355if ($limit > 0 && $limit != $conf->liste_limit) {
 
  356  $param .= 
'&limit='.((int) $limit);
 
  358foreach ($search as $key => $val) {
 
  359  if (is_array($search[$key]) && count($search[$key])) {
 
  360    foreach ($search[$key] as $skey) {
 
  362        $param .= 
'&search_'.$key.
'[]='.urlencode($skey);
 
  365  } elseif ($search[$key] != 
'') {
 
  366    $param .= 
'&search_'.$key.
'='.urlencode($search[$key]);
 
  369if ($optioncss != 
'') {
 
  370  $param .= 
'&optioncss='.urlencode($optioncss);
 
  373include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
 
  375$parameters = array(
'param' => &$param);
 
  376$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object); 
 
  377$param .= $hookmanager->resPrint;
 
  380$arrayofmassactions = array(
 
  386if ($permissiontodelete) {
 
  387  $arrayofmassactions[
'predelete'] = 
img_picto(
'', 
'delete', 
'class="pictofixedwidth"').$langs->trans(
"Delete");
 
  389if (
GETPOST(
'nomassaction', 
'int') || in_array($massaction, array(
'presend', 
'predelete'))) {
 
  390  $arrayofmassactions = array();
 
  392$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
 
  394print 
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
 
  395if ($optioncss != 
'') {
 
  396  print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  398print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  399print 
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
 
  400print 
'<input type="hidden" name="action" value="list">';
 
  401print 
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
 
  402print 
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
 
  404print 
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
 
  405print 
'<input type="hidden" name="mode" value="'.$mode.
'">';
 
  408$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'));
 
  409$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'));
 
  411$newcardbutton .= 
dolGetButtonTitle($langs->trans(
'New'), 
'', 
'fa fa-plus-circle', 
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']), 
'', $permissiontoadd);
 
  413print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 
'object_'.$object->picto, 0, $newcardbutton, 
'', $limit, 0, 0, 1);
 
  416$topicmail = 
"SendRecruitmentJobPositionRef";
 
  417$modelmail = 
"recruitmentjobposition";
 
  419$trackid = 
'recruitmentjobposition'.$object->id;
 
  420include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
 
  423  foreach ($fieldstosearchall as $key => $val) {
 
  424    $fieldstosearchall[$key] = $langs->trans($val);
 
  426  print 
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
 
  434$parameters = array();
 
  435$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object); 
 
  436if (empty($reshook)) {
 
  437  $moreforfilter .= $hookmanager->resPrint;
 
  439  $moreforfilter = $hookmanager->resPrint;
 
  442if (!empty($moreforfilter)) {
 
  443  print 
'<div class="liste_titre liste_titre_bydiv centpercent">';
 
  444  print $moreforfilter;
 
  448$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
 
  449$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, 
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN')); 
 
  450$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) : 
'');
 
  452print 
'<div class="div-table-responsive">'; 
 
  453print 
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ? 
" listwithfilterbefore" : 
"").
'">'.
"\n";
 
  458print 
'<tr class="liste_titre">';
 
  461  print 
'<td class="liste_titre maxwidthsearch">';
 
  462  $searchpicto = $form->showFilterButtons(
'left');
 
  466foreach ($object->fields as $key => $val) {
 
  467  $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ? 
'' : $val[
'css']) : $val[
'csslist']);
 
  468  if ($key == 
'status') {
 
  469    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  470  } elseif (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) {
 
  471    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  472  } elseif (in_array($val[
'type'], array(
'timestamp'))) {
 
  473    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'nowrap';
 
  474  } elseif (in_array($val[
'type'], array(
'double(24,8)', 
'double(6,3)', 
'integer', 
'real', 
'price')) && $val[
'label'] != 
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
 
  475    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'right';
 
  477  if (!empty($arrayfields[
't.'.$key][
'checked'])) {
 
  478    print 
'<td class="liste_titre'.($cssforfield ? 
' '.$cssforfield : 
'').
'">';
 
  479    if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
 
  480      print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] : 
''), $val[
'notnull'], 0, 0, 
'', 1, 0, 0, 
'', 
'maxwidth100', 1);
 
  481    } elseif ((strpos($val[
'type'], 
'integer:') === 0) || (strpos($val[
'type'], 
'sellist:') === 0)) {
 
  482      print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : 
''), 
'', 
'', 
'search_', 
'maxwidth125', 1);
 
  483    } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
 
  484      print 
'<div class="nowrap">';
 
  485      print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] : 
'', 
"search_".$key.
"_dtstart", 0, 0, 1, 
'', 1, 0, 0, 
'', 
'', 
'', 
'', 1, 
'', $langs->trans(
'From'));
 
  487      print 
'<div class="nowrap">';
 
  488      print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] : 
'', 
"search_".$key.
"_dtend", 0, 0, 1, 
'', 1, 0, 0, 
'', 
'', 
'', 
'', 1, 
'', $langs->trans(
'to'));
 
  490    } elseif ($key == 
'lang') {
 
  491      require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
 
  493      print $formadmin->select_language($search[$key], 
'search_lang', 0, 
null, 1, 0, 0, 
'minwidth150 maxwidth200', 2);
 
  495      print 
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] : 
'').
'">';
 
  501include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
 
  504$parameters = array(
'arrayfields'=>$arrayfields);
 
  505$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object); 
 
  506print $hookmanager->resPrint;
 
  507if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
 
  508  print 
'<td class="liste_titre"></td>';
 
  512  print 
'<td class="liste_titre maxwidthsearch">';
 
  513  $searchpicto = $form->showFilterButtons();
 
  519$totalarray = array();
 
  520$totalarray[
'nbfield'] = 0;
 
  524print 
'<tr class="liste_titre">';
 
  527  print 
getTitleFieldOfList(($mode != 
'kanban' ? $selectedfields : 
''), 0, $_SERVER[
"PHP_SELF"], 
'', 
'', 
'', 
'', $sortfield, $sortorder, 
'center maxwidthsearch ').
"\n";
 
  528  $totalarray[
'nbfield']++;
 
  530foreach ($object->fields as $key => $val) {
 
  531  $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ? 
'' : $val[
'css']) : $val[
'csslist']);
 
  532  if ($key == 
'status') {
 
  533    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  534  } elseif (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) {
 
  535    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  536  } elseif (in_array($val[
'type'], array(
'timestamp'))) {
 
  537    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'nowrap';
 
  538  } elseif (in_array($val[
'type'], array(
'double(24,8)', 
'double(6,3)', 
'integer', 
'real', 
'price')) && $val[
'label'] != 
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
 
  539    $cssforfield .= ($cssforfield ? 
' ' : 
'').
'right';
 
  541  if (!empty($arrayfields[
't.'.$key][
'checked'])) {
 
  542    print 
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'], 
't.'.$key, 
'', $param, ($cssforfield ? 
'class="'.$cssforfield.
'"' : 
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' : 
'')).
"\n";
 
  543    $totalarray[
'nbfield']++;
 
  547include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
 
  549$parameters = array(
'arrayfields'=>$arrayfields, 
'param'=>$param, 
'sortfield'=>$sortfield, 
'sortorder'=>$sortorder, 
'totalarray'=>&$totalarray);
 
  550$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object); 
 
  551print $hookmanager->resPrint;
 
  552if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
 
  553  print 
'<th class="liste_titre right">'.$langs->trans(
"RecruitmentCandidatures").
'</th>';
 
  554  $totalarray[
'nbfield']++;
 
  558  print 
getTitleFieldOfList(($mode != 
'kanban' ? $selectedfields : 
''), 0, $_SERVER[
"PHP_SELF"], 
'', 
'', 
'', 
'', $sortfield, $sortorder, 
'center maxwidthsearch ').
"\n";
 
  559  $totalarray[
'nbfield']++;
 
  565$needToFetchEachLine = 0;
 
  566if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
 
  567  foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
 
  568    if (!is_null($val) && preg_match(
'/\$object/', $val)) {
 
  569      $needToFetchEachLine++; 
 
  578$savnbfield = $totalarray[
'nbfield'];
 
  579$totalarray[
'nbfield'] = 0;
 
  580$imaxinloop = ($limit ? min($num, $limit) : $num);
 
  581while ($i < $imaxinloop) {
 
  582  $obj = $db->fetch_object($resql);
 
  588  $object->setVarsFromFetchObj($obj);
 
  589  $object->date_planned = $obj->date_planned;
 
  591  if ($mode == 
'kanban') {
 
  593      print 
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
 
  594      print 
'<div class="box-flex-container kanban">';
 
  596    if ($massactionbutton || $massaction) {
 
  601    if ($massactionbutton || $massaction) { 
 
  603      if (in_array($object->id, $arrayofselected)) {
 
  607    print $object->getKanbanView(
'', array(
'nbapplications'=>$obj->nbapplications, 
'selected' => $selected));
 
  608    if ($i == ($imaxinloop - 1)) {
 
  615    print 
'<tr class="oddeven">';
 
  618      print 
'<td class="nowrap center">';
 
  619      if ($massactionbutton || $massaction) { 
 
  621        if (in_array($object->id, $arrayofselected)) {
 
  624        print 
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ? 
' checked="checked"' : 
'').
'>';
 
  628        $totalarray[
'nbfield']++;
 
  631    foreach ($object->fields as $key => $val) {
 
  632      $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ? 
'' : $val[
'css']) : $val[
'csslist']);
 
  633      if (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) {
 
  634        $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  635      } elseif ($key == 
'status') {
 
  636        $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  639      if (in_array($val[
'type'], array(
'timestamp'))) {
 
  640        $cssforfield .= ($cssforfield ? 
' ' : 
'').
'nowrap';
 
  641      } elseif ($key == 
'ref') {
 
  642        $cssforfield .= ($cssforfield ? 
' ' : 
'').
'nowrap';
 
  645      if (in_array($val[
'type'], array(
'double(24,8)', 
'double(6,3)', 
'integer', 
'real', 
'price')) && !in_array($key, array(
'rowid', 
'status')) && empty($val[
'arrayofkeyval'])) {
 
  646        $cssforfield .= ($cssforfield ? 
' ' : 
'').
'right';
 
  650      if (!empty($arrayfields[
't.'.$key][
'checked'])) {
 
  651        print 
'<td'.($cssforfield ? 
' class="'.$cssforfield.
'"' : 
'').
'>';
 
  652        if ($key == 
'status') {
 
  653          print $object->getLibStatut(5);
 
  654        } elseif ($key == 
'rowid') {
 
  655          print $object->showOutputField($val, $key, $object->id, 
'');
 
  657          print $object->showOutputField($val, $key, $object->$key, 
'');
 
  661          $totalarray[
'nbfield']++;
 
  663        if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
 
  665            $totalarray[
'pos'][$totalarray[
'nbfield']] = 
't.'.$key;
 
  667          if (!isset($totalarray[
'val'])) {
 
  668            $totalarray[
'val'] = array();
 
  670          if (!isset($totalarray[
'val'][
't.'.$key])) {
 
  671            $totalarray[
'val'][
't.'.$key] = 0;
 
  673          $totalarray[
'val'][
't.'.$key] += $object->$key;
 
  678    include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
 
  680    $parameters = array(
'arrayfields'=>$arrayfields, 
'object'=>$object, 
'obj'=>$obj, 
'i'=>$i, 
'totalarray'=>&$totalarray);
 
  681    $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object); 
 
  682    print $hookmanager->resPrint;
 
  683    if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
 
  684      print 
'<td class="right">'.$obj->nbapplications.
'</td>';
 
  686        $totalarray[
'nbfield']++;
 
  691      print 
'<td class="nowrap center">';
 
  692      if ($massactionbutton || $massaction) { 
 
  694        if (in_array($object->id, $arrayofselected)) {
 
  697        print 
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ? 
' checked="checked"' : 
'').
'>';
 
  701        $totalarray[
'nbfield']++;
 
  712include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
 
  717  foreach ($arrayfields as $key => $val) {
 
  718    if (!empty($val[
'checked'])) {
 
  722  print 
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
 
  728$parameters = array(
'arrayfields' => $arrayfields, 
'sql'=>$sql);
 
  729$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action); 
 
  730print $hookmanager->resPrint;
 
  732print 
'</table>'.
"\n";
 
  737if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === 
'' || $nbtotalofrecords)) {
 
  738  $hidegeneratedfilelistifempty = 1;
 
  739  if ($massaction == 
'builddoc' || $action == 
'remove_file' || $show_files) {
 
  740    $hidegeneratedfilelistifempty = 0;
 
  743  require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
 
  747  $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
 
  748  $urlsource .= str_replace(
'&', 
'&', $param);
 
  750  $filedir = $diroutputmassaction;
 
  751  $genallowed = $permissiontoread;
 
  752  $delallowed = $permissiontoadd;
 
  754  print $formfile->showdocuments(
'massfilesarea_recruitment', 
'', $filedir, $urlsource, 0, $delallowed, 
'', 1, 1, 0, 48, 1, $param, $title, 
'', 
'', 
'', 
null, $hidegeneratedfilelistifempty);
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
 
Class for RecruitmentJobPosition.
 
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
 
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
 
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.
 
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.
 
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
 
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
 
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
 
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.
 
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
 
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
 
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
 
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
 
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
 
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.