Fix: [ bug #1533 ] Links triggers do not show trigger error message

This commit is contained in:
Marcos García de La Fuente 2014-12-23 11:39:43 +01:00
parent 51a26ea5a9
commit 8a14409974
3 changed files with 10 additions and 3 deletions

View File

@ -100,6 +100,7 @@ For users:
- Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1533 ] Links triggers do not show trigger error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
- Fix: datepicker first day of week can be monday by setting into display setup

View File

@ -187,7 +187,7 @@ class Link extends CommonObject
{
// Call trigger
$result=$this->call_trigger('LINK_MODIFY',$user);
if ($result < 0) $error++;
if ($result < 0) $error++;
// End call triggers
}
@ -197,6 +197,7 @@ class Link extends CommonObject
$this->db->commit();
return 1;
} else {
setEventMessages('', $this->errors, 'errors');
$this->db->rollback();
return -1;
}

View File

@ -72,11 +72,16 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$link->id = $linkid;
$link->fetch();
$res = $link->delete($user);
$langs->load('link');
if ($res) {
if ($res > 0) {
setEventMessage($langs->trans("LinkRemoved", $link->label));
} else {
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
if (count($link->errors)) {
setEventMessages('', $link->errors, 'errors');
} else {
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
}
}
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':''));