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)
73 global $conf, $langs, $user;
74 $langs->load(
"action");
78 $srctemplatepath =
'';
82 if (!empty($conf->global->ACTION_EVENT_ADDON_PDF)) {
83 $modele = $conf->global->ACTION_EVENT_ADDON_PDF;
90 $tmp = explode(
':', $modele, 2);
91 if (!empty($tmp[1])) {
93 $srctemplatepath = $tmp[1];
100 $dirmodels = array(
'/');
101 if (is_array($conf->modules_parts[
'models'])) {
102 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
104 foreach ($dirmodels as $reldir) {
105 foreach (array(
'doc',
'pdf') as $prefix) {
106 $file = $prefix.
"_".$modele.
".modules.php";
109 $file =
dol_buildpath($reldir.
"core/modules/action/doc/".$file, 0);
110 if (file_exists($file)) {
112 $classname = $prefix.
'_'.$modele;
125 $obj =
new $classname($db);
129 $sav_charset_output = $outputlangs->charset_output;
130 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
131 $outputlangs->charset_output = $sav_charset_output;
134 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
139 $outputlangs->charset_output = $sav_charset_output;
144 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
Parent class for documents 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.