From 32a0f4c530ecd7224c99ac283803fd3065aa2790 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 20 May 2016 20:03:29 +0200 Subject: [PATCH] Add trigger into expedition class --- htdocs/expedition/class/expedition.class.php | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 6d3f7b05966..fd2d7ff1777 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1806,6 +1806,14 @@ class Expedition extends CommonObject { // TODO: Add option/checkbox to set order billed if 100% of order is shipped $this->statut=2; + + // Call trigger + $result=$this->call_trigger('SHIPPING_CLOSED',$user); + if ($result < 0) { + return -1; + } + // End call triggers + return 1; } else @@ -1831,6 +1839,15 @@ class Expedition extends CommonObject { $this->statut=2; $this->billed=1; + + // Call trigger + $result=$this->call_trigger('SHIPPING_BILLED',$user); + if ($result < 0) { + return -1; + } + // End call triggers + + return 1; } else @@ -1856,6 +1873,13 @@ class Expedition extends CommonObject { $this->statut=1; $this->billed=0; + + // Call trigger + $result=$this->call_trigger('SHIPPING_REOPENED',$user); + if ($result < 0) { + return -1; + } + return 1; } else