Fix no document available on job candidature
This commit is contained in:
parent
812298f740
commit
e5c38572d1
@ -423,7 +423,7 @@ class modRecruitment extends DolibarrModules
|
|||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
// Document template
|
// Document template
|
||||||
$moduledir = 'mymodule';
|
$moduledir = 'recruitment';
|
||||||
$myTmpObjects = array();
|
$myTmpObjects = array();
|
||||||
$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration'=>1, 'includedocgeneration'=>1);
|
$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration'=>1, 'includedocgeneration'=>1);
|
||||||
|
|
||||||
@ -431,10 +431,10 @@ class modRecruitment extends DolibarrModules
|
|||||||
if ($myTmpObjectKey == 'MyObject') {
|
if ($myTmpObjectKey == 'MyObject') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($myTmpObjectArray['includerefgeneration']) {
|
if ($myTmpObjectArray['includedocgeneration']) {
|
||||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_recruitmentjobposition.odt';
|
||||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
|
||||||
$dest = $dirodt.'/template_myobjects.odt';
|
$dest = $dirodt.'/template_recruitmentjobposition.odt';
|
||||||
|
|
||||||
if (file_exists($src) && !file_exists($dest)) {
|
if (file_exists($src) && !file_exists($dest)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@ -450,8 +450,6 @@ class modRecruitment extends DolibarrModules
|
|||||||
$sql = array_merge($sql, array(
|
$sql = array_merge($sql, array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".strtolower($myTmpObjectKey)."' AND entity = ".$conf->entity,
|
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".strtolower($myTmpObjectKey)."' AND entity = ".$conf->entity,
|
||||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."','".strtolower($myTmpObjectKey)."',".$conf->entity.")",
|
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."','".strtolower($myTmpObjectKey)."',".$conf->entity.")",
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".strtolower($myTmpObjectKey)."' AND entity = ".$conf->entity,
|
|
||||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".strtolower($myTmpObjectKey)."', ".$conf->entity.")"
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ abstract class ModelePDFRecruitmentCandidature extends CommonDocGenerator
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$type = 'recruitmentjobposition';
|
$type = 'recruitmentjobcandidature';
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user