diff --git a/htdocs/install/doctemplates/proposals/template_proposal.odt b/htdocs/install/doctemplates/proposals/template_proposal.odt index 8ece83c989c..31981d8c120 100644 Binary files a/htdocs/install/doctemplates/proposals/template_proposal.odt and b/htdocs/install/doctemplates/proposals/template_proposal.odt differ diff --git a/htdocs/install/doctemplates/recruitment/template_recruitment.odt b/htdocs/install/doctemplates/recruitment/template_recruitment.odt new file mode 100644 index 00000000000..5955d47e206 Binary files /dev/null and b/htdocs/install/doctemplates/recruitment/template_recruitment.odt differ diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index dda796c243e..7a9d077f910 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2020 Laurent Destailleur +/* Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,10 +63,24 @@ class RecruitmentJobPosition extends CommonObject */ public $picto = 'recruitmentjobposition'; - + /** + * Draft status + */ const STATUS_DRAFT = 0; + + /** + * Validated + */ const STATUS_VALIDATED = 1; + + /** + * Recruited + */ const STATUS_RECRUITED = 3; + + /** + * Canceled + */ const STATUS_CANCELED = 9; @@ -651,7 +666,7 @@ class RecruitmentJobPosition extends CommonObject } /** - * Close the commercial proposal + * Close the recruitment * * @param User $user Object user that close * @param int $status Statut @@ -683,12 +698,6 @@ class RecruitmentJobPosition extends CommonObject if ($status == self::STATUS_RECRUITED) { $triggerName = 'RECRUITMENTJOB_CLOSE_RECRUITED'; $modelpdf = $this->model_pdf; - - if ($result < 0) { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return -2; - } } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 38e1ead836e..cfbf91463e8 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -287,7 +287,11 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->recruitment->dir_temp); - + if (!is_writable($conf->recruitment->dir_temp)) { + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->recruitment->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false;