26require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
38 public $module =
'recruitment';
43 public $element =
'recruitmentjobposition';
48 public $table_element =
'recruitment_recruitmentjobposition';
54 public $ismultientitymanaged = 1;
59 public $isextrafieldmanaged = 1;
64 public $picto =
'recruitmentjobposition';
116 public $fields = array(
117 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'comment'=>
"Id"),
118 'entity' => array(
'type'=>
'integer',
'label'=>
'Entity',
'enabled'=>1,
'visible'=>0,
'position'=>5,
'notnull'=>1,
'default'=>
'1',
'index'=>1),
119 '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'),
120 '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),
121 'qty' => array(
'type'=>
'integer',
'label'=>
'NbOfEmployeesExpected',
'enabled'=>
'1',
'position'=>45,
'notnull'=>1,
'visible'=>1,
'default'=>
'1',
'isameasure'=>
'1',
'css'=>
'maxwidth75imp'),
122 'fk_project' => array(
'type'=>
'integer:Project:projet/class/project.class.php:1',
'label'=>
'Project',
'enabled'=>
'$conf->project->enabled',
'position'=>52,
'notnull'=>-1,
'visible'=>-1,
'index'=>1,
'css'=>
'maxwidth500',
'picto'=>
'project'),
123 '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'),
124 'email_recruiter' => array(
'type'=>
'varchar(255)',
'label'=>
'EmailRecruiter',
'enabled'=>
'1',
'position'=>54,
'notnull'=>0,
'visible'=>-1,
'help'=>
'ToUseAGenericEmail',
'picto'=>
'email'),
125 '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'),
126 'fk_establishment' => array(
'type'=>
'integer:Establishment:hrm/class/establishment.class.php',
'label'=>
'Establishment',
'enabled'=>
'$conf->hrm->enabled',
'position'=>56,
'notnull'=>0,
'visible'=>-1,
'foreignkey'=>
'establishment.rowid',),
127 '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'),
128 'date_planned' => array(
'type'=>
'date',
'label'=>
'DateExpected',
'enabled'=>
'1',
'position'=>60,
'notnull'=>0,
'visible'=>1,),
129 'remuneration_suggested' => array(
'type'=>
'varchar(255)',
'label'=>
'Remuneration',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>1,),
130 'description' => array(
'type'=>
'html',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>65,
'notnull'=>0,
'visible'=>3,),
131 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>101,
'notnull'=>0,
'visible'=>0,),
132 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>102,
'notnull'=>0,
'visible'=>0,),
133 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-4,),
134 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
135 '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',),
136 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
137 'last_main_doc' => array(
'type'=>
'varchar(255)',
'label'=>
'LastMainDoc',
'enabled'=>
'1',
'position'=>900,
'notnull'=>0,
'visible'=>0,),
138 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
139 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
140 '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'),),
157 public $fk_user_recruiter;
162 public $email_recruiter;
167 public $remuneration_suggested;
169 public $fk_user_supervisor;
170 public $fk_establishment;
171 public $date_planned;
174 public $note_private;
175 public $date_creation;
177 public $fk_user_creat;
178 public $fk_user_modif;
179 public $last_main_doc;
193 global $conf, $langs;
198 $this->fields[
'rowid'][
'visible'] = 0;
200 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
201 $this->fields[
'entity'][
'enabled'] = 0;
211 foreach ($this->fields as $key => $val) {
212 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
213 unset($this->fields[$key]);
218 if (is_object($langs)) {
219 foreach ($this->fields as $key => $val) {
220 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
221 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
222 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
250 global $langs, $extrafields;
255 $object =
new self($this->db);
260 $result = $object->fetchCommon($fromid);
261 if ($result > 0 && !empty($object->table_element_line)) {
262 $object->fetchLines();
271 unset($object->fk_user_creat);
272 $object->import_key =
null;
275 if (property_exists($object,
'ref')) {
276 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
278 if (property_exists($object,
'label')) {
279 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
281 if (property_exists($object,
'status')) {
284 if (property_exists($object,
'date_creation')) {
285 $object->date_creation =
dol_now();
287 if (property_exists($object,
'date_modification')) {
288 $object->date_modification =
null;
292 if (is_array($object->array_options) && count($object->array_options) > 0) {
293 $extrafields->fetch_name_optionals_label($this->table_element);
294 foreach ($object->array_options as $key => $option) {
295 $shortkey = preg_replace(
'/options_/',
'', $key);
296 if (!empty($extrafields->attributes[$this->element][
'unique'][$shortkey])) {
299 unset($object->array_options[$key]);
305 $object->context[
'createfromclone'] =
'createfromclone';
306 $result = $object->createCommon($user);
309 $this->error = $object->error;
310 $this->errors = $object->errors;
322 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
329 unset($object->context[
'createfromclone']);
336 $this->db->rollback();
348 public function fetch($id, $ref =
null)
351 if ($result > 0 && !empty($this->table_element_line)) {
364 $this->lines = array();
382 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
390 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
391 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
392 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
394 $sql .=
' WHERE 1 = 1';
398 if (count($filter) > 0) {
399 foreach ($filter as $key => $value) {
400 if ($key ==
't.rowid') {
401 $sqlwhere[] = $key.
" = ".((int) $value);
402 } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
403 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
404 } elseif ($key ==
'customsql') {
405 $sqlwhere[] = $value;
406 } elseif (strpos($value,
'%') ===
false) {
407 $sqlwhere[] = $key.
" IN (".$this->db->sanitize($this->db->escape($value)).
")";
409 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
413 if (count($sqlwhere) > 0) {
414 $sql .=
' AND ('.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
417 if (!empty($sortfield)) {
418 $sql .= $this->db->order($sortfield, $sortorder);
420 if (!empty($limit)) {
421 $sql .= $this->db->plimit($limit, $offset);
424 $resql = $this->db->query($sql);
426 $num = $this->db->num_rows($resql);
428 while ($i < ($limit ? min($limit, $num) : $num)) {
429 $obj = $this->db->fetch_object($resql);
431 $record =
new self($this->db);
432 $record->setVarsFromFetchObj($obj);
434 $records[$record->id] = $record;
438 $this->db->free($resql);
442 $this->errors[] =
'Error '.$this->db->lasterror();
443 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
468 public function delete(
User $user, $notrigger =
false)
485 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
504 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
509 if ($this->
status == self::STATUS_VALIDATED) {
510 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
527 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
532 $this->newref = $num;
536 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
537 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
538 $sql .=
" status = ".self::STATUS_VALIDATED;
539 if (!empty($this->fields[
'date_validation'])) {
540 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
542 if (!empty($this->fields[
'fk_user_valid'])) {
543 $sql .=
", fk_user_valid = ".$user->id;
545 $sql .=
" WHERE rowid = ".((int) $this->
id);
547 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
548 $resql = $this->db->query($sql);
551 $this->error = $this->db->lasterror();
555 if (!$error && !$notrigger) {
557 $result = $this->
call_trigger(
'RECRUITMENTJOBPOSITION_VALIDATE', $user);
566 $this->oldref = $this->ref;
569 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
571 $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).
"'";
572 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentjobposition/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
573 $resql = $this->db->query($sql);
576 $this->error = $this->db->lasterror();
578 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'recruitmentjobposition/".$this->db->escape($this->newref).
"'";
579 $sql .=
" WHERE filepath = 'recruitmentjobposition/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
580 $resql = $this->db->query($sql);
583 $this->error = $this->db->lasterror();
589 $dirsource = $conf->recruitment->dir_output.
'/recruitmentjobposition/'.$oldref;
590 $dirdest = $conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref;
591 if (!$error && file_exists($dirsource)) {
592 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
594 if (@rename($dirsource, $dirdest)) {
597 $listoffiles =
dol_dir_list($conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
598 foreach ($listoffiles as $fileentry) {
599 $dirsource = $fileentry[
'name'];
600 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
601 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
602 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
603 @rename($dirsource, $dirdest);
620 $this->db->rollback();
636 if ($this->
status <= self::STATUS_DRAFT) {
647 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTJOBPOSITION_UNVALIDATE');
657 public function cancel($user, $notrigger = 0)
660 if ($this->
status != self::STATUS_VALIDATED) {
671 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTJOBPOSITION_CLOSE');
685 global $langs, $conf;
694 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
695 $sql .=
" SET status = ".((int) $status).
", note_private = '".$this->db->escape($newprivatenote).
"'";
697 $sql .=
" WHERE rowid = ".((int) $this->
id);
699 $resql = $this->db->query($sql);
701 $modelpdf = $this->model_pdf;
702 $triggerName =
'RECRUITMENTJOB_CLOSE_REFUSED';
704 if ($status == self::STATUS_RECRUITED) {
705 $triggerName =
'RECRUITMENTJOB_CLOSE_RECRUITED';
706 $modelpdf = $this->model_pdf;
711 $outputlangs = $langs;
714 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') : $this->thirdparty->default_lang);
715 $outputlangs->setDefaultLang($newlang);
724 $this->
generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
728 $this->oldcopy = clone $this;
730 $this->date_cloture = $now;
731 $this->note_private = $newprivatenote;
734 if (!$notrigger && empty($error)) {
747 $this->
status = $this->oldcopy->status;
748 $this->date_cloture = $this->oldcopy->date_cloture;
749 $this->note_private = $this->oldcopy->note_private;
751 $this->db->rollback();
755 $this->error = $this->db->lasterror();
756 $this->db->rollback();
768 public function reopen($user, $notrigger = 0)
771 if ($this->
status != self::STATUS_CANCELED) {
782 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTJOBPOSITION_REOPEN');
795 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
797 global $conf, $langs, $hookmanager;
799 if (!empty($conf->dol_no_mouse_hover)) {
805 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"PositionToBeFilled").
'</u>';
806 if (isset($this->
status)) {
807 $label .=
' '.$this->getLibStatut(5);
810 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
811 $label .=
'<br><b>'.$langs->trans(
'Label').
':</b> '.$this->label;
813 $url =
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?id='.$this->id;
815 if ($option !=
'nolink') {
817 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
818 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
819 $add_save_lastsearch_values = 1;
821 if ($add_save_lastsearch_values) {
822 $url .=
'&save_lastsearch_values=1';
827 if (empty($notooltip)) {
829 $label = $langs->trans(
"ShowRecruitmentJobPosition");
830 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
832 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
833 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
835 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
838 $linkstart =
'<a href="'.$url.
'"';
839 $linkstart .= $linkclose.
'>';
842 $result .= $linkstart;
844 if (empty($this->showphoto_on_popup)) {
846 $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);
850 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
852 list($class, $module) = explode(
'@', $this->picto);
855 $filename = $filearray[0][
'name'];
856 if (!empty($filename)) {
857 $pospoint = strpos($filearray[0][
'name'],
'.');
859 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
861 $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>';
863 $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>';
868 $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);
873 if ($withpicto != 2) {
874 $result .= $this->ref;
880 global $action, $hookmanager;
881 $hookmanager->initHooks(array(
'recruitmentjobpositiondao'));
882 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
883 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
885 $result = $hookmanager->resPrint;
887 $result .= $hookmanager->resPrint;
915 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
928 $statusType =
'status'.$status;
929 if ($status == self::STATUS_VALIDATED) {
930 $statusType =
'status4';
932 if ($status == self::STATUS_RECRUITED) {
933 $statusType =
'status6';
935 if ($status == self::STATUS_CANCELED) {
936 $statusType =
'status9';
939 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
950 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
951 $sql .=
' fk_user_creat, fk_user_modif';
952 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
953 $sql .=
' WHERE t.rowid = '.((int) $id);
954 $result = $this->db->query($sql);
956 if ($this->db->num_rows($result)) {
957 $obj = $this->db->fetch_object($result);
959 $this->
id = $obj->rowid;
961 $this->user_creation_id = $obj->fk_user_creat;
962 $this->user_modification_id = $obj->fk_user_modif;
963 $this->date_creation = $this->db->jdate($obj->datec);
964 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
967 $this->db->free($result);
991 $this->lines = array();
1003 global $langs, $conf;
1004 $langs->load(
"recruitment");
1007 $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON =
'mod_recruitmentjobposition_standard';
1014 $classname = $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON;
1017 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
1018 foreach ($dirmodels as $reldir) {
1022 $mybool |= @include_once $dir.$file;
1025 if ($mybool ===
false) {
1030 if (class_exists($classname)) {
1031 $obj =
new $classname();
1032 $numref = $obj->getNextValue($this);
1034 if ($numref !=
'' && $numref !=
'-1') {
1037 $this->error = $obj->error;
1042 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1046 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1062 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1064 global $conf, $langs;
1067 $includedocgeneration = 1;
1069 $langs->load(
"recruitment");
1073 $modele = $conf->global->RECRUITMENTJOBPOSITION_ADDON_PDF;
1079 $modelpath =
"core/modules/recruitment/doc/";
1081 if ($includedocgeneration && !empty($modele)) {
1082 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1113 $this->db->commit();
1130 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1132 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1133 $return .=
'<div class="info-box info-box-sm">';
1134 $return .=
'<span class="info-box-icon bg-infobox-action">';
1136 $return .=
'</span>';
1137 $return .=
'<div class="info-box-content">';
1138 $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>';
1139 if ($selected >= 0) {
1140 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1146 if (property_exists($this,
'remuneration_suggested')) {
1147 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Remuneration").
'</span> : <span class="info-box-label">'.$this->remuneration_suggested.
'</span>';
1149 if (method_exists($this,
'getLibStatut')) {
1150 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
' <span class="opacitymedium" title="'.$langs->trans(
"RecruitmentCandidatures").
'">'.$langs->trans(
"RecruitmentCandidatures",
'',
'',
'',
'', 5).
'</span> : <span>';
1151 $return .= $arraydata[
'nbapplications'];
1152 $return .=
'</span></div>';
1154 $return .=
'</div>';
1155 $return .=
'</div>';
1156 $return .=
'</div>';
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Parent class of all other business classes (invoices, contracts, proposals, orders,...
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
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.
updateCommon(User $user, $notrigger=false)
Update object into database.
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.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class for RecruitmentJobPosition.
validate($user, $notrigger=0)
Validate object.
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.
create(User $user, $notrigger=false)
Create object into database.
__construct(DoliDB $db)
Constructor.
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 optionaly 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.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
const STATUS_RECRUITED
Recruited.
const STATUS_CANCELED
Canceled.
LibStatut($status, $mode=0)
Return the status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
getLinesArray()
Create an array of lines.
reopen($user, $notrigger=0)
Set back to validated status.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
const STATUS_DRAFT
Draft status.
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.
update(User $user, $notrigger=false)
Update object into database.
fetchLines()
Load object lines in memory from the database.
Class to manage translations.
Class to manage Dolibarr users.
dol_dir_list($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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.