From 2f5bf06aedc65e53451ec8776a043c3462acbbc9 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 21 Feb 2013 17:32:57 +0100 Subject: [PATCH] Supplier order : add trigger on product dispatch --- .../fourn/class/fournisseur.commande.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 28eae474799..97d20d54d48 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1292,7 +1292,22 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::DispatchProduct sql=".$sql); $resql = $this->db->query($sql); - if (! $resql) + if ($resql) + { + if (! $notrigger) + { + global $conf, $langs, $user; + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('LINEORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + + $this->db->commit(); + } + else { $this->error=$this->db->lasterror(); $error++;