29require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
57 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
96 $langs->load(
"ficheinter");
97 return $langs->trans(
"NoDescription");
108 $langs->load(
"ficheinter");
109 return $langs->trans(
"NoExample");
133 return $langs->trans(
"NotAvailable");
144 $langs->load(
"admin");
146 if ($this->version ==
'development') {
147 return $langs->trans(
"VersionDevelopment");
148 } elseif ($this->version ==
'experimental') {
149 return $langs->trans(
"VersionExperimental");
150 } elseif ($this->version ==
'dolibarr') {
152 } elseif ($this->version) {
153 return $this->version;
155 return $langs->trans(
"NotAvailable");
174function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
177 global $conf, $langs, $user;
178 $langs->load(
"ficheinter");
182 $srctemplatepath =
'';
186 if (!empty($conf->global->FICHEINTER_ADDON_PDF)) {
187 $modele = $conf->global->FICHEINTER_ADDON_PDF;
194 $tmp = explode(
':', $modele, 2);
195 if (!empty($tmp[1])) {
197 $srctemplatepath = $tmp[1];
204 $dirmodels = array(
'/');
205 if (is_array($conf->modules_parts[
'models'])) {
206 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
208 foreach ($dirmodels as $reldir) {
209 foreach (array(
'doc',
'pdf') as $prefix) {
210 $file = $prefix.
"_".$modele.
".modules.php";
213 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
214 if (file_exists($file)) {
216 $classname = $prefix.
'_'.$modele;
229 $obj =
new $classname($db);
233 $sav_charset_output = $outputlangs->charset_output;
234 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
235 $outputlangs->charset_output = $sav_charset_output;
238 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
243 $outputlangs->charset_output = $sav_charset_output;
248 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
Parent class for documents generators.
Parent class numbering models of intervention sheet references.
getExample()
Return a numbering example.
info()
Returns the default description of the numbering template.
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.
isEnabled()
Return if a module can be used or not.
getNextValue($objsoc=0, $object='')
Return the next assigned value.
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.
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.