From b1eef7cd4213031f96f1afb7726537cfa89764a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Feb 2014 17:29:52 +0100 Subject: [PATCH] Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product --- htdocs/comm/propal.php | 8 ++++++-- htdocs/commande/fiche.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 48cd8531a69..fce3661c0ce 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -637,7 +637,9 @@ else if ($action == "setabsolutediscount" && $user->rights->propal->creer) else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->propal->creer) { // Set if we used free entry or predefined product - if (GETPOST('addline_libre')) + if (GETPOST('addline_libre') + || (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) { $predef=''; $idprod=0; @@ -645,7 +647,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $price_ht = GETPOST('price_ht'); $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); } - if (GETPOST('addline_predefined')) + if (GETPOST('addline_predefined') + || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) { $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $idprod=GETPOST('idprod', 'int'); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 7a5b74165bb..bfafd72d307 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -571,7 +571,9 @@ else if ($action == 'addline' && $user->rights->commande->creer) $error = false; // Set if we used free entry or predefined product - if (GETPOST('addline_libre')) + if (GETPOST('addline_libre') + || (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) { $predef=''; $idprod=0; @@ -579,7 +581,9 @@ else if ($action == 'addline' && $user->rights->commande->creer) $price_ht = GETPOST('price_ht'); $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); } - if (GETPOST('addline_predefined')) + if (GETPOST('addline_predefined') + || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field + ) { $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $idprod=GETPOST('idprod', 'int');