23require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
50 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
70function action_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
75 $langs->load(
"action");
79 $srctemplatepath =
'';
84 $modele = $conf->global->ACTION_EVENT_ADDON_PDF;
91 $tmp = explode(
':', $modele, 2);
92 if (!empty($tmp[1])) {
94 $srctemplatepath = $tmp[1];
101 $dirmodels = array(
'/');
102 if (is_array($conf->modules_parts[
'models'])) {
103 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
105 foreach ($dirmodels as $reldir) {
106 foreach (array(
'doc',
'pdf') as $prefix) {
107 $file = $prefix.
"_".$modele.
".modules.php";
110 $file =
dol_buildpath($reldir.
"core/modules/action/doc/".$file, 0);
111 if (file_exists($file)) {
113 $classname = $prefix.
'_'.$modele;
126 $obj =
new $classname($db);
130 $sav_charset_output = $outputlangs->charset_output;
131 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
132 $outputlangs->charset_output = $sav_charset_output;
135 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
140 $outputlangs->charset_output = $sav_charset_output;
145 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
Parent class for documents (PDF, ODT, ...) generators.
Parent class for product models of doc generators.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.