Merge pull request #23058 from aspangaro/18a1

FIX Recruitment - Generation of odt
This commit is contained in:
Laurent Destailleur 2022-12-01 10:43:43 +01:00 committed by GitHub
commit 850bd897d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 10 deletions

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* 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)) {

View File

@ -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;