diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7804c403b70..71d2023c777 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -41,18 +41,17 @@ class FormFile * * @param DoliDB $DB Database handler */ - function FormFile($DB) + function FormFile($db) { - $this->db = $DB; - + $this->db = $db; $this->numoffiles=0; - return 1; } /** * Show form to upload a new file + * * @param url Url * @param title Title zone (Title or '' or 'none') * @param addcancel 1=Add 'Cancel' button diff --git a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php index 20b605737fd..415d581f330 100755 --- a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php @@ -405,6 +405,15 @@ class pdf_crabe extends ModelePDFFactures $pdf->Close(); $pdf->Output($file,'F'); + + // Actions on extra fields (by external module or standard code) + include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); + $hookmanager=new HookManager($this->db); + $hookmanager->callHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php index 4e14f622533..f54fb724b64 100755 --- a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php @@ -108,7 +108,7 @@ class pdf_oursin extends ModelePDFFactures /** * Function to build pdf onto disk - * + * * @param int $object Id of object to generate * @param object $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file @@ -290,6 +290,15 @@ class pdf_oursin extends ModelePDFFactures $pdf->Close(); $pdf->Output($file,'F'); + + // Actions on extra fields (by external module or standard code) + include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); + $hookmanager=new HookManager($this->db); + $hookmanager->callHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 0a140d15531..f07b2b13dc2 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -383,16 +383,18 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->Close(); $pdf->Output($file,'F'); + + // Actions on extra fields (by external module or standard code) + include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); + $hookmanager=new HookManager($this->db); + $hookmanager->callHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - // Add external file - //$pdfConcat = new concat_pdf(); - //$pdfConcat->setFiles(array($file, DOL_DOCUMENT_ROOT."/includes/modules/propale/morefile.pdf")); - //$pdfConcat->concat(); - //$pdf->AliasNbPages(); - //$pdfConcat->Output($file,'F'); - $outputlangs->charset_output=$sav_charset_output; return 1; // Pas d'erreur } diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index f3dd60f6ae9..e03dffeae5d 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -102,7 +102,7 @@ class pdf_propale_jaune extends ModelePDFPropales /** * Function to build pdf onto disk - * + * * @param int $object Id of object to generate * @param object $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file @@ -383,16 +383,18 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->Close(); $pdf->Output($file,'F'); + + // Actions on extra fields (by external module or standard code) + include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); + $hookmanager=new HookManager($this->db); + $hookmanager->callHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - // Add external file - //$pdfConcat = new concat_pdf(); - //$pdfConcat->setFiles(array($file, DOL_DOCUMENT_ROOT."/includes/modules/propale/morefile.pdf")); - //$pdfConcat->concat(); - //$pdf->AliasNbPages(); - //$pdfConcat->Output($file,'F'); - $outputlangs->charset_output=$sav_charset_output; return 1; // Pas d'erreur }