25 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
37 public $module =
'recruitment';
42 public $element =
'recruitmentjobposition';
47 public $table_element =
'recruitment_recruitmentjobposition';
53 public $ismultientitymanaged = 1;
58 public $isextrafieldmanaged = 1;
63 public $picto =
'recruitmentjobposition';
66 const STATUS_DRAFT = 0;
67 const STATUS_VALIDATED = 1;
68 const STATUS_RECRUITED = 3;
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 object",
'css'=>
'nowraponall'),
105 'label' => array(
'type'=>
'varchar(255)',
'label'=>
'JobLabel',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'searchall'=>1,
'css'=>
'minwidth500',
'csslist'=>
'tdoverflowmax300',
'showoncombobox'=>
'2',
'autofocusoncreate'=>1),
106 'qty' => array(
'type'=>
'integer',
'label'=>
'NbOfEmployeesExpected',
'enabled'=>
'1',
'position'=>45,
'notnull'=>1,
'visible'=>1,
'default'=>
'1',
'isameasure'=>
'1',
'css'=>
'maxwidth75imp'),
107 'fk_project' => array(
'type'=>
'integer:Project:projet/class/project.class.php:1',
'label'=>
'Project',
'enabled'=>
'$conf->project->enabled',
'position'=>52,
'notnull'=>-1,
'visible'=>-1,
'index'=>1,
'css'=>
'maxwidth500',
'picto'=>
'project'),
108 'fk_user_recruiter' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'ResponsibleOfRecruitement',
'enabled'=>
'1',
'position'=>54,
'notnull'=>1,
'visible'=>1,
'foreignkey'=>
'user.rowid',
'css'=>
'maxwidth500',
'csslist'=>
'tdoverflowmax150',
'picto'=>
'user'),
109 'email_recruiter' => array(
'type'=>
'varchar(255)',
'label'=>
'EmailRecruiter',
'enabled'=>
'1',
'position'=>54,
'notnull'=>0,
'visible'=>-1,
'help'=>
'ToUseAGenericEmail',
'picto'=>
'email'),
110 'fk_user_supervisor' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'FutureManager',
'enabled'=>
'1',
'position'=>55,
'notnull'=>0,
'visible'=>-1,
'foreignkey'=>
'user.rowid',
'css'=>
'maxwidth500',
'csslist'=>
'tdoverflowmax150',
'picto'=>
'user'),
111 'fk_establishment' => array(
'type'=>
'integer:Establishment:hrm/class/establishment.class.php',
'label'=>
'Establishment',
'enabled'=>
'$conf->hrm->enabled',
'position'=>56,
'notnull'=>0,
'visible'=>-1,
'foreignkey'=>
'establishment.rowid',),
112 'fk_soc' => array(
'type'=>
'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)',
'label'=>
'WorkPlace',
'enabled'=>
'$conf->societe->enabled',
'position'=>57,
'notnull'=>-1,
'visible'=>-1,
'css'=>
'maxwidth500',
'index'=>1,
'help'=>
"IfJobIsLocatedAtAPartner",
'picto'=>
'company'),
113 'date_planned' => array(
'type'=>
'date',
'label'=>
'DateExpected',
'enabled'=>
'1',
'position'=>60,
'notnull'=>0,
'visible'=>1,),
114 'remuneration_suggested' => array(
'type'=>
'varchar(255)',
'label'=>
'Remuneration',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>1,),
115 'description' => array(
'type'=>
'html',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>65,
'notnull'=>0,
'visible'=>3,),
116 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>101,
'notnull'=>0,
'visible'=>0,),
117 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>102,
'notnull'=>0,
'visible'=>0,),
118 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-4,),
119 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
120 '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',),
121 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
122 'last_main_doc' => array(
'type'=>
'varchar(255)',
'label'=>
'LastMainDoc',
'enabled'=>
'1',
'position'=>900,
'notnull'=>0,
'visible'=>0,),
123 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
124 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
125 'status' => array(
'type'=>
'smallint',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>1,
'visible'=>5,
'default'=>
'0',
'index'=>1,
'arrayofkeyval'=>array(
'0'=>
'Draft',
'1'=>
'Validated',
'3'=>
'Recruited',
'9'=>
'Canceled'),),
142 public $fk_user_recruiter;
147 public $email_recruiter;
152 public $remuneration_suggested;
154 public $fk_user_supervisor;
155 public $fk_establishment;
156 public $date_planned;
159 public $note_private;
160 public $date_creation;
162 public $fk_user_creat;
163 public $fk_user_modif;
164 public $last_main_doc;
178 global $conf, $langs;
182 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
183 $this->fields[
'rowid'][
'visible'] = 0;
185 if (empty($conf->multicompany->enabled) && isset($this->fields[
'entity'])) {
186 $this->fields[
'entity'][
'enabled'] = 0;
196 foreach ($this->fields as $key => $val) {
197 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
198 unset($this->fields[$key]);
203 if (is_object($langs)) {
204 foreach ($this->fields as $key => $val) {
205 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
206 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
207 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
235 global $langs, $extrafields;
240 $object =
new self($this->db);
245 $result = $object->fetchCommon($fromid);
246 if ($result > 0 && !empty($object->table_element_line)) {
247 $object->fetchLines();
256 unset($object->fk_user_creat);
257 unset($object->import_key);
260 if (property_exists($object,
'ref')) {
261 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
263 if (property_exists($object,
'label')) {
264 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
266 if (property_exists($object,
'status')) {
267 $object->status = self::STATUS_DRAFT;
269 if (property_exists($object,
'date_creation')) {
270 $object->date_creation =
dol_now();
272 if (property_exists($object,
'date_modification')) {
273 $object->date_modification =
null;
277 if (is_array($object->array_options) && count($object->array_options) > 0) {
278 $extrafields->fetch_name_optionals_label($this->table_element);
279 foreach ($object->array_options as $key => $option) {
280 $shortkey = preg_replace(
'/options_/',
'', $key);
281 if (!empty($extrafields->attributes[$this->element][
'unique'][$shortkey])) {
284 unset($object->array_options[$key]);
290 $object->context[
'createfromclone'] =
'createfromclone';
291 $result = $object->createCommon($user);
294 $this->error = $object->error;
295 $this->errors = $object->errors;
307 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
314 unset($object->context[
'createfromclone']);
321 $this->
db->rollback();
333 public function fetch($id, $ref =
null)
336 if ($result > 0 && !empty($this->table_element_line)) {
349 $this->lines = array();
367 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
377 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
378 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
379 $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
381 $sql .=
' WHERE 1 = 1';
385 if (count($filter) > 0) {
386 foreach ($filter as $key => $value) {
387 if ($key ==
't.rowid') {
388 $sqlwhere[] = $key.
" = ".((int) $value);
389 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
390 $sqlwhere[] = $key.
" = '".$this->
db->idate($value).
"'";
391 } elseif ($key ==
'customsql') {
392 $sqlwhere[] = $value;
393 } elseif (strpos($value,
'%') ===
false) {
394 $sqlwhere[] = $key.
" IN (".$this->
db->sanitize($this->
db->escape($value)).
")";
396 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
400 if (count($sqlwhere) > 0) {
401 $sql .=
' AND ('.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
404 if (!empty($sortfield)) {
405 $sql .= $this->
db->order($sortfield, $sortorder);
407 if (!empty($limit)) {
408 $sql .= $this->
db->plimit($limit, $offset);
415 while ($i < ($limit ? min($limit, $num) : $num)) {
416 $obj = $this->
db->fetch_object(
$resql);
418 $record =
new self($this->db);
419 $record->setVarsFromFetchObj($obj);
421 $records[$record->id] = $record;
429 $this->errors[] =
'Error '.$this->db->lasterror();
430 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
455 public function delete(
User $user, $notrigger =
false)
471 if ($this->status < 0) {
472 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
489 global $conf, $langs;
491 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
496 if ($this->status == self::STATUS_VALIDATED) {
497 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
514 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
519 $this->newref = $num;
523 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
524 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
525 $sql .=
" status = ".self::STATUS_VALIDATED;
526 if (!empty($this->fields[
'date_validation'])) {
527 $sql .=
", date_validation = '".$this->db->idate($now).
"',";
529 if (!empty($this->fields[
'fk_user_valid'])) {
530 $sql .=
", fk_user_valid = ".$user->id;
532 $sql .=
" WHERE rowid = ".((int) $this->
id);
534 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
538 $this->error = $this->
db->lasterror();
542 if (!$error && !$notrigger) {
544 $result = $this->
call_trigger(
'RECRUITMENTJOBPOSITION_VALIDATE', $user);
553 $this->oldref = $this->ref;
556 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
558 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'recruitmentjobposition/".$this->
db->escape($this->newref).
"'";
559 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'recruitmentjobposition/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
562 $error++; $this->error = $this->
db->lasterror();
568 $dirsource = $conf->recruitment->dir_output.
'/recruitmentjobposition/'.$oldref;
569 $dirdest = $conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref;
570 if (!$error && file_exists($dirsource)) {
571 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
573 if (@rename($dirsource, $dirdest)) {
576 $listoffiles =
dol_dir_list($conf->recruitment->dir_output.
'/recruitmentjobposition/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
577 foreach ($listoffiles as $fileentry) {
578 $dirsource = $fileentry[
'name'];
579 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
580 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
581 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
582 @rename($dirsource, $dirdest);
592 $this->status = self::STATUS_VALIDATED;
599 $this->
db->rollback();
615 if ($this->status <= self::STATUS_DRAFT) {
626 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'RECRUITMENTJOBPOSITION_UNVALIDATE');
636 public function cancel($user, $notrigger = 0)
639 if ($this->status != self::STATUS_VALIDATED) {
650 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'RECRUITMENTJOBPOSITION_CLOSE');
664 global $langs, $conf;
673 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
674 $sql .=
" SET status = ".((int) $status).
", note_private = '".$this->
db->escape($newprivatenote).
"'";
676 $sql .=
" WHERE rowid = ".((int) $this->
id);
680 $modelpdf = $this->model_pdf;
681 $triggerName =
'RECRUITMENTJOB_CLOSE_REFUSED';
683 if ($status == self::STATUS_RECRUITED) {
684 $triggerName =
'RECRUITMENTJOB_CLOSE_RECRUITED';
685 $modelpdf = $this->model_pdf;
688 $this->error = $this->
db->lasterror();
689 $this->
db->rollback();
694 if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
696 $outputlangs = $langs;
697 if (!empty($conf->global->MAIN_MULTILANGS)) {
699 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') : $this->thirdparty->default_lang);
700 $outputlangs->setDefaultLang($newlang);
704 $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
705 $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
706 $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
709 $this->
generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
713 $this->oldcopy = clone $this;
714 $this->status = $status;
715 $this->date_cloture = $now;
716 $this->note_private = $newprivatenote;
719 if (!$notrigger && empty($error)) {
732 $this->status = $this->oldcopy->status;
733 $this->date_cloture = $this->oldcopy->date_cloture;
734 $this->note_private = $this->oldcopy->note_private;
736 $this->
db->rollback();
740 $this->error = $this->
db->lasterror();
741 $this->
db->rollback();
753 public function reopen($user, $notrigger = 0)
756 if ($this->status != self::STATUS_CANCELED) {
767 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'RECRUITMENTJOBPOSITION_REOPEN');
780 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
782 global $conf, $langs, $hookmanager;
784 if (!empty($conf->dol_no_mouse_hover)) {
790 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"PositionToBeFilled").
'</u>';
791 if (isset($this->status)) {
792 $label .=
' '.$this->getLibStatut(5);
795 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
796 $label .=
'<br><b>'.$langs->trans(
'Label').
':</b> '.$this->label;
798 $url =
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?id='.$this->id;
800 if ($option !=
'nolink') {
802 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
803 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
804 $add_save_lastsearch_values = 1;
806 if ($add_save_lastsearch_values) {
807 $url .=
'&save_lastsearch_values=1';
812 if (empty($notooltip)) {
813 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
814 $label = $langs->trans(
"ShowRecruitmentJobPosition");
815 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
817 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
818 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
820 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
823 $linkstart =
'<a href="'.$url.
'"';
824 $linkstart .= $linkclose.
'>';
827 $result .= $linkstart;
829 if (empty($this->showphoto_on_popup)) {
831 $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);
835 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
837 list($class, $module) = explode(
'@', $this->picto);
840 $filename = $filearray[0][
'name'];
841 if (!empty($filename)) {
842 $pospoint = strpos($filearray[0][
'name'],
'.');
844 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
845 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
846 $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>';
848 $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>';
853 $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);
858 if ($withpicto != 2) {
859 $result .= $this->ref;
865 global $action, $hookmanager;
866 $hookmanager->initHooks(array(
'recruitmentjobpositiondao'));
867 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
868 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
870 $result = $hookmanager->resPrint;
872 $result .= $hookmanager->resPrint;
886 return $this->LibStatut($this->status, $mode);
900 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
903 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
904 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
905 $this->labelStatus[self::STATUS_RECRUITED] = $langs->transnoentitiesnoconv(
'Recruited');
906 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
907 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
908 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
909 $this->labelStatusShort[self::STATUS_RECRUITED] = $langs->transnoentitiesnoconv(
'Recruited');
910 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Canceled');
913 $statusType =
'status'.$status;
914 if ($status == self::STATUS_VALIDATED) {
915 $statusType =
'status4';
917 if ($status == self::STATUS_RECRUITED) {
918 $statusType =
'status6';
920 if ($status == self::STATUS_CANCELED) {
921 $statusType =
'status9';
924 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
935 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
936 $sql .=
' fk_user_creat, fk_user_modif';
937 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
938 $sql .=
' WHERE t.rowid = '.((int) $id);
939 $result = $this->
db->query($sql);
941 if ($this->
db->num_rows($result)) {
942 $obj = $this->
db->fetch_object($result);
943 $this->
id = $obj->rowid;
945 $this->user_creation_id = $obj->fk_user_creat;
946 $this->user_modification_id = $obj->fk_user_modif;
947 $this->date_creation = $this->
db->jdate($obj->datec);
948 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
951 $this->
db->free($result);
965 $this->initAsSpecimenCommon();
975 $this->lines = array();
987 global $langs, $conf;
988 $langs->load(
"recruitment");
990 if (empty($conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON)) {
991 $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON =
'mod_recruitmentjobposition_standard';
994 if (!empty($conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON)) {
997 $file = $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON.
".php";
998 $classname = $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON;
1001 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
1002 foreach ($dirmodels as $reldir) {
1006 $mybool |= @include_once $dir.$file;
1009 if ($mybool ===
false) {
1014 if (class_exists($classname)) {
1015 $obj =
new $classname();
1016 $numref = $obj->getNextValue($this);
1018 if ($numref !=
'' && $numref !=
'-1') {
1021 $this->error = $obj->error;
1026 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1030 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1046 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1048 global $conf, $langs;
1051 $includedocgeneration = 1;
1053 $langs->load(
"recruitment");
1056 if (!empty($conf->global->RECRUITMENTJOBPOSITION_ADDON_PDF)) {
1057 $modele = $conf->global->RECRUITMENTJOBPOSITION_ADDON_PDF;
1063 $modelpath =
"core/modules/recruitment/doc/";
1065 if ($includedocgeneration && !empty($modele)) {
1066 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1081 global $conf, $langs;
1097 $this->
db->commit();