Skip to content

Commit

Permalink
Fix: Trigger name conflicts and reference file was not matching real
Browse files Browse the repository at this point in the history
name of triggers.
  • Loading branch information
eldy committed Dec 14, 2013
1 parent 0e25939 commit dc754bb
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions htdocs/contrat/class/contrat.class.php
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down
58 changes: 55 additions & 3 deletions htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN
Expand Up @@ -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);
Expand All @@ -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')
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
{
Expand Down Expand Up @@ -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')
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/fichinter/class/fichinter.class.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit dc754bb

Please sign in to comment.