Merge pull request #2171 from marcosgdf/bug-1649
Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify
This commit is contained in:
commit
f3fded2a0a
@ -16,6 +16,7 @@ English Dolibarr ChangeLog
|
|||||||
- Fix: Show sender Country on PDF docs when sender Country <> receiver Country
|
- Fix: Show sender Country on PDF docs when sender Country <> receiver Country
|
||||||
- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS
|
- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS
|
||||||
- Fix: [ bug #1749 ] Undefined $mailchimp
|
- Fix: [ bug #1749 ] Undefined $mailchimp
|
||||||
|
- Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify
|
||||||
- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks
|
- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks
|
||||||
- Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs
|
- Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs
|
||||||
|
|
||||||
|
|||||||
@ -79,17 +79,21 @@ $object = new Societe($db);
|
|||||||
$parameters = array('socid' => $id);
|
$parameters = array('socid' => $id);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
|
||||||
|
|
||||||
|
//Some actions show a "cancel" input submit button with name="cancel"
|
||||||
|
$cancelbutton = GETPOST('cancel');
|
||||||
|
|
||||||
if ($action == 'setcustomeraccountancycode')
|
if ($action == 'setcustomeraccountancycode')
|
||||||
{
|
{
|
||||||
$result=$object->fetch($id);
|
if (!$cancelbutton) {
|
||||||
$object->code_compta=$_POST["customeraccountancycode"];
|
$result=$object->fetch($id);
|
||||||
$result=$object->update($object->id,$user,1,1,0);
|
$object->code_compta=$_POST["customeraccountancycode"];
|
||||||
if ($result < 0)
|
$result=$object->update($object->id,$user,1,1,0);
|
||||||
{
|
if ($result < 0)
|
||||||
$mesgs[]=join(',',$object->errors);
|
{
|
||||||
|
$mesgs[]=join(',',$object->errors);
|
||||||
|
}
|
||||||
|
$action="";
|
||||||
}
|
}
|
||||||
$action="";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// conditions de reglement
|
// conditions de reglement
|
||||||
@ -139,10 +143,14 @@ if ($action == 'cstc')
|
|||||||
// Update communication level
|
// Update communication level
|
||||||
if ($action == 'setOutstandingBill')
|
if ($action == 'setOutstandingBill')
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
if (!$cancelbutton) {
|
||||||
$object->outstanding_limit=GETPOST('OutstandingBill');
|
$object->fetch($id);
|
||||||
$result=$object->set_OutstandingBill($user);
|
$object->outstanding_limit = GETPOST('OutstandingBill');
|
||||||
if ($result < 0) setEventMessage($object->error,'errors');
|
$result = $object->set_OutstandingBill($user);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessage($object->error, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -60,14 +60,18 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
|
|||||||
|
|
||||||
if ($action == 'setsupplieraccountancycode')
|
if ($action == 'setsupplieraccountancycode')
|
||||||
{
|
{
|
||||||
$result=$object->fetch($id);
|
$cancelbutton = GETPOST('cancel');
|
||||||
$object->code_compta_fournisseur=$_POST["supplieraccountancycode"];
|
|
||||||
$result=$object->update($object->id,$user,1,0,1);
|
if (!$cancelbutton) {
|
||||||
if ($result < 0)
|
|
||||||
{
|
$result = $object->fetch($id);
|
||||||
$mesg=join(',',$object->errors);
|
$object->code_compta_fournisseur = $_POST["supplieraccountancycode"];
|
||||||
}
|
$result = $object->update($object->id, $user, 1, 0, 1);
|
||||||
$action="";
|
if ($result < 0) {
|
||||||
|
$mesg = join(',', $object->errors);
|
||||||
|
}
|
||||||
|
$action = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// conditions de reglement
|
// conditions de reglement
|
||||||
if ($action == 'setconditions' && $user->rights->societe->creer)
|
if ($action == 'setconditions' && $user->rights->societe->creer)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user