27require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
39 public $module =
'recruitment';
44 public $element =
'recruitmentcandidature';
49 public $table_element =
'recruitment_recruitmentcandidature';
54 public $picto =
'recruitmentcandidature';
59 public $email_fields_no_propagate_in_actioncomm;
62 const STATUS_DRAFT = 0;
63 const STATUS_VALIDATED = 1;
65 const STATUS_CONTRACT_PROPOSED = 3;
66 const STATUS_CONTRACT_SIGNED = 5;
67 const STATUS_CONTRACT_REFUSED = 6;
68 const STATUS_REFUSED = 8;
69 const STATUS_CANCELED = 9;
101 public $fields = array(
102 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'comment' =>
"Id"),
103 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'enabled' => 1,
'visible' => 0,
'position' => 5,
'notnull' => 1,
'default' =>
'1',
'index' => 1),
104 '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'),
105 'fk_recruitmentjobposition' => array(
'type' =>
'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php:0:(t.status:=:1)',
'label' =>
'Job',
'enabled' => 1,
'position' => 15,
'notnull' => 0,
'visible' => 1,
'index' => 1,
'picto' =>
'recruitmentjobposition',
'css' =>
'minwidth300 maxwidth500 widthcentpercentminusx',
'csslist' =>
'minwidth100 nowraponall'),
106 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 0,),
107 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 0,),
108 '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'),
109 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,
'csslist' =>
'tdoverflowmax100'),
110 'lastname' => array(
'type' =>
'varchar(128)',
'label' =>
'Lastname',
'enabled' => 1,
'position' => 20,
'notnull' => 0,
'visible' => 1,
'csslist' =>
'tdoverflowmax150'),
111 'firstname' => array(
'type' =>
'varchar(128)',
'label' =>
'Firstname',
'enabled' => 1,
'position' => 21,
'notnull' => 0,
'visible' => 1,
'csslist' =>
'tdoverflowmax150'),
112 'email' => array(
'type' =>
'email',
'label' =>
'EMail',
'enabled' => 1,
'position' => 30,
'notnull' => 1,
'visible' => 1,
'picto' =>
'email',
'csslist' =>
'tdoverflowmax150'),
113 'phone' => array(
'type' =>
'phone',
'label' =>
'Phone',
'enabled' => 1,
'position' => 31,
'notnull' => 0,
'visible' => 1,
'picto' =>
'phone',
'csslist' =>
'tdoverflowmax150'),
114 'date_birth' => array(
'type' =>
'date',
'label' =>
'DateOfBirth',
'enabled' => 1,
'position' => 70,
'visible' => -1,),
115 'email_msgid' => array(
'type' =>
'varchar(255)',
'label' =>
'EmailMsgID',
'visible' => -2,
'enabled' => 1,
'position' => 540,
'notnull' => -1,
'help' =>
'EmailMsgIDDesc'),
116 'email_date' => array(
'type' =>
'datetime',
'label' =>
'EmailDate',
'visible' => -2,
'enabled' => 1,
'position' => 541),
118 'remuneration_requested' => array(
'type' =>
'integer',
'label' =>
'RequestedRemuneration',
'enabled' => 1,
'position' => 80,
'notnull' => 0,
'visible' => -1,),
119 'remuneration_proposed' => array(
'type' =>
'integer',
'label' =>
'ProposedRemuneration',
'enabled' => 1,
'position' => 81,
'notnull' => 0,
'visible' => -1,),
120 'description' => array(
'type' =>
'html',
'label' =>
'Description',
'enabled' => 1,
'position' => 300,
'notnull' => 0,
'visible' => 3,
'cssview' =>
'wordbreak'),
121 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -4,
'csslist' =>
'nowraponall'),
122 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,
'csslist' =>
'nowraponall'),
123 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'LinkedToDolibarrUser',
'enabled' => 1,
'position' => 600,
'notnull' => 0,
'visible' => -1,
'csslist' =>
'tdoverflowmax100'),
124 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
125 'model_pdf' => array(
'type' =>
'varchar(255)',
'label' =>
'Model pdf',
'enabled' => 1,
'position' => 1010,
'notnull' => -1,
'visible' => 0,),
126 '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')),
131 public $fk_recruitmentjobposition;
134 public $note_private;
135 public $date_creation;
136 public $fk_user_creat;
137 public $fk_user_modif;
146 public $remuneration_requested;
147 public $remuneration_proposed;
148 public $fk_recruitment_origin;
162 global $conf, $langs;
166 $this->ismultientitymanaged = 1;
167 $this->isextrafieldmanaged = 1;
170 $this->fields[
'rowid'][
'visible'] = 0;
172 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
173 $this->fields[
'entity'][
'enabled'] = 0;
183 foreach ($this->fields as $key => $val) {
184 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
185 unset($this->fields[$key]);
190 if (is_object($langs)) {
191 foreach ($this->fields as $key => $val) {
192 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
193 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
194 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
222 global $langs, $extrafields;
232 $result =
$object->fetchCommon($fromid);
233 if ($result > 0 && !empty(
$object->table_element_line)) {
247 if (property_exists(
$object,
'ref')) {
248 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
250 if (property_exists(
$object,
'label')) {
251 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".
$object->label : $this->fields[
'label'][
'default'];
253 if (property_exists(
$object,
'status')) {
254 $object->status = self::STATUS_DRAFT;
256 if (property_exists(
$object,
'date_creation')) {
259 if (property_exists(
$object,
'date_modification')) {
260 $object->date_modification =
null;
265 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
266 $extrafields->fetch_name_optionals_label($this->table_element);
267 foreach (
$object->array_options as $key => $option) {
268 $shortkey = preg_replace(
'/options_/',
'', $key);
269 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
272 unset(
$object->array_options[$key]);
278 $object->context[
'createfromclone'] =
'createfromclone';
279 $result =
$object->createCommon($user);
283 $this->errors =
$object->errors;
295 if (property_exists($this,
'socid') && $this->socid ==
$object->socid) {
302 unset(
$object->context[
'createfromclone']);
309 $this->db->rollback();
322 public function fetch($id, $ref =
null, $email_msgid =
'')
326 $morewhere =
" AND email_msgid = '".$this->db->escape($email_msgid).
"'";
328 $result = $this->
fetchCommon($id, $ref, $morewhere);
329 if ($result > 0 && !empty($this->table_element_line)) {
342 $this->lines = array();
361 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
369 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
370 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
371 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
373 $sql .=
' WHERE 1 = 1';
380 $this->errors[] = $errormessage;
381 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
385 if (!empty($sortfield)) {
386 $sql .= $this->db->order($sortfield, $sortorder);
388 if (!empty($limit)) {
389 $sql .= $this->db->plimit($limit, $offset);
392 $resql = $this->db->query($sql);
394 $num = $this->db->num_rows($resql);
396 while ($i < ($limit ? min($limit, $num) : $num)) {
397 $obj = $this->db->fetch_object($resql);
399 $record =
new self($this->db);
400 $record->setVarsFromFetchObj($obj);
402 $records[$record->id] = $record;
406 $this->db->free($resql);
410 $this->errors[] =
'Error '.$this->db->lasterror();
411 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
436 public function delete(
User $user, $notrigger = 0)
453 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
470 global $conf, $langs;
472 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
477 if ($this->
status == self::STATUS_VALIDATED) {
478 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
495 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
500 $this->newref = $num;
504 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
505 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
506 $sql .=
" status = ".self::STATUS_VALIDATED;
507 if (!empty($this->fields[
'date_validation'])) {
508 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
510 if (!empty($this->fields[
'fk_user_valid'])) {
511 $sql .=
", fk_user_valid = ".$user->id;
513 $sql .=
" WHERE rowid = ".((int) $this->
id);
515 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
516 $resql = $this->db->query($sql);
519 $this->error = $this->db->lasterror();
523 if (!$error && !$notrigger) {
525 $result = $this->
call_trigger(
'RECRUITMENTCANDIDATURE_VALIDATE', $user);
534 $this->oldref = $this->ref;
537 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
539 $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).
"'";
540 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentcandidature/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
541 $resql = $this->db->query($sql);
544 $this->error = $this->db->lasterror();
546 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'recruitmentcandidature/".$this->db->escape($this->newref).
"'";
547 $sql .=
" WHERE filepath = 'recruitmentcandidature/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
548 $resql = $this->db->query($sql);
551 $this->error = $this->db->lasterror();
557 $dirsource = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$oldref;
558 $dirdest = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref;
559 if (!$error && file_exists($dirsource)) {
560 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
562 if (@rename($dirsource, $dirdest)) {
565 $listoffiles =
dol_dir_list($conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
566 foreach ($listoffiles as $fileentry) {
567 $dirsource = $fileentry[
'name'];
568 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
569 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
570 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
571 @rename($dirsource, $dirdest);
581 $this->
status = self::STATUS_VALIDATED;
588 $this->db->rollback();
604 if ($this->
status <= self::STATUS_DRAFT) {
615 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTCANDIDATURE_UNVALIDATE');
625 public function cancel($user, $notrigger = 0)
628 if ($this->
status != self::STATUS_VALIDATED) {
639 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTCANDIDATURE_CLOSE');
649 public function reopen($user, $notrigger = 0)
652 if ($this->
status != self::STATUS_REFUSED && $this->
status != self::STATUS_CANCELED && $this->
status != self::STATUS_CONTRACT_REFUSED) {
663 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTCANDIDATURE_REOPEN');
675 public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
677 $lastname = $this->lastname;
678 $firstname = $this->firstname;
679 if (empty($lastname)) {
680 $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 :
'')))));
700 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
702 global $conf, $langs, $hookmanager;
704 if (!empty($conf->dol_no_mouse_hover)) {
710 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"RecruitmentCandidature").
'</u>';
711 if (isset($this->
status)) {
712 $label .=
' '.$this->getLibStatut(5);
715 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
716 $label .=
'<br><b>'.$langs->trans(
'Email').
':</b> '.$this->email;
717 $label .=
'<br><b>'.$langs->trans(
'Name').
':</b> '.$this->
getFullName($langs);
719 $url =
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?id='.$this->id;
721 if ($option !=
'nolink') {
723 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
724 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
725 $add_save_lastsearch_values = 1;
727 if ($add_save_lastsearch_values) {
728 $url .=
'&save_lastsearch_values=1';
733 if (empty($notooltip)) {
735 $label = $langs->trans(
"ShowRecruitmentCandidature");
736 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
738 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
739 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
741 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
744 $linkstart =
'<a href="'.$url.
'"';
745 $linkstart .= $linkclose.
'>';
748 $result .= $linkstart;
750 if (empty($this->showphoto_on_popup)) {
752 $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);
756 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
758 list($class, $module) = explode(
'@', $this->picto);
761 $filename = $filearray[0][
'name'];
762 if (!empty($filename)) {
763 $pospoint = strpos($filearray[0][
'name'],
'.');
765 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
767 $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>';
769 $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>';
774 $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);
779 if ($withpicto != 2) {
780 $result .= $this->ref;
786 global $action, $hookmanager;
787 $hookmanager->initHooks(array(
'recruitmentcandidaturedao'));
788 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
789 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
791 $result = $hookmanager->resPrint;
793 $result .= $hookmanager->resPrint;
821 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
824 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
825 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received').
' ('.$langs->transnoentitiesnoconv(
"InterviewToDo").
')';
826 $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
827 $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
828 $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
829 $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
830 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
831 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
832 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received');
833 $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
834 $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
835 $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
836 $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
837 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
840 $statusType =
'status'.$status;
842 if ($status == self::STATUS_CANCELED) {
843 $statusType =
'status9';
845 if ($status == self::STATUS_CONTRACT_PROPOSED) {
846 $statusType =
'status4';
848 if ($status == self::STATUS_CONTRACT_SIGNED) {
849 $statusType =
'status6';
851 if ($status == self::STATUS_REFUSED) {
852 $statusType =
'status10';
855 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
866 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
867 $sql .=
' fk_user_creat, fk_user_modif';
868 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
869 $sql .=
' WHERE t.rowid = '.((int) $id);
870 $result = $this->db->query($sql);
872 if ($this->db->num_rows($result)) {
873 $obj = $this->db->fetch_object($result);
875 $this->
id = $obj->rowid;
877 $this->user_creation_id = $obj->fk_user_creat;
878 $this->user_modification_id = $obj->fk_user_modif;
879 $this->date_creation = $this->db->jdate($obj->datec);
880 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
883 $this->db->free($result);
907 $this->lines = array();
910 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0,
'(fk_recruitmentcandidature:=:'.((
int) $this->
id).
')');
912 if (is_numeric($result)) {
913 $this->error = $objectline->error;
914 $this->errors = $objectline->errors;
917 $this->lines = $result;
929 global $langs, $conf;
930 $langs->load(
"recruitment@recruitment");
933 $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON =
'mod_recruitmentcandidature_standard';
943 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
944 foreach ($dirmodels as $reldir) {
948 $mybool = ((bool) @include_once $dir.$file) || $mybool;
951 if ($mybool ===
false) {
956 if (class_exists($classname)) {
957 $obj =
new $classname();
958 $numref = $obj->getNextValue($this);
960 if ($numref !=
'' && $numref !=
'-1') {
963 $this->error = $obj->error;
968 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
972 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
988 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
990 global $conf, $langs;
993 $includedocgeneration = 0;
995 $langs->load(
"recruitment@recruitment");
1005 $modelpath =
"core/modules/recruitment/doc/";
1007 if ($includedocgeneration && !empty($modele)) {
1008 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1023 global $conf, $langs;
1039 $this->db->commit();
1055 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1057 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1058 $return .=
'<div class="info-box info-box-sm">';
1059 $return .=
'<span class="info-box-icon bg-infobox-action">';
1061 $return .=
'</span>';
1062 $return .=
'<div class="info-box-content">';
1063 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1064 if ($selected >= 0) {
1065 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1067 if (property_exists($this,
'fk_recruitmentjobposition')) {
1071 $return .=
'<div class="info-box-label tdoverflowmax150">';
1073 $tmpjob->fetch($this->fk_recruitmentjobposition);
1076 $return .=
'</div>';
1078 if (property_exists($this,
'phone') && $this->phone) {
1079 $return .=
'<div class="info-box-label small">'.dol_print_phone($this->phone, $mysoc->country_code, 0, 0,
'AC_TEL',
' ',
'phone').
'</div>';
1081 if (property_exists($this,
'email') && $this->email) {
1082 $return .=
'<div class="info-box-label small">'.dol_print_email($this->email, 0, 0, 1, 64, 1, 1).
'</div>';
1084 if (method_exists($this,
'getLibStatut')) {
1085 $return .=
'<div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1087 $return .=
'</div>';
1088 $return .=
'</div>';
1089 $return .=
'</div>';
1095require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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.
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.
call_trigger($triggerName, $user)
Call trigger based on this instance.
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 clicable 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)
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
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.
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.
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dol_now($mode='auto')
Return date for now.
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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 dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.