From dc754bbdc214874d5354db5cbb6279208a26c24f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2013 20:48:34 +0100 Subject: [PATCH] Fix: Trigger name conflicts and reference file was not matching real name of triggers. --- ChangeLog | 4 ++ htdocs/contrat/class/contrat.class.php | 4 +- .../interface_90_all_Demo.class.php-NORUN | 58 ++++++++++++++++++- htdocs/fichinter/class/fichinter.class.php | 8 +-- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30de710764b3b..5dc6b2eab0d61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -128,6 +128,10 @@ parameter. All methods addline in this case were modified to remove this paramet 5) Property ->tel on objects is now ->phone +6) Trigger LINEPROPAL_MODIFY is renamed into LINEPROPAL_UPDATE and + Trigger CONTRACT_LINE_DELETE rnamed into LINECONTRACT_DELETE to match naming rules. + + ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** Fix: field's problem into company's page (RIB) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index b4168ecc3de01..61e41356b6b02 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1269,7 +1269,7 @@ function deleteline($idline,$user) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_DELETE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers @@ -2118,7 +2118,7 @@ function update($user, $notrigger=0) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_MODIFY',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_UPDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers } diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 7f40302ef2d9a..e3257e2bda864 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -243,6 +243,10 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINEORDER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } elseif ($action == 'LINEORDER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); @@ -265,6 +269,18 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINEORDER_SUPPLIER_DISPATCH') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEORDER_SUPPLIER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEORDER_SUPPLIER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } // Proposals elseif ($action == 'PROPAL_CREATE') @@ -307,7 +323,7 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - elseif ($action == 'LINEPROPAL_MODIFY') + elseif ($action == 'LINEPROPAL_UPDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } @@ -337,6 +353,14 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINECONTRACT_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINECONTRACT_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } // Bills elseif ($action == 'BILL_CREATE') @@ -378,12 +402,28 @@ class InterfaceDemo elseif ($action == 'LINEBILL_INSERT') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } elseif ($action == 'LINEBILL_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - + elseif ($action == 'LINEBILL_SUPPLIER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_SUPPLIER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_SUPPLIER_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + // Payments elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { @@ -419,7 +459,19 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - + elseif ($action == 'LINEFICHINTER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEFICHINTER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEFICHINTER_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + // Members elseif ($action == 'MEMBER_CREATE') { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index beea21996d9f3..bd1306b0cf69d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -251,7 +251,7 @@ function update($user, $notrigger=0) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_UPDATE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('FICHINTER_MODIFY',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1148,7 +1148,7 @@ function insert($user, $notrigger=0) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_CREATE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_CREATE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; } @@ -1210,7 +1210,7 @@ function update($user,$notrigger=0) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_UPDATE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_UPDATE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; } @@ -1324,7 +1324,7 @@ function deleteline($user,$notrigger=0) // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_DELETE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_DELETE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; }