Clean dead code
This commit is contained in:
parent
f6b216eafc
commit
84cda962c1
@ -199,24 +199,6 @@ class AccountancyCategory // extends CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
|
||||
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -343,21 +325,6 @@ class AccountancyCategory // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -398,21 +365,6 @@ class AccountancyCategory // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -295,17 +295,15 @@ class AccountingAccount extends CommonObject
|
||||
if (! $error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account");
|
||||
|
||||
// if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
// want this action to call a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||
// if ($result < 0) $error++;
|
||||
// // End call triggers
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -411,20 +409,6 @@ class AccountingAccount extends CommonObject
|
||||
if ($result > 0) {
|
||||
$this->db->begin();
|
||||
|
||||
// if (! $error) {
|
||||
// if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
// }
|
||||
// }
|
||||
|
||||
if (! $error) {
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||
$sql .= " WHERE rowid=" . $this->id;
|
||||
|
||||
@ -287,19 +287,6 @@ class Lettering extends BookKeeping
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
}
|
||||
}
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
|
||||
@ -153,19 +153,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."advtargetemailing");
|
||||
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -414,22 +401,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -462,22 +433,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."advtargetemailing";
|
||||
|
||||
@ -133,18 +133,6 @@ class PaymentTerm // extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_payment_term");
|
||||
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger) {
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -307,17 +295,6 @@ class PaymentTerm // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -358,17 +335,6 @@ class PaymentTerm // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -348,22 +348,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -420,22 +404,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
}
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -550,12 +550,10 @@ if (!$error && $massaction == 'confirm_presend')
|
||||
|
||||
if (!empty($triggername))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT."/core/class/interfaces.class.php";
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers($triggername, $objectobj2, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors = $interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result = $objectobj2->call_trigger($triggername, $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -455,16 +455,19 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
||||
$object->email_subject = $subject;
|
||||
$object->email_msgid = $mailfile->msgid;
|
||||
|
||||
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprcated)
|
||||
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprecated)
|
||||
if (!empty($triggersendname) || !empty($trigger_name))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers(empty($triggersendname) ? $trigger_name : $triggersendname, $object, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
setEventMessages($interface->error, $interface->errors, 'errors');
|
||||
// Call trigger
|
||||
$result = $object->call_trigger(empty($triggersendname) ? $trigger_name : $triggersendname, $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
// End call of triggers
|
||||
}
|
||||
|
||||
// Redirect here
|
||||
|
||||
@ -126,19 +126,6 @@ class Ccountry // extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_country");
|
||||
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -247,22 +234,6 @@ class Ccountry // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -303,22 +274,6 @@ class Ccountry // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -3629,14 +3629,10 @@ abstract class CommonObject
|
||||
|
||||
if ($trigkey)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers($trigkey, $this, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors = $interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result = $this->call_trigger($trigkey, $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -120,18 +120,6 @@ class Cstate // extends CommonObject
|
||||
|
||||
if (!$error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_departements");
|
||||
|
||||
//if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -231,22 +219,6 @@ class Cstate // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
@ -282,22 +254,6 @@ class Cstate // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -124,19 +124,6 @@ class Ctypent // extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_typent");
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -243,22 +230,6 @@ class Ctypent // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -299,22 +270,6 @@ class Ctypent // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -123,19 +123,6 @@ class CUnits // extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_units");
|
||||
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -342,22 +329,6 @@ class CUnits // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -398,22 +369,6 @@ class CUnits // extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -831,7 +831,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
// TODO Merge all previous cases into this generic one
|
||||
else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ...
|
||||
{
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). Key can be set in agenda setup if defined into c_action_trigger
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function).
|
||||
// Note that these key can be set in agenda setup, only if defined into c_action_trigger
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("agenda", "other"));
|
||||
|
||||
|
||||
@ -267,19 +267,6 @@ class Cronjob extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob");
|
||||
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -657,19 +644,6 @@ class Cronjob extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error && ! $notrigger)
|
||||
//{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -789,11 +789,12 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Call trigger based on this instance
|
||||
* Call trigger based on this instance.
|
||||
* We implement it here because this class doe not extend CommonObject.
|
||||
*
|
||||
* NB: Error from trigger are stacked in errors
|
||||
* NB2: if trigger fail, action should be canceled.
|
||||
* NB3: Should be deleted if EcmDirectory extend CommonObject
|
||||
* NB1: Error from trigger are stacked in errors
|
||||
* NB2: if trigger fail, action should be canceled.
|
||||
* NB3: Should be deleted if EcmDirectory extend CommonObject
|
||||
*
|
||||
* @param string $triggerName trigger's name to execute
|
||||
* @param User $user Object user
|
||||
|
||||
@ -301,22 +301,6 @@ class PaymentExpenseReport extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -374,22 +358,6 @@ class PaymentExpenseReport extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -812,22 +812,6 @@ class Export
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -316,22 +316,6 @@ class LoanSchedule extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -369,22 +353,6 @@ class LoanSchedule extends CommonObject
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -316,22 +316,6 @@ class PaymentLoan extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -385,22 +369,6 @@ class PaymentLoan extends CommonObject
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
}
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -510,14 +510,11 @@ if (!defined('NOLOGIN'))
|
||||
|
||||
// Call trigger for the "security events" log
|
||||
$user->trigger_mesg = 'ErrorBadValueForCode - login='.GETPOST("username", "alpha", 2);
|
||||
// Call of triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End Call of triggers
|
||||
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Hooks on failed login
|
||||
$action = '';
|
||||
@ -590,14 +587,11 @@ if (!defined('NOLOGIN'))
|
||||
|
||||
// Call trigger for the "security events" log
|
||||
$user->trigger_mesg = $langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username", "alpha", 2);
|
||||
// Call of triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf, GETPOST("username", "alpha", 2));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End Call of triggers
|
||||
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Hooks on failed login
|
||||
$action = '';
|
||||
@ -645,15 +639,12 @@ if (!defined('NOLOGIN'))
|
||||
$user->trigger_mesg = $user->error;
|
||||
}
|
||||
|
||||
// Call triggers for the "security events" log
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
|
||||
// Hooks on failed login
|
||||
$action = '';
|
||||
$hookmanager->initHooks(array('login'));
|
||||
@ -702,13 +693,9 @@ if (!defined('NOLOGIN'))
|
||||
$user->trigger_mesg = $user->error;
|
||||
}
|
||||
|
||||
// Call triggers for the "security events" log
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Hooks on failed login
|
||||
@ -809,13 +796,10 @@ if (!defined('NOLOGIN'))
|
||||
|
||||
// Call triggers for the "security events" log
|
||||
$user->trigger_mesg = $loginfo;
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGIN', $user, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGIN', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Hooks on successfull login
|
||||
|
||||
@ -320,17 +320,12 @@ class Opensurveysondage extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
if (!$error)
|
||||
if (!$error && !$notrigger)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('OPENSURVEY_MODIFY', $this, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $this->errors = $interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('OPENSURVEY_MODIFY', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
|
||||
@ -1452,6 +1452,8 @@ class Product extends CommonObject
|
||||
{
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if ($type == 'buy') {
|
||||
@ -1478,16 +1480,15 @@ class Product extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('PRODUCT_MODIFY', $this, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$this->errors = $interface->errors;
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('PRODUCT_MODIFY', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->$field = $value;
|
||||
|
||||
|
||||
@ -112,19 +112,6 @@ class Productbatch extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.self::$_table_element);
|
||||
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -234,21 +221,6 @@ class Productbatch extends CommonObject
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
@ -282,22 +254,6 @@ class Productbatch extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.self::$_table_element."";
|
||||
|
||||
@ -217,18 +217,6 @@ class Productcustomerprice extends CommonObject
|
||||
|
||||
if (!$error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_customer_price");
|
||||
|
||||
if (!$notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -708,15 +696,12 @@ class Productcustomerprice extends CommonObject
|
||||
$this->errors [] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('PRODUCT_CUSTOMER_PRICE_UPDATE', $this, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $this->errors = $interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
if (!$error && !$notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_UPDATE', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -849,20 +834,6 @@ class Productcustomerprice extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_customer_price";
|
||||
$sql .= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -127,19 +127,6 @@ class Propalmergepdfproduct extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."propal_merge_pdf_product");
|
||||
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -336,22 +323,6 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@ -385,22 +356,6 @@ class Propalmergepdfproduct extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product";
|
||||
@ -447,22 +402,6 @@ class Propalmergepdfproduct extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product";
|
||||
@ -510,22 +449,6 @@ class Propalmergepdfproduct extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product";
|
||||
|
||||
@ -129,12 +129,10 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice
|
||||
$ipaddress = $_SESSION['ipaddress'];
|
||||
$errormessage = $_SESSION['errormessage'];
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('PAYMENTONLINE_PAYMENT_KO', $object, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors = $interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Send an email
|
||||
$sendemail = '';
|
||||
|
||||
@ -748,13 +748,10 @@ if ($ispaymentok)
|
||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_OK', $object, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
// Call trigger
|
||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n";
|
||||
@ -885,13 +882,10 @@ else
|
||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO', $object, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
// Call trigger
|
||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
print $langs->trans('DoExpressCheckoutPaymentAPICallFailed') . "<br>\n";
|
||||
print $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."<br>\n";
|
||||
|
||||
@ -146,17 +146,12 @@ class Dolresource extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
if (!$error && !$notrigger)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
//// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('RESOURCE_CREATE', $this, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $this->errors = $interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('RESOURCE_CREATE', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
|
||||
@ -41,11 +41,9 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse
|
||||
|
||||
global $conf, $langs, $user;
|
||||
|
||||
// Call triggers for the "security events" log
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($db);
|
||||
$result = $interface->run_triggers('USER_LOGOUT', $user, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; }
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGOUT', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
// Hooks on logout
|
||||
|
||||
Loading…
Reference in New Issue
Block a user