Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d0cc935cd5
@ -46,7 +46,10 @@ For developers:
|
||||
- New: Add hook "searchAgendaFrom".
|
||||
- New: Add trigger DON_UPDATE, DON_DELETE
|
||||
- New: Add country iso code on 3 chars into table of countries.
|
||||
- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger.
|
||||
- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger.
|
||||
- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete
|
||||
- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE.
|
||||
- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
|
||||
|
||||
WARNING: Following change may create regression for some external modules, but was necessary to make
|
||||
Dolibarr better:
|
||||
@ -162,6 +165,7 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
||||
So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable
|
||||
default standard behaviour.
|
||||
- Properties "civilite_id" were renamed into "civility_id".
|
||||
- Remove add_photo_web() that is ot used anymore by core code.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -238,6 +238,7 @@ class Commande extends CommonOrder
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -259,8 +260,13 @@ class Commande extends CommonOrder
|
||||
$mouvP->origin = &$this;
|
||||
// We decrement stock of product (and sub-products)
|
||||
$result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr",$num));
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->error=$mouvP->error;
|
||||
}
|
||||
}
|
||||
if ($error) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -296,12 +302,10 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_VALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_VALIDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Set new ref and current status
|
||||
@ -319,7 +323,6 @@ class Commande extends CommonOrder
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -430,12 +433,10 @@ class Commande extends CommonOrder
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_REOPEN',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_REOPEN',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -491,13 +492,11 @@ class Commande extends CommonOrder
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_CLOSE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CLOSE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->statut=3;
|
||||
@ -558,8 +557,11 @@ class Commande extends CommonOrder
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
|
||||
if ($result < 0) {
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->error=$mouvP->error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -567,14 +569,10 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_CANCEL',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CANCEL',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -585,8 +583,6 @@ class Commande extends CommonOrder
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$mouvP->error;
|
||||
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::cancel ".$errmsg, LOG_ERR);
|
||||
@ -812,12 +808,10 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -909,12 +903,10 @@ class Commande extends CommonOrder
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_CLONE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CLONE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// End
|
||||
@ -2228,14 +2220,10 @@ class Commande extends CommonOrder
|
||||
dol_syslog(get_class($this)."::classifyBilled", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_CLASSIFY_BILLED',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CLASSIFY_BILLED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -2247,8 +2235,6 @@ class Commande extends CommonOrder
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::classifyBilled ".$errmsg, LOG_ERR);
|
||||
@ -2453,16 +2439,13 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
//TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail
|
||||
if (! $error)
|
||||
{
|
||||
// Delete order details
|
||||
@ -2471,6 +2454,7 @@ class Commande extends CommonOrder
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$this->db->lasterror();
|
||||
}
|
||||
|
||||
// Delete order
|
||||
@ -2479,6 +2463,7 @@ class Commande extends CommonOrder
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$this->db->lasterror();
|
||||
}
|
||||
|
||||
// Delete linked object
|
||||
@ -2538,7 +2523,6 @@ class Commande extends CommonOrder
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
@ -3197,12 +3181,10 @@ class OrderLine extends CommonOrderLine
|
||||
}
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEORDER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
@ -3322,12 +3304,10 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEORDER_INSERT',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_INSERT',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -3439,12 +3419,10 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEORDER_UPDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_UPDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@ -482,14 +482,10 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
else if ($reshook < 0) $error++;
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -655,14 +651,10 @@ class Facture extends CommonInvoice
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_CLONE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_CLONE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// End
|
||||
@ -1100,14 +1092,10 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
@ -1262,14 +1250,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Removed extrafields
|
||||
@ -1403,7 +1387,6 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -1439,14 +1422,10 @@ class Facture extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_PAYED',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_PAYED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1495,14 +1474,10 @@ class Facture extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_UNPAYED',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_UNPAYED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1562,18 +1537,14 @@ class Facture extends CommonInvoice
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_CANCEL',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_CANCEL',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
@ -1791,14 +1762,11 @@ class Facture extends CommonInvoice
|
||||
// Trigger calls
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_VALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_VALIDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
//TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1872,17 +1840,15 @@ class Facture extends CommonInvoice
|
||||
$old_statut=$this->statut;
|
||||
$this->brouillon = 1;
|
||||
$this->statut = 0;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_UNVALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_UNVALIDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->statut=$old_statut;
|
||||
$this->brouillon=0;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -3567,18 +3533,14 @@ class FactureLigne extends CommonInvoiceLine
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEBILL_INSERT',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_INSERT',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@ -3683,18 +3645,14 @@ class FactureLigne extends CommonInvoiceLine
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEBILL_UPDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
@ -3719,26 +3677,22 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_DELETE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEBILL_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -104,13 +104,13 @@ class Localtax extends CommonObject
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax");
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LOCALTAX_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LOCALTAX_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
@ -165,12 +165,12 @@ class Localtax extends CommonObject
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LOCALTAX_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LOCALTAX_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -253,6 +253,12 @@ class Localtax extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LOCALTAX_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -264,12 +270,6 @@ class Localtax extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LOCALTAX_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/salaries/class/paymentsalary.class.php
|
||||
@ -124,14 +125,12 @@ class PaymentSalary extends CommonObject
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PAYMENT_SALARY_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -224,6 +223,12 @@ class PaymentSalary extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
@ -236,15 +241,6 @@ class PaymentSalary extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PAYMENT_SALARY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -283,6 +279,8 @@ class PaymentSalary extends CommonObject
|
||||
function create($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->amount=price2num(trim($this->amount));
|
||||
@ -356,7 +354,6 @@ class PaymentSalary extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$ok=1;
|
||||
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary");
|
||||
|
||||
@ -392,10 +389,10 @@ class PaymentSalary extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$acc->error;
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($ok)
|
||||
if (! $error)
|
||||
{
|
||||
// Add link 'payment_salary' in bank_url between payment and bank transaction
|
||||
$url=DOL_URL_ROOT.'/compta/salaries/fiche.php?id=';
|
||||
@ -404,7 +401,7 @@ class PaymentSalary extends CommonObject
|
||||
if ($result <= 0)
|
||||
{
|
||||
$this->error=$acc->error;
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -424,38 +421,25 @@ class PaymentSalary extends CommonObject
|
||||
if ($result <= 0)
|
||||
{
|
||||
$this->error=$acc->error;
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PAYMENT_SALARY_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End triggers
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
}
|
||||
else $ok=0;
|
||||
else $error++;
|
||||
|
||||
if ($ok)
|
||||
if (! $error)
|
||||
{
|
||||
if ($ok)
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -121,13 +121,12 @@ class Tva extends CommonObject
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva");
|
||||
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('TVA_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('TVA_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
@ -187,12 +186,12 @@ class Tva extends CommonObject
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('TVA_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('TVA_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -279,7 +278,12 @@ class Tva extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('TVA_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -291,12 +295,6 @@ class Tva extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('TVA_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -541,13 +539,16 @@ class Tva extends CommonObject
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called paiementtva
|
||||
|
||||
// Start triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('TVA_ADDPAYMENT',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End triggers
|
||||
|
||||
// Call trigger
|
||||
//XXX: Should be done just befor commit no ?
|
||||
$result=$this->call_trigger('TVA_ADDPAYMENT',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->id = 0;
|
||||
$ok = 0;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
if ($this->id > 0)
|
||||
{
|
||||
$ok=1;
|
||||
@ -595,7 +596,6 @@ class Tva extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -828,6 +828,11 @@ class Contrat extends CommonObject
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('CONTRACT_DELETE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -913,14 +918,6 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('CONTRACT_DELETE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// We remove directory
|
||||
@ -1178,6 +1175,15 @@ class Contrat extends CommonObject
|
||||
$result=$this->update_statut($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -1322,6 +1328,15 @@ class Contrat extends CommonObject
|
||||
$result=$this->update_statut($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -1357,6 +1372,11 @@ class Contrat extends CommonObject
|
||||
if ($this->statut >= 0)
|
||||
{
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet";
|
||||
@ -1371,11 +1391,6 @@ class Contrat extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_DELETE',$user);
|
||||
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -1836,11 +1851,6 @@ class Contrat extends CommonObject
|
||||
*/
|
||||
class ContratLigne extends CommonObject
|
||||
{
|
||||
var $db; //!< To store db handler
|
||||
var $error; //!< To return error code (or message)
|
||||
var $errors=array(); //!< To return several error codes (or messages)
|
||||
//var $element='contratdet'; //!< Id that identify managed objects
|
||||
//var $table_element='contratdet'; //!< Name of table without prefix where object is stored
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -151,7 +152,70 @@ class box_actions extends ModeleBoxes
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
global $langs, $conf;
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
if ($conf->global->SHOW_DIALOG_HOMEPAGE)
|
||||
{
|
||||
$actioncejour=false;
|
||||
$contents=$this->info_box_contents;
|
||||
$nblines=count($contents);
|
||||
$bcx[0] = 'class="box_pair"';
|
||||
$bcx[1] = 'class="box_impair"';
|
||||
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))
|
||||
{
|
||||
print '<div id="dialog" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
|
||||
print '<table width=100%>';
|
||||
for ($i=0, $n=$nblines; $i < $n; $i++)
|
||||
{
|
||||
if (isset($contents[$i]))
|
||||
{
|
||||
// on affiche que les évènement du jours ou passé
|
||||
// qui ne sont pas à 100%
|
||||
$actioncejour=true;
|
||||
$var=!$var;
|
||||
// TR
|
||||
$logo=$contents[$i][0]['logo'];
|
||||
$label=$contents[$i][1]['text'];
|
||||
$urlevent=$contents[$i][1]['url'];
|
||||
$logosoc=$contents[$i][2]['logo'];
|
||||
$nomsoc=$contents[$i][3]['text'];
|
||||
$urlsoc=$contents[$i][3]['url'];
|
||||
$dateligne=$contents[$i][4]['text'];
|
||||
$percentage=$contents[$i][5]['text'];
|
||||
print '<tr '.$bcx[$var].'>';
|
||||
print '<td align=center>';
|
||||
print img_object("",$logo);
|
||||
print '</td>';
|
||||
print '<td align=center><a href="'.$urlevent.'">'.$label.'</a></td>';
|
||||
print '<td align=center><a href="'.$urlsoc.'">'.img_object("",$logosoc)." ".$nomsoc.'</a></td>';
|
||||
print '<td align=center>'.$dateligne.'</td>';
|
||||
print '<td align=center>'.$percentage.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
}
|
||||
print '</div>';
|
||||
if ($actioncejour)
|
||||
{
|
||||
print '<script>';
|
||||
print '$( "#dialog" ).dialog({ autoOpen: true });';
|
||||
if ($conf->global->SHOW_DIALOG_HOMEPAGE > 1)
|
||||
{
|
||||
print 'setTimeout(function(){';
|
||||
print '$("#dialog").dialog("close");';
|
||||
print '}, '.($conf->global->SHOW_DIALOG_HOMEPAGE*1000).');';
|
||||
}
|
||||
print '</script>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<script>';
|
||||
print '$( "#dialog" ).dialog({ autoOpen: false });';
|
||||
print '</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -99,15 +99,10 @@ class Link extends CommonObject
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "links");
|
||||
|
||||
if ($this->id > 0) {
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINK_CREATE', $this, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors = $interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINK_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
@ -190,15 +185,10 @@ class Link extends CommonObject
|
||||
{
|
||||
if ($call_trigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface = new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINK_MODIFY', $this, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors = $interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINK_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -339,6 +329,11 @@ class Link extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$error = 0;
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINK_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Remove link
|
||||
@ -353,18 +348,6 @@ class Link extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
if (! $error) {
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINK_DELETE', $this, $user, $langs, $conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors = $interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$this->db->commit();
|
||||
|
||||
|
||||
@ -417,6 +417,10 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'LINECONTRACT_CREATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'LINECONTRACT_UPDATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
@ -484,6 +488,10 @@ class InterfaceDemo
|
||||
elseif ($action == 'BILL_SUPPLIER_CREATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'BILL_SUPPLIER_UPDATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'BILL_SUPPLIER_DELETE')
|
||||
{
|
||||
|
||||
@ -388,18 +388,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_VALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_VALIDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -653,12 +649,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_APPROVE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_APPROVE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -714,17 +708,16 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if ($error == 0)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_REFUSE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_REFUSE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
}
|
||||
// Fin appel triggers
|
||||
else
|
||||
$this->db->commit();
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -772,12 +765,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
$result = 0;
|
||||
$this->log($user, $statut, time());
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_CANCEL',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_CANCEL',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if ($error == 0)
|
||||
{
|
||||
@ -967,18 +958,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@ -1041,12 +1028,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_CLONE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_CLONE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// End
|
||||
@ -1222,18 +1207,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->update_price('','auto');
|
||||
@ -1295,18 +1276,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_SUPPLIER_DISPATCH',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@ -1369,15 +1346,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$result = 0;
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_SUPPLIER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1424,6 +1396,16 @@ class CommandeFournisseur extends CommonOrder
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -1461,18 +1443,6 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('ORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// We remove directory
|
||||
@ -1828,18 +1798,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEORDER_SUPPLIER_UPDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEORDER_SUPPLIER_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Mise a jour info denormalisees au niveau facture
|
||||
|
||||
@ -254,12 +254,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result=$this->update_price();
|
||||
if ($result > 0)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_SUPPLIER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -601,11 +599,9 @@ class FactureFournisseur extends CommonInvoice
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('BILL_SUPPLIER_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_UPDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
@ -673,13 +669,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_DELETE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -771,12 +764,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_SUPPLIER_PAYED',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_PAYED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -821,12 +812,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_SUPPLIER_UNPAYED',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_UNPAYED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -962,12 +951,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
// Triggers call
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('BILL_SUPPLIER_VALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1129,18 +1116,14 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEBILL_SUPPLIER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@ -1263,18 +1246,14 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEBILL_SUPPLIER_UPDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->errors=$interface->errors;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_SUPPLIER_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Update total price into invoice record
|
||||
@ -1312,14 +1291,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEBILL_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_SUPPLIER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -203,14 +203,10 @@ class ProductFournisseur extends Product
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('SUPPLIER_PRODUCT_BUYPRICE_UPDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++; $this->error=$interface->errors;
|
||||
}
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_UPDATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (empty($error))
|
||||
{
|
||||
@ -289,14 +285,10 @@ class ProductFournisseur extends Product
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('SUPPLIER_PRODUCT_BUYPRICE_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++; $this->error=$interface->errors;
|
||||
}
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (empty($error))
|
||||
{
|
||||
|
||||
@ -201,12 +201,10 @@ class PaiementFourn extends Paiement
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PAYMENT_SUPPLIER_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -120,12 +120,9 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
|
||||
if (! $notrigger)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($db);
|
||||
$result_trigger=$interface->run_triggers('ORDER_SUPPLIER_DISPATCH',$commande,$user,$langs,$conf);
|
||||
if ($result_trigger < 0) { $error++; $commande->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$commande->call_trigger('ORDER_SUPPLIER_DISPATCH',$user);
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
|
||||
@ -313,12 +313,10 @@ class Import
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('IMPORT_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('IMPORT_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,5 +41,6 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WH
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A1', 'Type A', 23, 1);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B2', 'Type B', 23, 1);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0);
|
||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0);
|
||||
|
||||
@ -142,12 +142,10 @@ class Opensurveysondage extends CommonObject
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
//// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('OPENSURVEY_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('OPENSURVEY_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,12 +336,10 @@ class Opensurveysondage extends CommonObject
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
//// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('OPENSURVEY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('OPENSURVEY_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -245,17 +245,17 @@ class MouvementStock
|
||||
|
||||
if ($movestock && ! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
|
||||
$this->product_id = $fk_product;
|
||||
$this->entrepot_id = $entrepot_id;
|
||||
$this->qty = $qty;
|
||||
|
||||
$result=$interface->run_triggers('STOCK_MOVEMENT',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('STOCK_MOVEMENT',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Restore previous value of product_id, entrepot_id, qty if trigger fail
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -331,7 +331,15 @@ class Resource extends CommonObject
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('RESOURCE_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."resource";
|
||||
$sql.= " WHERE rowid =".$rowid;
|
||||
|
||||
@ -343,18 +351,6 @@ class Resource extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('RESOURCE_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
@ -734,15 +730,10 @@ class Resource extends CommonObject
|
||||
{
|
||||
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('RESOURCE_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('RESOURCE_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -441,12 +441,10 @@ class Societe extends CommonObject
|
||||
|
||||
if ($ret >= 0)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('COMPANY_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('COMPANY_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
else $error++;
|
||||
|
||||
@ -879,12 +877,10 @@ class Societe extends CommonObject
|
||||
|
||||
if (! $error && $call_trigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('COMPANY_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('COMPANY_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1247,15 +1243,10 @@ class Societe extends CommonObject
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('COMPANY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
}
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('COMPANY_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user