28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
40 public $module =
'recruitment';
45 public $element =
'recruitmentjobposition';
50 public $table_element =
'recruitment_recruitmentjobposition';
55 public $picto =
'recruitmentjobposition';
107 public $fields = array(
108 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'comment' =>
"Id"),
109 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'enabled' => 1,
'visible' => 0,
'position' => 5,
'notnull' => 1,
'default' =>
'1',
'index' => 1),
110 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'notnull' => 1,
'visible' => 4,
'noteditable' => 1,
'default' =>
'(PROV)',
'index' => 1,
'searchall' => 1,
'showoncombobox' => 1,
'comment' =>
"Reference of object",
'css' =>
'nowraponall'),
111 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'JobLabel',
'enabled' => 1,
'position' => 30,
'notnull' => 1,
'visible' => 1,
'searchall' => 1,
'css' =>
'minwidth500',
'csslist' =>
'tdoverflowmax300',
'showoncombobox' => 2,
'autofocusoncreate' => 1),
112 'qty' => array(
'type' =>
'integer',
'label' =>
'NbOfEmployeesExpected',
'enabled' => 1,
'position' => 45,
'notnull' => 1,
'visible' => 1,
'default' =>
'1',
'isameasure' => 1,
'css' =>
'maxwidth75imp'),
113 'fk_project' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1',
'label' =>
'Project',
'enabled' =>
'isModEnabled("project")',
'position' => 52,
'notnull' => -1,
'visible' => -1,
'index' => 1,
'css' =>
'maxwidth500',
'picto' =>
'project'),
114 'fk_user_recruiter' => array(
'type' =>
'integer:User:user/class/user.class.php:1:(statut:=:1)',
'label' =>
'ResponsibleOfRecruitement',
'enabled' => 1,
'position' => 54,
'notnull' => 1,
'visible' => 1,
'foreignkey' =>
'user.rowid',
'css' =>
'maxwidth500',
'csslist' =>
'tdoverflowmax150',
'picto' =>
'user'),
115 'email_recruiter' => array(
'type' =>
'varchar(255)',
'label' =>
'EmailRecruiter',
'enabled' => 1,
'position' => 54,
'notnull' => 0,
'visible' => -1,
'help' =>
'ToUseAGenericEmail',
'picto' =>
'email'),
116 'fk_user_supervisor' => array(
'type' =>
'integer:User:user/class/user.class.php:1:(statut:=:1)',
'label' =>
'FutureManager',
'enabled' => 1,
'position' => 55,
'notnull' => 0,
'visible' => -1,
'foreignkey' =>
'user.rowid',
'css' =>
'maxwidth500',
'csslist' =>
'tdoverflowmax150',
'picto' =>
'user'),
117 'fk_establishment' => array(
'type' =>
'integer:Establishment:hrm/class/establishment.class.php',
'label' =>
'Establishment',
'enabled' =>
'isModEnabled("hrm")',
'position' => 56,
'notnull' => 0,
'visible' => -1,
'foreignkey' =>
'establishment.rowid',),
118 'fk_soc' => array(
'type' =>
'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))',
'label' =>
'WorkPlace',
'enabled' =>
'isModEnabled("societe")',
'position' => 57,
'notnull' => -1,
'visible' => -1,
'css' =>
'maxwidth500',
'index' => 1,
'help' =>
"IfJobIsLocatedAtAPartner",
'picto' =>
'company'),
119 'date_planned' => array(
'type' =>
'date',
'label' =>
'DateExpected',
'enabled' => 1,
'position' => 60,
'notnull' => 0,
'visible' => 1,),
120 'remuneration_suggested' => array(
'type' =>
'varchar(255)',
'label' =>
'Remuneration',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 1,
'csslist' =>
'tdoverflowmax150'),
121 'description' => array(
'type' =>
'html',
'label' =>
'Description',
'enabled' => 1,
'position' => 65,
'notnull' => 0,
'visible' => 3,),
122 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 101,
'notnull' => 0,
'visible' => 0,),
123 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 102,
'notnull' => 0,
'visible' => 0,),
124 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -4,),
125 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
126 'fk_user_creat' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'position' => 510,
'notnull' => 1,
'visible' => -2,
'foreignkey' =>
'user.rowid',),
127 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,),
128 'last_main_doc' => array(
'type' =>
'varchar(255)',
'label' =>
'LastMainDoc',
'enabled' => 1,
'position' => 900,
'notnull' => 0,
'visible' => 0,),
129 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
130 'model_pdf' => array(
'type' =>
'varchar(255)',
'label' =>
'Model pdf',
'enabled' => 1,
'position' => 1010,
'notnull' => -1,
'visible' => 0,),
131 'status' => array(
'type' =>
'smallint',
'label' =>
'Status',
'enabled' => 1,
'position' => 1000,
'notnull' => 1,
'visible' => 5,
'default' =>
'0',
'index' => 1,
'arrayofkeyval' => array(0 =>
'Draft', 1 =>
'Validated', 3 =>
'Recruited', 9 =>
'Canceled'),),
165 public $fk_user_recruiter;
170 public $email_recruiter;
175 public $remuneration_suggested;
180 public $fk_user_supervisor;
184 public $fk_establishment;
188 public $date_planned;
200 public $note_private;
204 public $fk_user_creat;
208 public $fk_user_modif;
212 public $last_main_doc;
235 global
$conf, $langs;
239 $this->ismultientitymanaged = 1;
240 $this->isextrafieldmanaged = 1;
243 $this->fields[
'rowid'][
'visible'] = 0;
245 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
246 $this->fields[
'entity'][
'enabled'] = 0;
256 foreach ($this->fields as $key => $val) {
257 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
258 unset($this->fields[$key]);
263 if (is_object($langs)) {
264 foreach ($this->fields as $key => $val) {
265 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
266 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
267 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
295 global $langs, $extrafields;
305 $result =
$object->fetchCommon($fromid);
306 if ($result > 0 && !empty(
$object->table_element_line)) {
320 if (property_exists(
$object,
'ref')) {
322 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
324 if (property_exists(
$object,
'label')) {
326 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".
$object->label : $this->fields[
'label'][
'default'];
328 if (property_exists(
$object,
'status')) {
331 if (property_exists(
$object,
'date_creation')) {
334 if (property_exists(
$object,
'date_modification')) {
335 $object->date_modification =
null;
339 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
340 $extrafields->fetch_name_optionals_label($this->table_element);
341 foreach (
$object->array_options as $key => $option) {
342 $shortkey = preg_replace(
'/options_/',
'', $key);
343 if (!empty($extrafields->attributes[$this->element][
'unique'][$shortkey])) {
346 unset(
$object->array_options[$key]);
352 $object->context[
'createfromclone'] =
'createfromclone';
353 $result =
$object->createCommon($user);
366 unset(
$object->context[
'createfromclone']);
373 $this->db->rollback();
385 public function fetch($id, $ref =
null)
388 if ($result > 0 && !empty($this->table_element_line)) {
401 $this->lines = array();
420 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
428 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
429 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
430 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
432 $sql .=
' WHERE 1 = 1';
439 $this->errors[] = $errormessage;
440 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
444 if (!empty($sortfield)) {
445 $sql .= $this->db->order($sortfield, $sortorder);
447 if (!empty($limit)) {
448 $sql .= $this->db->plimit($limit, $offset);
451 $resql = $this->db->query($sql);
453 $num = $this->db->num_rows($resql);
455 while ($i < ($limit ? min($limit, $num) : $num)) {
456 $obj = $this->db->fetch_object($resql);
458 $record =
new self($this->db);
459 $record->setVarsFromFetchObj($obj);
461 $records[$record->id] = $record;
465 $this->db->free($resql);
469 $this->errors[] =
'Error '.$this->db->lasterror();
470 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
495 public function delete(
User $user, $notrigger = 0)
511 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
530 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
535 if ($this->
status == self::STATUS_VALIDATED) {
536 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
545 if ( (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
548 $num = (string) $this->
ref;
550 $this->newref = $num;
554 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
555 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
556 $sql .=
" status = ".self::STATUS_VALIDATED;
557 if (!empty($this->fields[
'date_validation'])) {
558 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
560 if (!empty($this->fields[
'fk_user_valid'])) {
561 $sql .=
", fk_user_valid = ".((int) $user->id);
563 $sql .=
" WHERE rowid = ".((int) $this->
id);
565 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
566 $resql = $this->db->query($sql);
568 dol_print_error($this->db);
569 $this->error = $this->db->lasterror();
573 if (!$error && !$notrigger) {
575 $result = $this->call_trigger(
'RECRUITMENTJOBPOSITION_VALIDATE', $user);
584 $this->oldref = $this->ref;
587 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
589 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'recruitmentjobposition/".$this->db->escape($this->newref).
"'";
590 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentjobposition/".$this->db->escape($this->
ref).
"' and entity = ".((int)
$conf->entity);
591 $resql = $this->db->query($sql);
594 $this->error = $this->db->lasterror();
596 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'recruitmentjobposition/".$this->db->escape($this->newref).
"'";
597 $sql .=
" WHERE filepath = 'recruitmentjobposition/".$this->db->escape($this->
ref).
"' and entity = ".((int)
$conf->entity);
598 $resql = $this->db->query($sql);
601 $this->error = $this->db->lasterror();
607 $dirsource =
$conf->recruitment->dir_output.
'/recruitmentjobposition/'.$oldref;
608 $dirdest =
$conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref;
609 if (!$error && file_exists($dirsource)) {
610 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
612 if (@rename($dirsource, $dirdest)) {
615 $listoffiles =
dol_dir_list(
$conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
616 foreach ($listoffiles as $fileentry) {
617 $dirsource = $fileentry[
'name'];
618 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
619 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
620 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
621 @rename($dirsource, $dirdest);
638 $this->db->rollback();
654 if ($this->
status <= self::STATUS_DRAFT) {
665 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTJOBPOSITION_UNVALIDATE');
675 public function cancel($user, $notrigger = 0)
678 if ($this->
status != self::STATUS_VALIDATED) {
689 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTJOBPOSITION_CLOSE');
701 public function cloture($user, $status, $note =
"", $notrigger = 0)
703 global $langs,
$conf;
712 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
713 $sql .=
" SET status = ".((int) $status).
", note_private = '".$this->db->escape($newprivatenote).
"'";
715 $sql .=
" WHERE rowid = ".((int) $this->
id);
717 $resql = $this->db->query($sql);
719 $modelpdf = $this->model_pdf;
720 $triggerName =
'RECRUITMENTJOB_CLOSE_REFUSED';
722 if ($status == self::STATUS_RECRUITED) {
723 $triggerName =
'RECRUITMENTJOB_CLOSE_RECRUITED';
724 $modelpdf = $this->model_pdf;
729 $outputlangs = $langs;
732 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') : $this->thirdparty->default_lang);
733 $outputlangs->setDefaultLang($newlang);
742 $this->
generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
745 $this->oldcopy = clone $this;
747 $this->date_cloture = $now;
748 $this->note_private = $newprivatenote;
752 $result = $this->call_trigger($triggerName, $user);
763 $this->
status = $this->oldcopy->status;
764 $this->date_cloture = $this->oldcopy->date_cloture;
765 $this->note_private = $this->oldcopy->note_private;
767 $this->db->rollback();
771 $this->error = $this->db->lasterror();
772 $this->db->rollback();
784 public function reopen($user, $notrigger = 0)
787 if ($this->
status != self::STATUS_CANCELED) {
798 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTJOBPOSITION_REOPEN');
812 $langs->load(
'recruitment');
817 return [
'optimize' => $langs->trans(
"ShowPositionToBeFilled")];
819 $datas[
'picto'] = img_picto(
'', $this->picto) .
' <u class="paddingrightonly">' . $langs->trans(
"PositionToBeFilled") .
'</u>';
820 if (isset($this->
status)) {
823 if (!empty($this->
ref)) {
824 $datas[
'ref'] =
'<br><b>' . $langs->trans(
'Ref') .
':</b> ' . $this->ref;
826 if (!empty($this->label)) {
827 $datas[
'ref'] =
'<br>' . $langs->trans(
'Label') .
':</b> ' . $this->label;
843 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
845 global
$conf, $langs, $hookmanager;
847 if (!empty(
$conf->dol_no_mouse_hover)) {
853 'id' => (string) $this->
id,
854 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
857 $classfortooltip =
'classfortooltip';
860 $classfortooltip =
'classforajaxtooltip';
861 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
867 $baseurl = DOL_URL_ROOT .
'/recruitment/recruitmentjobposition_card.php';
868 $query = [
'id' => $this->id];
869 if ($option !==
'nolink') {
871 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
872 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
873 $add_save_lastsearch_values = 1;
875 if ($add_save_lastsearch_values) {
876 $query += [
'save_lastsearch_values' => 1];
882 if (empty($notooltip)) {
884 $label = $langs->trans(
"ShowPositionToBeFilled");
885 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
887 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
888 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
890 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
893 $linkstart =
'<a href="'.$url.
'"';
894 $linkstart .= $linkclose.
'>';
897 $result .= $linkstart;
899 if (empty($this->showphoto_on_popup)) {
901 $result .= img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
905 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
907 list($class, $module) = explode(
'@', $this->picto);
910 $filename = $filearray[0][
'name'];
911 if (!empty($filename)) {
912 $pospoint = strpos($filearray[0][
'name'],
'.');
914 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.
dol_substr($filename, 0, $pospoint).
'_mini'.
dol_substr($filename, $pospoint);
916 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.
'" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.
$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div></div>';
918 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.
$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div>';
923 $result .= img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
928 if ($withpicto != 2) {
929 $result .= $this->ref;
935 global $action, $hookmanager;
936 $hookmanager->initHooks(array(
'recruitmentjobpositiondao'));
937 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
938 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
940 $result = $hookmanager->resPrint;
942 $result .= $hookmanager->resPrint;
970 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
983 $statusType =
'status'.$status;
984 if ($status == self::STATUS_VALIDATED) {
985 $statusType =
'status4';
987 if ($status == self::STATUS_RECRUITED) {
988 $statusType =
'status6';
990 if ($status == self::STATUS_CANCELED) {
991 $statusType =
'status9';
994 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
1005 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
1006 $sql .=
' fk_user_creat, fk_user_modif';
1007 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
1008 $sql .=
' WHERE t.rowid = '.((int) $id);
1009 $result = $this->db->query($sql);
1011 if ($this->db->num_rows($result)) {
1012 $obj = $this->db->fetch_object($result);
1014 $this->
id = $obj->rowid;
1016 $this->user_creation_id = $obj->fk_user_creat;
1017 $this->user_modification_id = $obj->fk_user_modif;
1018 $this->date_creation = $this->db->jdate($obj->datec);
1019 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
1022 $this->db->free($result);
1024 dol_print_error($this->db);
1046 $this->lines = array();
1048 return $this->lines;
1058 global $langs,
$conf;
1059 $langs->load(
"recruitment");
1062 $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON =
'mod_recruitmentjobposition_standard';
1072 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
1073 foreach ($dirmodels as $reldir) {
1077 $mybool = ((bool) @include_once $dir.$file) || $mybool;
1081 dol_print_error(
null,
"Failed to include file ".$file);
1085 if (class_exists($classname)) {
1086 $obj =
new $classname();
1087 '@phan-var-force ModeleNumRefRecruitmentJobPosition $obj';
1088 $numref = $obj->getNextValue($this);
1090 if ($numref !=
'' && $numref !=
'-1') {
1093 $this->error = $obj->error;
1098 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1102 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1118 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1120 global
$conf, $langs;
1123 $includedocgeneration = 1;
1125 $langs->load(
"recruitment");
1135 $modelpath =
"core/modules/recruitment/doc/";
1137 if ($includedocgeneration && !empty($modele)) {
1138 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1169 $this->db->commit();
1186 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1188 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1189 $return .=
'<div class="info-box info-box-sm">';
1190 $return .=
'<span class="info-box-icon bg-infobox-action">';
1191 $return .= img_picto(
'', $this->picto);
1192 $return .=
'</span>';
1193 $return .=
'<div class="info-box-content">';
1194 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).($this->qty > 1 ?
' <span title="'.$langs->trans(
"NbOfEmployeesExpected").
'">('.$this->qty.
')</span>' :
'').
'</span>';
1195 if ($selected >= 0) {
1196 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1202 if (property_exists($this,
'remuneration_suggested')) {
1203 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Remuneration").
'</span> : <span class="info-box-label">'.$this->remuneration_suggested.
'</span>';
1205 if (method_exists($this,
'getLibStatut')) {
1206 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
' <span class="opacitymedium" title="'.$langs->trans(
"RecruitmentCandidatures").
'">'.$langs->trans(
"RecruitmentCandidatures",
'',
'',
'',
'', 5).
'</span> : <span>';
1207 $return .= $arraydata[
'nbapplications'];
1208 $return .=
'</span></div>';
1210 $return .=
'</div>';
1211 $return .=
'</div>';
1212 $return .=
'</div>';
if(! $sortfield) if(! $sortorder) $object
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
deleteLineCommon(User $user, $idline, $notrigger=0)
Delete a line of object in database.
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
setErrorsFromObject($object)
setErrorsFromObject
createCommon(User $user, $notrigger=0)
Create object in the database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
updateCommon(User $user, $notrigger=0)
Update object into database.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
initAsSpecimenCommon()
Initialise object with example values Id must be 0 if object instance is a specimen.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
fetchLinesCommon($morewhere='', $noextrafields=0)
Load object in memory from the database.
fetchCommon($id, $ref=null, $morewhere='', $noextrafields=0)
Load object in memory from the database.
deleteCommon(User $user, $notrigger=0, $forcechilddeletion=0)
Delete object in database.
Class to manage Dolibarr database access.
Class for RecruitmentJobPosition.
validate($user, $notrigger=0)
Validate object.
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
const STATUS_VALIDATED
Validated.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
info($id)
Load the info information in the object.
__construct(DoliDB $db)
Constructor.
getTooltipContentArray($params)
getTooltipContentArray
cloture($user, $status, $note="", $notrigger=0)
Close the recruitment.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionally the picto)
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
setDraft($user, $notrigger=0)
Set draft status.
getLibStatut($mode=0)
Return label of the status.
create(User $user, $notrigger=0)
Create object into database.
const STATUS_RECRUITED
Recruited.
const STATUS_CANCELED
Canceled.
LibStatut($status, $mode=0)
Return the status.
getLinesArray()
Create an array of lines.
reopen($user, $notrigger=0)
Set back to validated status.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
const STATUS_DRAFT
Draft status.
update(User $user, $notrigger=0)
Update object into database.
fetch($id, $ref=null)
Load object in memory from the database.
cancel($user, $notrigger=0)
Set cancel status.
createFromClone(User $user, $fromid)
Clone an object into another one.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
fetchLines()
Load object lines in memory from the database.
Class to manage translations.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_now($mode='gmt')
Return date for now.
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0, $forbiddenfields=array())
forgeSQLFromUniversalSearchCriteria
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.