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 = 1;
58 public $isextrafieldmanaged = 1;
63 public $picto =
'recruitmentcandidature';
68 public $email_fields_no_propagate_in_actioncomm;
71 const STATUS_DRAFT = 0;
72 const STATUS_VALIDATED = 1;
74 const STATUS_CONTRACT_PROPOSED = 3;
75 const STATUS_CONTRACT_SIGNED = 5;
76 const STATUS_CONTRACT_REFUSED = 6;
77 const STATUS_REFUSED = 8;
78 const STATUS_CANCELED = 9;
110 public $fields = array(
111 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'comment'=>
"Id"),
112 'entity' => array(
'type'=>
'integer',
'label'=>
'Entity',
'enabled'=>1,
'visible'=>0,
'position'=>5,
'notnull'=>1,
'default'=>
'1',
'index'=>1),
113 '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'),
114 'fk_recruitmentjobposition' => array(
'type'=>
'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php',
'label'=>
'Job',
'enabled'=>
'1',
'position'=>15,
'notnull'=>0,
'visible'=>1,
'index'=>1,
'picto'=>
'recruitmentjobposition',
'css'=>
'minwidth300 maxwidth500 widthcentpercentminusx',
'csslist'=>
'minwidth100 nowraponall'),
115 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>0,),
116 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>0,),
117 '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'),
118 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,
'csslist'=>
'tdoverflowmax100'),
119 'lastname' => array(
'type'=>
'varchar(128)',
'label'=>
'Lastname',
'enabled'=>
'1',
'position'=>20,
'notnull'=>0,
'visible'=>1,
'csslist'=>
'tdoverflowmax150'),
120 'firstname' => array(
'type'=>
'varchar(128)',
'label'=>
'Firstname',
'enabled'=>
'1',
'position'=>21,
'notnull'=>0,
'visible'=>1,
'csslist'=>
'tdoverflowmax150'),
121 'email' => array(
'type'=>
'email',
'label'=>
'EMail',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'picto'=>
'email',
'csslist'=>
'tdoverflowmax150'),
122 'phone' => array(
'type'=>
'phone',
'label'=>
'Phone',
'enabled'=>
'1',
'position'=>31,
'notnull'=>0,
'visible'=>1,
'picto'=>
'phone',
'csslist'=>
'tdoverflowmax150'),
123 'date_birth' => array(
'type'=>
'date',
'label'=>
'DateOfBirth',
'enabled'=>
'1',
'position'=>70,
'visible'=>-1,),
124 'email_msgid' => array(
'type'=>
'varchar(255)',
'label'=>
'EmailMsgID',
'visible'=>-2,
'enabled'=>1,
'position'=>540,
'notnull'=>-1,
'help'=>
'EmailMsgIDDesc'),
125 'email_date' => array(
'type'=>
'datetime',
'label'=>
'EmailDate',
'visible'=>-2,
'enabled'=>1,
'position'=>541),
127 'remuneration_requested' => array(
'type'=>
'integer',
'label'=>
'RequestedRemuneration',
'enabled'=>
'1',
'position'=>80,
'notnull'=>0,
'visible'=>-1,),
128 'remuneration_proposed' => array(
'type'=>
'integer',
'label'=>
'ProposedRemuneration',
'enabled'=>
'1',
'position'=>81,
'notnull'=>0,
'visible'=>-1,),
129 'description' => array(
'type'=>
'html',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>300,
'notnull'=>0,
'visible'=>3,
'cssview'=>
'wordbreak'),
130 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-4,
'csslist'=>
'nowraponall'),
131 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,
'csslist'=>
'nowraponall'),
132 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
133 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
134 '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')),
139 public $fk_recruitmentjobposition;
142 public $note_private;
143 public $date_creation;
145 public $fk_user_creat;
146 public $fk_user_modif;
154 public $remuneration_requested;
155 public $remuneration_proposed;
156 public $fk_recruitment_origin;
170 global $conf, $langs;
174 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
175 $this->fields[
'rowid'][
'visible'] = 0;
177 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
178 $this->fields[
'entity'][
'enabled'] = 0;
188 foreach ($this->fields as $key => $val) {
189 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
190 unset($this->fields[$key]);
195 if (is_object($langs)) {
196 foreach ($this->fields as $key => $val) {
197 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
198 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
199 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
227 global $langs, $extrafields;
232 $object =
new self($this->db);
237 $result = $object->fetchCommon($fromid);
238 if ($result > 0 && !empty($object->table_element_line)) {
239 $object->fetchLines();
248 unset($object->fk_user_creat);
249 unset($object->import_key);
252 if (property_exists($object,
'ref')) {
253 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
255 if (property_exists($object,
'label')) {
256 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
258 if (property_exists($object,
'status')) {
259 $object->status = self::STATUS_DRAFT;
261 if (property_exists($object,
'date_creation')) {
262 $object->date_creation =
dol_now();
264 if (property_exists($object,
'date_modification')) {
265 $object->date_modification =
null;
270 if (is_array($object->array_options) && count($object->array_options) > 0) {
271 $extrafields->fetch_name_optionals_label($this->table_element);
272 foreach ($object->array_options as $key => $option) {
273 $shortkey = preg_replace(
'/options_/',
'', $key);
274 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
277 unset($object->array_options[$key]);
283 $object->context[
'createfromclone'] =
'createfromclone';
284 $result = $object->createCommon($user);
287 $this->error = $object->error;
288 $this->errors = $object->errors;
300 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
307 unset($object->context[
'createfromclone']);
314 $this->
db->rollback();
327 public function fetch($id, $ref =
null, $email_msgid =
'')
331 $morewhere =
" AND email_msgid = '".$this->db->escape($email_msgid).
"'";
333 $result = $this->
fetchCommon($id, $ref, $morewhere);
334 if ($result > 0 && !empty($this->table_element_line)) {
347 $this->lines = array();
365 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
375 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
376 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
377 $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
379 $sql .=
' WHERE 1 = 1';
383 if (count($filter) > 0) {
384 foreach ($filter as $key => $value) {
385 if ($key ==
't.rowid') {
386 $sqlwhere[] = $key.
" = ".((int) $value);
387 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
388 $sqlwhere[] = $key.
" = '".$this->
db->idate($value).
"'";
389 } elseif ($key ==
'customsql') {
390 $sqlwhere[] = $value;
391 } elseif (strpos($value,
'%') ===
false) {
392 $sqlwhere[] = $key.
" IN (".$this->
db->sanitize($this->
db->escape($value)).
")";
394 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
398 if (count($sqlwhere) > 0) {
399 $sql .=
' AND ('.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
402 if (!empty($sortfield)) {
403 $sql .= $this->
db->order($sortfield, $sortorder);
405 if (!empty($limit)) {
406 $sql .= $this->
db->plimit($limit, $offset);
413 while ($i < ($limit ? min($limit, $num) : $num)) {
414 $obj = $this->
db->fetch_object(
$resql);
416 $record =
new self($this->db);
417 $record->setVarsFromFetchObj($obj);
419 $records[$record->id] = $record;
427 $this->errors[] =
'Error '.$this->db->lasterror();
428 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
453 public function delete(
User $user, $notrigger =
false)
469 if ($this->status < 0) {
470 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
487 global $conf, $langs;
489 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
494 if ($this->status == self::STATUS_VALIDATED) {
495 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
512 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
517 $this->newref = $num;
521 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
522 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
523 $sql .=
" status = ".self::STATUS_VALIDATED;
524 if (!empty($this->fields[
'date_validation'])) {
525 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
527 if (!empty($this->fields[
'fk_user_valid'])) {
528 $sql .=
", fk_user_valid = ".$user->id;
530 $sql .=
" WHERE rowid = ".((int) $this->
id);
532 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
536 $this->error = $this->
db->lasterror();
540 if (!$error && !$notrigger) {
542 $result = $this->
call_trigger(
'RECRUITMENTCANDIDATURE_VALIDATE', $user);
551 $this->oldref = $this->ref;
554 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
556 $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).
"'";
557 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentcandidature/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
560 $error++; $this->error = $this->
db->lasterror();
566 $dirsource = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$oldref;
567 $dirdest = $conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref;
568 if (!$error && file_exists($dirsource)) {
569 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
571 if (@rename($dirsource, $dirdest)) {
574 $listoffiles =
dol_dir_list($conf->recruitment->dir_output.
'/recruitmentcandidature/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
575 foreach ($listoffiles as $fileentry) {
576 $dirsource = $fileentry[
'name'];
577 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
578 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
579 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
580 @rename($dirsource, $dirdest);
590 $this->status = self::STATUS_VALIDATED;
597 $this->
db->rollback();
613 if ($this->status <= self::STATUS_DRAFT) {
624 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTCANDIDATURE_UNVALIDATE');
634 public function cancel($user, $notrigger = 0)
637 if ($this->status != self::STATUS_VALIDATED) {
648 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTCANDIDATURE_CLOSE');
658 public function reopen($user, $notrigger = 0)
661 if ($this->status != self::STATUS_REFUSED && $this->status != self::STATUS_CANCELED && $this->status != self::STATUS_CONTRACT_REFUSED) {
672 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTCANDIDATURE_REOPEN');
685 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
687 global $conf, $langs, $hookmanager;
689 if (!empty($conf->dol_no_mouse_hover)) {
695 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"RecruitmentCandidature").
'</u>';
696 if (isset($this->status)) {
697 $label .=
' '.$this->getLibStatut(5);
700 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
701 $label .=
'<br><b>'.$langs->trans(
'Email').
':</b> '.$this->email;
702 $label .=
'<br><b>'.$langs->trans(
'Name').
':</b> '.$this->
getFullName($langs);
704 $url =
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?id='.$this->id;
706 if ($option !=
'nolink') {
708 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
709 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
710 $add_save_lastsearch_values = 1;
712 if ($add_save_lastsearch_values) {
713 $url .=
'&save_lastsearch_values=1';
718 if (empty($notooltip)) {
719 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
720 $label = $langs->trans(
"ShowRecruitmentCandidature");
721 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
723 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
724 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
726 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
729 $linkstart =
'<a href="'.$url.
'"';
730 $linkstart .= $linkclose.
'>';
733 $result .= $linkstart;
735 if (empty($this->showphoto_on_popup)) {
737 $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);
741 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
743 list($class, $module) = explode(
'@', $this->picto);
746 $filename = $filearray[0][
'name'];
747 if (!empty($filename)) {
748 $pospoint = strpos($filearray[0][
'name'],
'.');
750 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
751 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
752 $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>';
754 $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>';
759 $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);
764 if ($withpicto != 2) {
765 $result .= $this->ref;
771 global $action, $hookmanager;
772 $hookmanager->initHooks(array(
'recruitmentcandidaturedao'));
773 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
774 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
776 $result = $hookmanager->resPrint;
778 $result .= $hookmanager->resPrint;
792 return $this->LibStatut($this->status, $mode);
806 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
809 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
810 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received').
' ('.$langs->transnoentitiesnoconv(
"InterviewToDo").
')';
811 $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
812 $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
813 $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
814 $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
815 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
816 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
817 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Received');
818 $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv(
'ContractProposed');
819 $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv(
'ContractSigned');
820 $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv(
'ContractRefused');
821 $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv(
'Refused');
822 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
825 $statusType =
'status'.$status;
827 if ($status == self::STATUS_CANCELED) {
828 $statusType =
'status9';
830 if ($status == self::STATUS_CONTRACT_PROPOSED) {
831 $statusType =
'status4';
833 if ($status == self::STATUS_CONTRACT_SIGNED) {
834 $statusType =
'status6';
836 if ($status == self::STATUS_REFUSED) {
837 $statusType =
'status10';
840 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
851 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
852 $sql .=
' fk_user_creat, fk_user_modif';
853 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
854 $sql .=
' WHERE t.rowid = '.((int) $id);
855 $result = $this->
db->query($sql);
857 if ($this->
db->num_rows($result)) {
858 $obj = $this->
db->fetch_object($result);
859 $this->
id = $obj->rowid;
861 $this->user_creation_id = $obj->fk_user_creat;
862 $this->user_modification_id = $obj->fk_user_modif;
863 $this->date_creation = $this->
db->jdate($obj->datec);
864 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
867 $this->
db->free($result);
881 $this->initAsSpecimenCommon();
891 $this->lines = array();
894 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_recruitmentcandidature = '.((
int) $this->
id)));
896 if (is_numeric($result)) {
897 $this->error = $objectline->error;
898 $this->errors = $objectline->errors;
901 $this->lines = $result;
913 global $langs, $conf;
914 $langs->load(
"recruitment@recruitment");
916 if (empty($conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON)) {
917 $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON =
'mod_recruitmentcandidature_standard';
920 if (!empty($conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON)) {
923 $file = $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON.
".php";
924 $classname = $conf->global->RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON;
927 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
928 foreach ($dirmodels as $reldir) {
932 $mybool |= @include_once $dir.$file;
935 if ($mybool ===
false) {
940 if (class_exists($classname)) {
941 $obj =
new $classname();
942 $numref = $obj->getNextValue($this);
944 if ($numref !=
'' && $numref !=
'-1') {
947 $this->error = $obj->error;
952 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
956 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
972 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
974 global $conf, $langs;
977 $includedocgeneration = 0;
979 $langs->load(
"recruitment@recruitment");
982 if (!empty($conf->global->RECRUITMENTCANDIDATURE_ADDON_PDF)) {
983 $modele = $conf->global->RECRUITMENTCANDIDATURE_ADDON_PDF;
989 $modelpath =
"core/modules/recruitment/doc/";
991 if ($includedocgeneration && !empty($modele)) {
992 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1007 global $conf, $langs;
1023 $this->
db->commit();
1030 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
getFieldList($alias='')
Function to concat keys of fields.
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name (civility+' '+name+' '+lastname)
fetchCommon($id, $ref=null, $morewhere='')
Load object in memory from the database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='')
Load object in memory from the 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.
create(User $user, $notrigger=false)
Create object into database.
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.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly 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.
update(User $user, $notrigger=false)
Update object into database.
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.
validate($user, $notrigger=0)
Validate object.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
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.
setDraft($user, $notrigger=0)
Set draft status.
info($id)
Load the info information in the object.
Class RecruitmentCandidatureLine.
__construct(DoliDB $db)
Constructor.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.