29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
57 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
93 $langs->load(
"ficheinter");
94 return $langs->trans(
"NoDescription");
105 $langs->load(
"ficheinter");
106 return $langs->trans(
"NoExample");
130 return $langs->trans(
"NotAvailable");
141 $langs->load(
"admin");
143 if ($this->version ==
'development') {
144 return $langs->trans(
"VersionDevelopment");
145 } elseif ($this->version ==
'experimental') {
146 return $langs->trans(
"VersionExperimental");
147 } elseif ($this->version ==
'dolibarr') {
149 } elseif ($this->version) {
150 return $this->version;
152 return $langs->trans(
"NotAvailable");
171 function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
174 global $conf, $langs, $user;
175 $langs->load(
"ficheinter");
179 $srctemplatepath =
'';
183 if (!empty($conf->global->FICHEINTER_ADDON_PDF)) {
184 $modele = $conf->global->FICHEINTER_ADDON_PDF;
191 $tmp = explode(
':', $modele, 2);
192 if (!empty($tmp[1])) {
194 $srctemplatepath = $tmp[1];
201 $dirmodels = array(
'/');
202 if (is_array($conf->modules_parts[
'models'])) {
203 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
205 foreach ($dirmodels as $reldir) {
206 foreach (array(
'doc',
'pdf') as $prefix) {
207 $file = $prefix.
"_".$modele.
".modules.php";
210 $file =
dol_buildpath($reldir.
"core/modules/fichinter/doc/".$file, 0);
211 if (file_exists($file)) {
213 $classname = $prefix.
'_'.$modele;
226 $obj =
new $classname($db);
230 $sav_charset_output = $outputlangs->charset_output;
231 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
232 $outputlangs->charset_output = $sav_charset_output;
235 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
240 $outputlangs->charset_output = $sav_charset_output;
245 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.