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