Skip to content
Snippets Groups Projects
Commit a26a7ced authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Qual: Uniformize code. Trigger PROJECT_BUILDDOC is removed because

building a doc is not a business event. For technical action after
creation of a pdf, hook "afterPDFCreation" must be used instead.
parent 30d4a7fa
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,8 @@ Dolibarr better:
- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
- Some field into database wwere renamed from "libelle" to "label".
- Table llx_c_pays were renamed into llx_c_country.
- Trigger PROJECT_BUILDDOC is removed. Building a doc is not a business event. For action after
creation of a pdf, hook "afterPDFCreation" must be used instead.
***** ChangeLog for 3.6 compared to 3.5.* *****
......
......@@ -225,13 +225,6 @@ function project_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
// Success in building document. We build meta file.
dol_meta_create($object);
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('PROJECT_BUILDDOC',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
return 1;
}
else
......
......@@ -295,6 +295,18 @@ class pdf_baleine extends ModelePDFProjects
$pdf->Close();
$pdf->Output($file,'F');
// Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment