29require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
52 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
82function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
86 $langs->load(
"ficheinter");
90 $srctemplatepath =
'';
95 $modele = $conf->global->FICHEINTER_ADDON_PDF;
102 $tmp = explode(
':', $modele, 2);
103 if (!empty($tmp[1])) {
105 $srctemplatepath = $tmp[1];
112 $dirmodels = array(
'/');
113 if (is_array($conf->modules_parts[
'models'])) {
114 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
116 foreach ($dirmodels as $reldir) {
117 foreach (array(
'doc',
'pdf') as $prefix) {
118 $file = $prefix.
"_".$modele.
".modules.php";
121 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
122 if (file_exists($file)) {
124 $classname = $prefix.
'_'.$modele;
137 $obj =
new $classname($db);
141 $sav_charset_output = $outputlangs->charset_output;
142 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
143 $outputlangs->charset_output = $sav_charset_output;
146 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
151 $outputlangs->charset_output = $sav_charset_output;
156 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
Parent class for documents (PDF, ODT, ...) generators.
Parent class for number ref generators.
Parent class numbering models of intervention sheet references.
Parent class to manage intervention document templates.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
dol_delete_preview($object)
Delete all preview files linked to object instance.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF.