parent
fc6382ea7e
commit
1ded34aa97
@ -19,7 +19,7 @@ For users:
|
||||
- Fix: [ bug #1502 ] DON_CREATE trigger does not intercept trigger action
|
||||
- Fix: [ bug #1505, #1504] Project trigger problem
|
||||
- Fix: [ bug #1463, #1464 ] Proposal triggers problem
|
||||
|
||||
- Fix: [ bug #1498, #1499 ] Shipment/Delivery triggers problem
|
||||
|
||||
For translators:
|
||||
- Update language files.
|
||||
|
||||
@ -275,12 +275,10 @@ class Expedition 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('SHIPPING_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SHIPPING_CREATE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -656,12 +654,10 @@ class Expedition 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('SHIPPING_VALIDATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SHIPPING_VALIDATE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -867,12 +863,10 @@ class Expedition 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('SHIPPING_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SHIPPING_MODIFY',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
@ -982,12 +976,10 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('SHIPPING_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SHIPPING_DELETE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -241,26 +241,34 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$result = $object->valid($user);
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$ret=$object->fetch($id); // Reload to get new records
|
||||
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
|
||||
}
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans($object->error),'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$ret=$object->fetch($id); // Reload to get new records
|
||||
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -446,15 +446,12 @@ class Livraison 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('DELIVERY_VALIDATE', $this, $user, $langs, $conf);
|
||||
// Fin appel triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('DELIVERY_VALIDATE',$user);
|
||||
// End call triggers
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error = $interface->errors;
|
||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
@ -604,14 +601,14 @@ class Livraison extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('DELIVERY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('DELIVERY_DELETE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -4;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user