25 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
37 public $module =
'recruitment';
42 public $element =
'recruitmentcandidature';
47 public $table_element =
'recruitment_recruitmentcandidature';
53 public $ismultientitymanaged = 0;
58 public $isextrafieldmanaged = 1;
63 public $picto =
'recruitmentcandidature';
66 const STATUS_DRAFT = 0;
67 const STATUS_VALIDATED = 1;
69 const STATUS_CONTRACT_PROPOSED = 3;
70 const STATUS_CONTRACT_SIGNED = 5;
71 const STATUS_CONTRACT_REFUSED = 6;
72 const STATUS_REFUSED = 8;
73 const STATUS_CANCELED = 9;
105 public $fields = array(
106 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'comment'=>
"Id"),
107 'entity' => array(
'type'=>
'integer',
'label'=>
'Entity',
'enabled'=>1,
'visible'=>0,
'position'=>5,
'notnull'=>1,
'default'=>
'1',
'index'=>1),
108 '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"),
109 'fk_recruitmentjobposition' => array(
'type'=>
'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php',
'label'=>
'Job',
'enabled'=>
'1',
'position'=>15,
'notnull'=>0,
'visible'=>1,
'index'=>1),
110 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>0,),
111 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>0,),
112 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,),
113 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
114 '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',),
115 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
116 'lastname' => array(
'type'=>
'varchar(128)',
'label'=>
'Lastname',
'enabled'=>
'1',
'position'=>20,
'notnull'=>0,
'visible'=>1,),
117 'firstname' => array(
'type'=>
'varchar(128)',
'label'=>
'Firstname',
'enabled'=>
'1',
'position'=>21,
'notnull'=>0,
'visible'=>1,),
118 'email' => array(
'type'=>
'varchar(255)',
'label'=>
'EMail',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'picto'=>
'email'),
119 'phone' => array(
'type'=>
'varchar(64)',
'label'=>
'Phone',
'enabled'=>
'1',
'position'=>31,
'notnull'=>0,
'visible'=>1,),
120 'date_birth' => array(
'type'=>
'date',
'label'=>
'DateOfBirth',
'enabled'=>
'1',
'position'=>70,
'visible'=>-1,),
121 'email_msgid' => array(
'type'=>
'varchar(255)',
'label'=>
'EmailMsgID',
'visible'=>-2,
'enabled'=>1,
'position'=>540,
'notnull'=>-1,
'help'=>
'EmailMsgIDDesc'),
123 'remuneration_requested' => array(
'type'=>
'integer',
'label'=>
'RequestedRemuneration',
'enabled'=>
'1',
'position'=>80,
'notnull'=>0,
'visible'=>-1,),
124 'remuneration_proposed' => array(
'type'=>
'integer',
'label'=>
'ProposedRemuneration',
'enabled'=>
'1',
'position'=>81,
'notnull'=>0,
'visible'=>-1,),
125 'description' => array(
'type'=>
'html',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>500,
'notnull'=>0,
'visible'=>3,),
126 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
127 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
128 'status' => array(
'type'=>
'smallint',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'default'=>0,
'arrayofkeyval'=>array(
'0'=>
'Draft',
'1'=>
'Received',
'3'=>
'ContractProposed',
'5'=>
'ContractSigned',
'8'=>
'Refused',
'9'=>
'Canceled')),
133 public $fk_recruitmentjobposition;
136 public $note_private;
137 public $date_creation;
139 public $fk_user_creat;
140 public $fk_user_modif;
147 public $remuneration_requested;
148 public $remuneration_proposed;
149 public $fk_recruitment_origin;
163 global $conf, $langs;
167 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->
fields[
'rowid'])) $this->
fields[
'rowid'][
'visible'] = 0;
168 if (empty($conf->multicompany->enabled) && isset($this->
fields[
'entity'])) $this->
fields[
'entity'][
'enabled'] = 0;
177 foreach ($this->
fields as $key => $val)
179 if (isset($val[
'enabled']) && empty($val[
'enabled']))
181 unset($this->
fields[$key]);
186 if (is_object($langs))
188 foreach ($this->
fields as $key => $val)
190 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval']))
192 foreach ($val[
'arrayofkeyval'] as $key2 => $val2)
194 $this->
fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
222 global $langs, $extrafields;
227 $object =
new self($this->db);
232 $result = $object->fetchCommon($fromid);
233 if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines();
241 unset($object->fk_user_creat);
242 unset($object->import_key);
245 if (property_exists($object,
'ref')) $object->ref = empty($this->
fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->
fields[
'ref'][
'default'];
246 if (property_exists($object,
'label')) $object->label = empty($this->
fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->
fields[
'label'][
'default'];
247 if (property_exists($object,
'status')) { $object->status = self::STATUS_DRAFT; }
248 if (property_exists($object,
'date_creation')) { $object->date_creation =
dol_now(); }
249 if (property_exists($object,
'date_modification')) { $object->date_modification = null; }
253 if (is_array($object->array_options) && count($object->array_options) > 0)
255 $extrafields->fetch_name_optionals_label($this->table_element);
256 foreach ($object->array_options as $key => $option)
258 $shortkey = preg_replace(
'/options_/',
'', $key);
259 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey]))
262 unset($object->array_options[$key]);
268 $object->context[
'createfromclone'] =
'createfromclone';
269 $result = $object->createCommon($user);
272 $this->error = $object->error;
273 $this->errors = $object->errors;
288 if (property_exists($this,
'socid') && $this->socid == $object->socid)
295 unset($object->context[
'createfromclone']);
302 $this->
db->rollback();
315 public function fetch($id, $ref = null, $email_msgid =
'')
318 if ($email_msgid) $morewhere =
" AND email_msgid = '".$this->db->escape($email_msgid).
"'";
319 $result = $this->
fetchCommon($id, $ref, $morewhere);
320 if ($result > 0 && !empty($this->table_element_line)) $this->
fetchLines();
331 $this->lines = array();
349 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
359 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
360 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
361 else $sql .=
' WHERE 1 = 1';
364 if (count($filter) > 0) {
365 foreach ($filter as $key => $value) {
366 if ($key ==
't.rowid') {
367 $sqlwhere[] = $key.
'='.$value;
368 } elseif (in_array($this->
fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
369 $sqlwhere[] = $key.
' = \''.$this->
db->idate($value).
'\'';
370 } elseif ($key ==
'customsql') {
371 $sqlwhere[] = $value;
372 } elseif (strpos($value,
'%') ===
false) {
373 $sqlwhere[] = $key.
' IN ('.$this->
db->sanitize($this->
db->escape($value)).
')';
375 $sqlwhere[] = $key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
379 if (count($sqlwhere) > 0) {
380 $sql .=
' AND ('.implode(
' '.$filtermode.
' ', $sqlwhere).
')';
383 if (!empty($sortfield)) {
384 $sql .= $this->
db->order($sortfield, $sortorder);
386 if (!empty($limit)) {
387 $sql .=
' '.$this->db->plimit($limit, $offset);
394 while ($i < ($limit ? min($limit, $num) : $num))
396 $obj = $this->
db->fetch_object(
$resql);
398 $record =
new self($this->db);
399 $record->setVarsFromFetchObj($obj);
401 $records[$record->id] = $record;
409 $this->errors[] =
'Error '.$this->db->lasterror();
410 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
435 public function delete(
User $user, $notrigger =
false)
451 if ($this->status < 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)
479 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
496 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->ref) || empty($this->ref)))
502 $this->newref = $num;
506 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
507 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
508 $sql .=
" status = ".self::STATUS_VALIDATED;
509 if (!empty($this->
fields[
'date_validation'])) $sql .=
", date_validation = '".$this->db->idate($now).
"',";
510 if (!empty($this->
fields[
'fk_user_valid'])) $sql .=
", fk_user_valid = ".$user->id;
511 $sql .=
" WHERE rowid = ".$this->id;
513 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
518 $this->error = $this->
db->lasterror();
522 if (!$error && !$notrigger)
525 $result = $this->
call_trigger(
'RECRUITMENTCANDIDATURE_VALIDATE', $user);
526 if ($result < 0) $error++;
533 $this->oldref = $this->ref;
536 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;
542 if (!
$resql) { $error++; $this->error = $this->
db->lasterror(); }
547 $dirsource = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$oldref;
548 $dirdest = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref;
549 if (!$error && file_exists($dirsource))
551 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
553 if (@rename($dirsource, $dirdest))
557 $listoffiles =
dol_dir_list($conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
558 foreach ($listoffiles as $fileentry)
560 $dirsource = $fileentry[
'name'];
561 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
562 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
563 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
564 @rename($dirsource, $dirdest);
575 $this->status = self::STATUS_VALIDATED;
583 $this->
db->rollback();
599 if ($this->status <= self::STATUS_DRAFT)
611 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTCANDIDATURE_UNVALIDATE');
621 public function cancel($user, $notrigger = 0)
624 if ($this->status != self::STATUS_VALIDATED)
636 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTCANDIDATURE_CLOSE');
646 public function reopen($user, $notrigger = 0)
649 if ($this->status != self::STATUS_REFUSED && $this->status != self::STATUS_CANCELED && $this->status != self::STATUS_CONTRACT_REFUSED)
661 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTCANDIDATURE_REOPEN');
674 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
676 global $conf, $langs, $hookmanager;
678 if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1;
682 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"RecruitmentCandidature").
'</u>';
683 if (isset($this->status)) {
684 $label .=
' '.$this->getLibStatut(5);
687 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
688 $label .=
'<br><b>'.$langs->trans(
'Email').
':</b> '.$this->email;
689 $label .=
'<br><b>'.$langs->trans(
'Name').
':</b> '.$this->
getFullName($langs);
691 $url =
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?id='.$this->id;
693 if ($option !=
'nolink')
696 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
697 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/',
$_SERVER[
"PHP_SELF"])) $add_save_lastsearch_values = 1;
698 if ($add_save_lastsearch_values) $url .=
'&save_lastsearch_values=1';
702 if (empty($notooltip))
704 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
706 $label = $langs->trans(
"ShowRecruitmentCandidature");
707 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
709 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
710 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
711 }
else $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
713 $linkstart =
'<a href="'.$url.
'"';
714 $linkstart .= $linkclose.
'>';
717 $result .= $linkstart;
719 if (empty($this->showphoto_on_popup)) {
720 if ($withpicto) $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);
723 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
725 list($class, $module) = explode(
'@', $this->picto);
726 $upload_dir = $conf->$module->multidir_output[$conf->entity].
"/$class/".
dol_sanitizeFileName($this->ref);
728 $filename = $filearray[0][
'name'];
729 if (!empty($filename)) {
730 $pospoint = strpos($filearray[0][
'name'],
'.');
732 $pathtophoto = $class.
'/'.$this->ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
733 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
734 $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>';
736 $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>';
741 $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);
746 if ($withpicto != 2) $result .= $this->ref;
751 global $action, $hookmanager;
752 $hookmanager->initHooks(array(
'recruitmentcandidaturedao'));
753 $parameters = array(
'id'=>$this->
id,
'getnomurl'=>$result);
754 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
755 if ($reshook > 0) $result = $hookmanager->resPrint;
756 else $result .= $hookmanager->resPrint;
769 return $this->LibStatut($this->status, $mode);
783 if (empty($this->labelStatus) || empty($this->labelStatusShort))
787 $this->labelStatus[self::STATUS_DRAFT] = $langs->trans(
'Draft');
788 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Received').
' ('.$langs->trans(
"InterviewToDo").
')';
789 $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->trans(
'ContractProposed');
790 $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->trans(
'ContractSigned');
791 $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->trans(
'ContractRefused');
792 $this->labelStatus[self::STATUS_REFUSED] = $langs->trans(
'Refused');
793 $this->labelStatus[self::STATUS_CANCELED] = $langs->trans(
'Canceled');
794 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans(
'Draft');
795 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans(
'Received');
796 $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->trans(
'ContractProposed');
797 $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->trans(
'ContractSigned');
798 $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->trans(
'ContractRefused');
799 $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans(
'Refused');
800 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans(
'Canceled');
803 $statusType =
'status'.$status;
805 if ($status == self::STATUS_CANCELED) $statusType =
'status6';
807 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
818 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
819 $sql .=
' fk_user_creat, fk_user_modif';
820 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
821 $sql .=
' WHERE t.rowid = '.$id;
822 $result = $this->
db->query($sql);
825 if ($this->
db->num_rows($result))
827 $obj = $this->
db->fetch_object($result);
828 $this->
id = $obj->rowid;
829 if ($obj->fk_user_author)
831 $cuser =
new User($this->
db);
832 $cuser->fetch($obj->fk_user_author);
833 $this->user_creation = $cuser;
836 if ($obj->fk_user_valid)
838 $vuser =
new User($this->
db);
839 $vuser->fetch($obj->fk_user_valid);
840 $this->user_validation = $vuser;
843 if ($obj->fk_user_cloture)
845 $cluser =
new User($this->
db);
846 $cluser->fetch($obj->fk_user_cloture);
847 $this->user_cloture = $cluser;
850 $this->date_creation = $this->
db->jdate($obj->datec);
851 $this->date_modification = $this->
db->jdate($obj->datem);
852 $this->date_validation = $this->
db->jdate($obj->datev);
855 $this->
db->free($result);
869 $this->initAsSpecimenCommon();
879 $this->lines = array();
882 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_recruitmentcandidature = '.$this->
id));
884 if (is_numeric($result))
886 $this->error = $this->error;
887 $this->errors = $this->errors;
890 $this->lines = $result;
902 global $langs, $conf;
903 $langs->load(
"recruitment@recruitment");
905 if (empty($conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON)) {
906 $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON =
'mod_recruitmentcandidature_standard';
909 if (!empty($conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON))
913 $file = $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON.
".php";
914 $classname = $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON;
917 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
918 foreach ($dirmodels as $reldir)
923 $mybool |= @include_once $dir.$file;
926 if ($mybool ===
false)
932 if (class_exists($classname)) {
933 $obj =
new $classname();
934 $numref = $obj->getNextValue($this);
936 if ($numref !=
'' && $numref !=
'-1')
940 $this->error = $obj->error;
945 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
949 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
965 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
967 global $conf, $langs;
970 $includedocgeneration = 0;
972 $langs->load(
"recruitment@recruitment");
975 if (!empty($conf->global->RECRUITMENTCANDIDATURE_ADDON_PDF))
977 $modele = $conf->global->RECRUITMENTCANDIDATURE_ADDON_PDF;
983 $modelpath =
"core/modules/recruitment/doc/";
985 if ($includedocgeneration && !empty($modele)) {
986 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1001 global $conf, $langs;
1017 $this->
db->commit();
1024 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
info($id)
Load the info information in the object.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
reopen($user, $notrigger=0)
Set back to validated status.
getLibStatut($mode=0)
Return label of the status.
create(User $user, $notrigger=false)
Create object into database.
__construct(DoliDB $db)
Constructor.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
fetchLinesCommon($morewhere= '')
Load object in memory from the database.
fetch($id, $ref=null, $email_msgid= '')
Load object 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.
foreach($object->fields as $key=> $val) if(is_array($extrafields->attributes[$object->table_element]['label'])&&count($extrafields->attributes[$object->table_element]['label']) > 0) $object fields
Class RecruitmentCandidatureLine.
dol_now($mode= 'auto')
Return date for now.
validate($user, $notrigger=0)
Validate object.
Class to manage Dolibarr users.
Class to manage Dolibarr database access.
update(User $user, $notrigger=false)
Update object into database.
createCommon(User $user, $notrigger=false)
Create object into database.
createFromClone(User $user, $fromid)
Clone an object into another one.
fetchLines()
Load object lines in memory from the database.
getNomUrl($withpicto=0, $option= '', $notooltip=0, $morecss= '', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name (civility+' '+name+' '+lastname)
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module...
$conf db
API class for accounts.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
getLinesArray()
Create an array of lines.
LibStatut($status, $mode=0)
Return the status.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
fetchAll($sortorder= '', $sortfield= '', $limit=0, $offset=0, array $filter=array(), $filtermode= 'AND')
Load list of objects in memory from the database.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
cancel($user, $notrigger=0)
Set cancel status.
updateCommon(User $user, $notrigger=false)
Update object into database.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
setDraft($user, $notrigger=0)
Set draft status.
print $_SERVER["PHP_SELF"]
Edit parameters.
Class for RecruitmentCandidature.
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
copy_linked_contact($objFrom, $source= 'internal')
Copy contact from one element to current.
print
Draft customers invoices.
call_trigger($triggerName, $user)
Call trigger based on this instance.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
__construct(DoliDB $db)
Constructor.
setStatusCommon($user, $status, $notrigger=0, $triggercode= '')
Set to a status.
getFieldList()
Function to concat keys of fields.
dolGetStatus($statusLabel= '', $statusLabelShort= '', $html= '', $statusType= 'status0', $displayMode=0, $url= '', $params=array())
Output the badge of a status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
fetchCommon($id, $ref=null, $morewhere= '')
Load object in memory from the database.