29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
59 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
95 $langs->load(
"ficheinter");
96 return $langs->trans(
"NoDescription");
107 $langs->load(
"ficheinter");
108 return $langs->trans(
"NoExample");
130 return $langs->trans(
"NotAvailable");
141 $langs->load(
"admin");
143 if ($this->version ==
'development')
return $langs->trans(
"VersionDevelopment");
144 elseif ($this->version ==
'experimental')
return $langs->trans(
"VersionExperimental");
145 elseif ($this->version ==
'dolibarr')
return DOL_VERSION;
146 elseif ($this->version)
return $this->version;
147 else return $langs->trans(
"NotAvailable");
165 function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
168 global $conf, $langs, $user;
169 $langs->load(
"ficheinter");
173 $srctemplatepath =
'';
178 if (!empty($conf->global->FICHEINTER_ADDON_PDF))
180 $modele = $conf->global->FICHEINTER_ADDON_PDF;
187 $tmp = explode(
':', $modele, 2);
191 $srctemplatepath = $tmp[1];
195 $file =
''; $classname =
''; $filefound = 0;
196 $dirmodels = array(
'/');
197 if (is_array($conf->modules_parts[
'models'])) $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
198 foreach ($dirmodels as $reldir)
200 foreach (array(
'doc',
'pdf') as $prefix)
202 $file = $prefix.
"_".$modele.
".modules.php";
205 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
206 if (file_exists($file))
209 $classname = $prefix.
'_'.$modele;
213 if ($filefound)
break;
221 $obj =
new $classname($db);
225 $sav_charset_output = $outputlangs->charset_output;
226 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0)
228 $outputlangs->charset_output = $sav_charset_output;
231 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
236 $outputlangs->charset_output = $sav_charset_output;
241 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getNextValue()
Return the next assigned value.
getExample()
Return a numbering example.
dol_delete_preview($object)
Delete all preview files linked to object instance.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
isEnabled()
Return if a module can be used or not.
Parent class numbering models of intervention sheet references.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
Parent class to manage intervention document templates.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
getVersion()
Return the version of the numbering module.
print
Draft customers invoices.
info()
Returns the default description of the numbering template.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.