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';
72 abstract public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
115 global
$conf, $langs;
116 $langs->load(
"ficheinter");
120 $srctemplatepath =
'';
132 $tmp = explode(
':', $modele, 2);
133 if (!empty($tmp[1])) {
135 $srctemplatepath = $tmp[1];
141 $dirmodels = array(
'/');
142 if (is_array(
$conf->modules_parts[
'models'])) {
143 $dirmodels = array_merge($dirmodels,
$conf->modules_parts[
'models']);
145 foreach ($dirmodels as $reldir) {
146 foreach (array(
'doc',
'pdf') as $prefix) {
147 $file = $prefix.
"_".$modele.
".modules.php";
150 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
151 if (file_exists($file)) {
152 $classname = $prefix.
'_'.$modele;
156 if ($classname !==
'') {
162 if ($classname !==
'') {
165 $obj =
new $classname($db);
167 '@phan-var-force ModelePDFFicheinter $obj';
171 $sav_charset_output = $outputlangs->charset_output;
172 if ($obj->write_file(
$object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
173 $outputlangs->charset_output = $sav_charset_output;
176 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
181 $outputlangs->charset_output = $sav_charset_output;
186 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.
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)
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.