31require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
54 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
73 abstract public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
116 global
$conf, $langs;
117 $langs->load(
"ficheinter");
121 $srctemplatepath =
'';
133 $tmp = explode(
':', $modele, 2);
134 if (!empty($tmp[1])) {
136 $srctemplatepath = $tmp[1];
142 $dirmodels = array_merge([
'/'], (array)
$conf->modules_parts[
'models']);
143 foreach ($dirmodels as $reldir) {
144 foreach (array(
'doc',
'pdf') as $prefix) {
145 $file = $prefix.
"_".$modele.
".modules.php";
148 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
149 if (file_exists($file)) {
150 $classname = $prefix.
'_'.$modele;
154 if ($classname !==
'') {
160 if ($classname !==
'') {
163 $obj =
new $classname(
$db);
165 '@phan-var-force ModelePDFFicheinter $obj';
169 $sav_charset_output = $outputlangs->charset_output;
170 if ($obj->write_file(
$object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
171 $outputlangs->charset_output = $sav_charset_output;
174 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
179 $outputlangs->charset_output = $sav_charset_output;
184 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
if(! $sortfield) if(! $sortorder) $object
Parent class for documents (PDF, ODT, ...) generators.
Parent class for number ref generators.
Parent class numbering models of intervention sheet references.
getNextValue($objsoc='', $object='')
Return next free value.
getExample()
Return an example of numbering.
Parent class to manage intervention document templates.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
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, $showempty=0)
Return list of activated modules usable for document generation.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a 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.