Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action

This commit is contained in:
KreizIT 2014-07-04 16:23:10 +02:00
parent 4666de85e2
commit c70bdabeda
2 changed files with 10 additions and 9 deletions

View File

@ -22,6 +22,7 @@ For users:
- Fix: [ bug #1498, #1499 ] Shipment/Delivery triggers problem
- Fix: [ bug #1465, #1466 ] Product triggers problem
- Fix: [ bug #1508 ] STOCK_MOVEMENT does not show trigger error message
- Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action
For translators:

View File

@ -126,15 +126,15 @@ class Deplacement extends CommonObject
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."deplacement");
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('DEPLACEMENT_CREATE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
// Call trigger
$result=$this->call_trigger('DEPLACEMENT_CREATE',$user);
if ($result < 0)
{
$this->db->rollback();
return -2;
}
// End call triggers
$result=$this->update($user);
if ($result > 0)
{