diff --git a/ChangeLog b/ChangeLog index b22376cebac..e16f3a4bd0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: On contact list can set filter on both active and not active (no more exclusive select). - New: Each user can include its own external ics calendar into dolibarr agenda view. - New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. @@ -89,6 +90,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.* ***** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9b0e236af35..c46f48ed1c6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1763,16 +1763,6 @@ class Facture extends CommonInvoice } } - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->facnumber=$num; - $this->statut=1; - $this->brouillon=0; - $this->date_validation=$now; - } - // Trigger calls if (! $error) { @@ -1782,6 +1772,16 @@ class Facture extends CommonInvoice //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail // End call triggers } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->facnumber=$num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } } else { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 619aad511e9..acd39a38901 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -634,7 +634,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') // Status print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print $form->selectarray('search_status', array('-1'=>'','0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; // Copy to clipboard @@ -659,7 +659,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $sql .= ", p.civility as civility_id, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; - if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); + if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status); if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')"; $sql.= " ORDER BY $sortfield $sortorder"; diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 363bfb67e80..ecaf0213bc0 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -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 diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index c8cc0b65fbc..e6505c05283 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -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));