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