27require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonpeople.class.php';
40 public $module =
'recruitment';
45 public $element =
'recruitmentcandidature';
50 public $table_element =
'recruitment_recruitmentcandidature';
55 public $picto =
'recruitmentcandidature';
60 public $email_fields_no_propagate_in_actioncomm;
63 const STATUS_DRAFT = 0;
64 const STATUS_VALIDATED = 1;
66 const STATUS_CONTRACT_PROPOSED = 3;
67 const STATUS_CONTRACT_SIGNED = 5;
68 const STATUS_CONTRACT_REFUSED = 6;
69 const STATUS_REFUSED = 8;
70 const STATUS_CANCELED = 9;
102 public $fields = array(
103 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'comment' =>
"Id"),
104 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'enabled' => 1,
'visible' => 0,
'position' => 5,
'notnull' => 1,
'default' =>
'1',
'index' => 1),
105 '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 candidature",
'csslist' =>
'nowraponall'),
106 'fk_recruitmentjobposition' => array(
'type' =>
'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php:0',
'label' =>
'Job',
'enabled' =>
'1',
'position' => 15,
'notnull' => 0,
'visible' => 1,
'index' => 1,
'picto' =>
'recruitmentjobposition',
'css' =>
'minwidth300 maxwidth500 widthcentpercentminusx',
'csslist' =>
'minwidth100 nowraponall'),
107 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 0,),
108 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 0,),
109 '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',
'csslist' =>
'tdoverflowmax100'),
110 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,
'csslist' =>
'tdoverflowmax100'),
111 'lastname' => array(
'type' =>
'varchar(128)',
'label' =>
'Lastname',
'enabled' => 1,
'position' => 20,
'notnull' => 0,
'visible' => 1,
'csslist' =>
'tdoverflowmax150'),
112 'firstname' => array(
'type' =>
'varchar(128)',
'label' =>
'Firstname',
'enabled' => 1,
'position' => 21,
'notnull' => 0,
'visible' => 1,
'csslist' =>
'tdoverflowmax150'),
113 'email' => array(
'type' =>
'email',
'label' =>
'EMail',
'enabled' => 1,
'position' => 30,
'notnull' => 1,
'visible' => 1,
'picto' =>
'email',
'csslist' =>
'tdoverflowmax150'),
114 'phone' => array(
'type' =>
'phone',
'label' =>
'Phone',
'enabled' => 1,
'position' => 31,
'notnull' => 0,
'visible' => 1,
'picto' =>
'phone',
'csslist' =>
'tdoverflowmax150'),
115 'date_birth' => array(
'type' =>
'date',
'label' =>
'DateOfBirth',
'enabled' => 1,
'position' => 70,
'visible' => -1,),
116 'email_msgid' => array(
'type' =>
'varchar(255)',
'label' =>
'EmailMsgID',
'visible' => -2,
'enabled' => 1,
'position' => 540,
'notnull' => -1,
'help' =>
'EmailMsgIDDesc'),
117 'email_date' => array(
'type' =>
'datetime',
'label' =>
'EmailDate',
'visible' => -2,
'enabled' => 1,
'position' => 541),
119 'remuneration_requested' => array(
'type' =>
'integer',
'label' =>
'RequestedRemuneration',
'enabled' => 1,
'position' => 80,
'notnull' => 0,
'visible' => -1,),
120 'remuneration_proposed' => array(
'type' =>
'integer',
'label' =>
'ProposedRemuneration',
'enabled' => 1,
'position' => 81,
'notnull' => 0,
'visible' => -1,),
121 'description' => array(
'type' =>
'html',
'label' =>
'Description',
'enabled' => 1,
'position' => 300,
'notnull' => 0,
'visible' => 3,
'cssview' =>
'wordbreak'),
122 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -4,
'csslist' =>
'nowraponall'),
123 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,
'csslist' =>
'nowraponall'),
124 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'picto' =>
'user',
'help' =>
'LinkToUserCreated',
'enabled' => 1,
'position' => 600,
'notnull' => 0,
'visible' => -1,
'css' =>
'minwidth300 maxwidth500 widthcentpercentminusx',
'csslist' =>
'tdoverflowmax100'),
125 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
126 'model_pdf' => array(
'type' =>
'varchar(255)',
'label' =>
'Model pdf',
'enabled' => 1,
'position' => 1010,
'notnull' => -1,
'visible' => 0,),
127 'status' => array(
'type' =>
'smallint',
'label' =>
'Status',
'enabled' => 1,
'position' => 1000,
'notnull' => 1,
'visible' => 2,
'index' => 1,
'default' =>
'0',
'arrayofkeyval' => array(0 =>
'Draft', 1 =>
'Received', 3 =>
'ContractProposed', 5 =>
'ContractSigned', 8 =>
'Refused', 9 =>
'Canceled')),
128 "ip" => array(
"type" =>
"varchar(250)",
"label" =>
"Ip",
"enabled" => 1,
'position' => 700,
'notnull' => 0,
"visible" => 0,
"comment" =>
"ip used to create record (for public submission page)"),
143 public $fk_recruitmentjobposition;
151 public $fk_user_creat;
155 public $fk_user_modif;
191 public $remuneration_requested;
195 public $remuneration_proposed;
199 public $fk_recruitment_origin;
229 $this->ismultientitymanaged = 1;
230 $this->isextrafieldmanaged = 1;
233 $this->fields[
'rowid'][
'visible'] = 0;
235 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
236 $this->fields[
'entity'][
'enabled'] = 0;
246 foreach ($this->fields as $key => $val) {
247 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
248 unset($this->fields[$key]);
253 if (is_object($langs)) {
254 foreach ($this->fields as $key => $val) {
255 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
256 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
257 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
285 global $langs, $extrafields;
295 $result =
$object->fetchCommon($fromid);
296 if ($result > 0 && !empty(
$object->table_element_line)) {
310 if (property_exists(
$object,
'ref')) {
312 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
315 $object->status = self::STATUS_DRAFT;
317 $object->date_modification =
null;
320 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
321 $extrafields->fetch_name_optionals_label($this->table_element);
322 foreach (
$object->array_options as $key => $option) {
323 $shortkey = preg_replace(
'/options_/',
'', $key);
324 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
325 unset(
$object->array_options[$key]);
331 $object->context[
'createfromclone'] =
'createfromclone';
332 $result =
$object->createCommon($user);
347 if (property_exists($this,
'socid') && $this->socid ==
$object->socid) {
354 unset(
$object->context[
'createfromclone']);
361 $this->db->rollback();
374 public function fetch($id, $ref =
null, $email_msgid =
'')
378 $morewhere =
" AND email_msgid = '".$this->db->escape($email_msgid).
"'";
380 $result = $this->
fetchCommon($id, $ref, $morewhere);
381 if ($result > 0 && !empty($this->table_element_line)) {
394 $this->lines = array();
413 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
421 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
422 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
423 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
425 $sql .=
' WHERE 1 = 1';
430 $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
432 $this->errors[] = $errormessage;
433 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
437 if (!empty($sortfield)) {
438 $sql .= $this->db->order($sortfield, $sortorder);
440 if (!empty($limit)) {
441 $sql .= $this->db->plimit($limit, $offset);
444 $resql = $this->db->query($sql);
446 $num = $this->db->num_rows($resql);
448 while ($i < ($limit ? min($limit, $num) : $num)) {
449 $obj = $this->db->fetch_object($resql);
451 $record =
new self($this->db);
452 $record->setVarsFromFetchObj($obj);
454 $records[$record->id] = $record;
458 $this->db->free($resql);
462 $this->errors[] =
'Error '.$this->db->lasterror();
463 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
488 public function delete(
User $user, $notrigger = 0)
505 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
522 global
$conf, $langs;
524 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
529 if ($this->
status == self::STATUS_VALIDATED) {
530 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
547 if ( (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
548 $num = $this->getNextNumRef();
552 $this->newref = $num;
556 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
557 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
558 $sql .=
" status = ".self::STATUS_VALIDATED;
559 if (!empty($this->fields[
'date_validation'])) {
560 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
562 if (!empty($this->fields[
'fk_user_valid'])) {
563 $sql .=
", fk_user_valid = ".((int) $user->id);
565 $sql .=
" WHERE rowid = ".((int) $this->
id);
567 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
568 $resql = $this->db->query($sql);
571 $this->error = $this->db->lasterror();
575 if (!$error && !$notrigger) {
577 $result = $this->call_trigger(
'RECRUITMENTCANDIDATURE_VALIDATE', $user);
586 $this->oldref = $this->ref;
589 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
591 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'recruitmentcandidature/".$this->db->escape($this->newref).
"'";
592 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentcandidature/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
593 $resql = $this->db->query($sql);
596 $this->error = $this->db->lasterror();
598 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'recruitmentcandidature/".$this->db->escape($this->newref).
"'";
599 $sql .=
" WHERE filepath = 'recruitmentcandidature/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
600 $resql = $this->db->query($sql);
603 $this->error = $this->db->lasterror();
609 $dirsource =
$conf->recruitment->dir_output.
'/recruitmentcandidature/'.$oldref;
610 $dirdest =
$conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref;
611 if (!$error && file_exists($dirsource)) {
612 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
614 if (@rename($dirsource, $dirdest)) {
617 $listoffiles =
dol_dir_list(
$conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
618 foreach ($listoffiles as $fileentry) {
619 $dirsource = $fileentry[
'name'];
620 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
621 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
622 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
623 @rename($dirsource, $dirdest);
633 $this->
status = self::STATUS_VALIDATED;
640 $this->db->rollback();
656 if ($this->
status <= self::STATUS_DRAFT) {
667 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTCANDIDATURE_UNVALIDATE');
677 public function cancel($user, $notrigger = 0)
680 if ($this->
status != self::STATUS_VALIDATED) {
691 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTCANDIDATURE_CLOSE');
701 public function reopen($user, $notrigger = 0)
704 if ($this->
status != self::STATUS_REFUSED && $this->
status != self::STATUS_CANCELED && $this->
status != self::STATUS_CONTRACT_REFUSED) {
715 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTCANDIDATURE_REOPEN');
727 public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
729 $lastname = $this->lastname;
730 $firstname = $this->firstname;
731 if (empty($lastname)) {
732 $lastname = (isset($this->lastname) ? $this->lastname : (isset($this->
name) ? $this->
name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company :
'')))));
753 $langs->load(
'recruitment');
758 return [
'optimize' => $langs->trans(
"ShowRecruitmentCandidature")];
760 $datas[
'picto'] =
img_picto(
'', $this->picto) .
' <u class="paddingrightonly">' . $langs->trans(
"RecruitmentCandidature") .
'</u>';
761 if (isset($this->
status)) {
764 if (!empty($this->
ref)) {
765 $datas[
'ref'] =
'<br><b>' . $langs->trans(
'Ref') .
':</b> ' . $this->ref;
767 if (!empty($this->
email)) {
768 $datas[
'email'] =
'<br>' . $langs->trans(
'Email') .
':</b> ' . $this->email;
770 $datas[
'name'] =
'<br>' . $langs->trans(
'Email') .
':</b> ' . $this->
getFullName($langs);
785 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
787 global
$conf, $langs, $hookmanager;
789 if (!empty(
$conf->dol_no_mouse_hover)) {
795 'id' => (
string) $this->
id,
796 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
799 $classfortooltip =
'classfortooltip';
802 $classfortooltip =
'classforajaxtooltip';
803 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
809 $baseurl = DOL_URL_ROOT .
'/recruitment/recruitmentcandidature_card.php';
810 $query = [
'id' => $this->id];
811 if ($option !==
'nolink') {
813 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
814 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
815 $add_save_lastsearch_values = 1;
817 if ($add_save_lastsearch_values) {
818 $query += [
'save_lastsearch_values' => 1];
824 if (empty($notooltip)) {
826 $label = $langs->trans(
"ShowRecruitmentCandidature");
827 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
829 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
830 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
832 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
835 $linkstart =
'<a href="'.$url.
'"';
836 $linkstart .= $linkclose.
'>';
839 $result .= $linkstart;
841 if (empty($this->showphoto_on_popup)) {
843 $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);
847 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
849 list($class, $module) = explode(
'@', $this->picto);
852 $filename = $filearray[0][
'name'];
853 if (!empty($filename)) {
854 $pospoint = strpos($filearray[0][
'name'],
'.');
856 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
858 $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>';
860 $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>';
865 $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);
870 if ($withpicto != 2) {
871 $result .= $this->ref;
877 global $action, $hookmanager;
878 $hookmanager->initHooks(array(
'recruitmentcandidaturedao'));
879 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
880 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
882 $result = $hookmanager->resPrint;
884 $result .= $hookmanager->resPrint;
912 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
915 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
916 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received').
' ('.$langs->transnoentitiesnoconv(
"InterviewToDo").
')';
917 $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
918 $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
919 $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
920 $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
921 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
922 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
923 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received');
924 $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
925 $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
926 $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
927 $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
928 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
931 $statusType =
'status'.$status;
933 if ($status == self::STATUS_CANCELED) {
934 $statusType =
'status9';
936 if ($status == self::STATUS_CONTRACT_PROPOSED) {
937 $statusType =
'status4';
939 if ($status == self::STATUS_CONTRACT_SIGNED) {
940 $statusType =
'status6';
942 if ($status == self::STATUS_REFUSED) {
943 $statusType =
'status10';
946 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
957 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
958 $sql .=
' fk_user_creat, fk_user_modif';
959 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
960 $sql .=
' WHERE t.rowid = '.((int) $id);
961 $result = $this->db->query($sql);
963 if ($this->db->num_rows($result)) {
964 $obj = $this->db->fetch_object($result);
966 $this->
id = $obj->rowid;
968 $this->user_creation_id = $obj->fk_user_creat;
969 $this->user_modification_id = $obj->fk_user_modif;
970 $this->date_creation = $this->db->jdate($obj->datec);
971 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
974 $this->db->free($result);
998 $this->lines = array();
1001 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0,
'(fk_recruitmentcandidature:=:'.((
int) $this->
id).
')');
1003 if (is_numeric($result)) {
1007 $this->lines = $result;
1018 public function getNextNumRef()
1020 global $langs,
$conf;
1021 $langs->load(
"recruitment@recruitment");
1024 $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON =
'mod_recruitmentcandidature_standard';
1034 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
1035 foreach ($dirmodels as $reldir) {
1039 $mybool = ((bool) @include_once $dir.$file) || $mybool;
1047 if (class_exists($classname)) {
1048 $obj =
new $classname();
1049 '@phan-var-force ModeleNumRefRecruitmentCandidature $obj';
1051 $numref = $obj->getNextValue($this);
1053 if ($numref !=
'' && $numref !=
'-1') {
1056 $this->error = $obj->error;
1061 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1065 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1081 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1083 global
$conf, $langs;
1086 $includedocgeneration = 0;
1088 $langs->load(
"recruitment@recruitment");
1098 $modelpath =
"core/modules/recruitment/doc/";
1100 if ($includedocgeneration && !empty($modele)) {
1101 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1116 global
$conf, $langs;
1132 $this->db->commit();
1148 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1150 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1151 $return .=
'<div class="info-box info-box-sm">';
1152 $return .=
'<span class="info-box-icon bg-infobox-action">';
1154 $return .=
'</span>';
1155 $return .=
'<div class="info-box-content">';
1156 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1157 if ($selected >= 0) {
1158 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1160 if (property_exists($this,
'fk_recruitmentjobposition')) {
1164 $return .=
'<div class="info-box-label tdoverflowmax150">';
1166 $tmpjob->fetch($this->fk_recruitmentjobposition);
1169 $return .=
'</div>';
1171 if (property_exists($this,
'phone') && $this->phone) {
1172 $return .=
'<div class="info-box-label small">'.dol_print_phone($this->phone,
$mysoc->country_code, 0, 0,
'AC_TEL',
' ',
'phone').
'</div>';
1174 if (property_exists($this,
'email') && $this->
email) {
1175 $return .=
'<div class="info-box-label small">'.dol_print_email($this->
email, 0, 0, 1, 64, 1, 1).
'</div>';
1177 if (method_exists($this,
'getLibStatut')) {
1178 $return .=
'<div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1180 $return .=
'</div>';
1181 $return .=
'</div>';
1182 $return .=
'</div>';
1188require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
if(! $sortfield) if(! $sortorder) $object
Parent class of all other business classes (invoices, contracts, proposals, orders,...
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.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Class to manage Dolibarr database access.
Class for RecruitmentCandidature.
getLinesArray()
Create an array of lines.
createFromClone(User $user, $fromid)
Clone an object into another one.
cancel($user, $notrigger=0)
Set cancel status.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionally the picto)
reopen($user, $notrigger=0)
Set back to validated status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
__construct(DoliDB $db)
Constructor.
getLibStatut($mode=0)
Return label of the status.
fetch($id, $ref=null, $email_msgid='')
Load object in memory from the database.
fetchLines()
Load object lines in memory from the database.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
update(User $user, $notrigger=0)
Update object into database.
validate($user, $notrigger=0)
Validate object.
getTooltipContentArray($params)
getTooltipContentArray
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
LibStatut($status, $mode=0)
Return the status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name ('name+' '+lastname)
setDraft($user, $notrigger=0)
Set draft status.
create(User $user, $notrigger=0)
Create object into database.
info($id)
Load the info information in the object.
Class RecruitmentCandidatureLine.
__construct(DoliDB $db)
Constructor.
Class for RecruitmentJobPosition.
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...
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
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.
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)
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
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.
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
$conf db name
Only used if Module[ID]Name translation string is not found.