30require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
53 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
87 $langs->load(
"ficheinter");
91 $srctemplatepath =
'';
103 $tmp = explode(
':', $modele, 2);
104 if (!empty($tmp[1])) {
106 $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)) {
123 $classname = $prefix.
'_'.$modele;
127 if ($classname !==
'') {
133 if ($classname !==
'') {
136 $obj =
new $classname($db);
140 $sav_charset_output = $outputlangs->charset_output;
141 if ($obj->write_file(
$object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
142 $outputlangs->charset_output = $sav_charset_output;
145 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
150 $outputlangs->charset_output = $sav_charset_output;
155 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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_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 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.