Fix trigger ficheinterline
This commit is contained in:
parent
a8e1d111c3
commit
94e2ea05d2
@ -1007,10 +1007,14 @@ class FichinterLigne
|
|||||||
/**
|
/**
|
||||||
* Insert the line into database
|
* Insert the line into database
|
||||||
*
|
*
|
||||||
|
* @param User $user Objet user that make creation
|
||||||
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function insert($user, $notrigger=0)
|
function insert($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
dol_syslog("FichinterLigne::insert rang=".$this->rang);
|
dol_syslog("FichinterLigne::insert rang=".$this->rang);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -1059,13 +1063,15 @@ class FichinterLigne
|
|||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('FICHINTERDET_CREATE',$this,$user,$langs,$conf);
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_CREATE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) {
|
if ($resulttrigger < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -1094,6 +1100,8 @@ class FichinterLigne
|
|||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0)
|
function update($user,$notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Mise a jour ligne en base
|
// Mise a jour ligne en base
|
||||||
@ -1117,14 +1125,16 @@ class FichinterLigne
|
|||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('FICHINTERDET_UPDATE',$this,$user,$langs,$conf);
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_UPDATE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) {
|
if ($resulttrigger < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -1227,8 +1237,8 @@ class FichinterLigne
|
|||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('FICHINTERDET_DELETE',$this,$user,$langs,$conf);
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_DELETE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) {
|
if ($resulttrigger < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user