From 73a33a6daea9f09d260ad4c4a73bf2cc1796b4f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2013 17:55:14 +0200 Subject: [PATCH 1/2] Fix: Bug to delete bank line --- htdocs/compta/bank/account.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index fe9cbdd0bfc..828dcf94262 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -120,7 +120,7 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) { $accline=new AccountLine($db); - $accline->fetch($_GET["rowid"]); + $result=$accline->fetch(GETPOST("rowid")); $result=$accline->delete(); } @@ -294,6 +294,14 @@ if ($id > 0 || ! empty($ref)) */ $param.='&account='.$object->id; + // Confirmation delete + if ($action == 'delete') + { + $text=$langs->trans('ConfirmDeleteTransaction'); + $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); + if ($ret == 'html') print '
'; + } + // Define transaction list navigation string $navig = '
'; //print 'nbpage='.$totalPages.' viewline='.$viewline.' limitsql='.$limitsql; @@ -316,14 +324,6 @@ if ($id > 0 || ! empty($ref)) $navig.='
'; //var_dump($navig); - // Confirmation delete - if ($action == 'delete') - { - $text=$langs->trans('ConfirmDeleteTransaction'); - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete'); - if ($ret == 'html') print '
'; - } - print ''; // Show title From 55d14f430cd49e5883a9c52d408fce1bf552e757 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2013 23:36:21 +0200 Subject: [PATCH 2/2] Fix: Search on supplier ref --- htdocs/fourn/facture/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 80b76772f09..540cbebea12 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -73,7 +73,7 @@ if ($mode == 'search') if ($modesearch == 'soc') { $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; - $sql.= " WHERE s.nom LIKE '%".$db->escape(strtolower($socname))."%'"; + $sql.= " WHERE s.nom LIKE '%".$db->escape($socname)."%'"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; } @@ -127,7 +127,8 @@ if (GETPOST('filtre')) if (GETPOST("search_ref")) { - $sql .= " AND fac.rowid = ".$db->escape(GETPOST("search_ref")); + if (is_numeric(GETPOST("search_ref"))) $sql .= " AND (fac.rowid = ".GETPOST("search_ref",'int')." OR fac.ref = '".$db->escape(GETPOST("search_ref"))."')"; // For backward compatibility + else $sql .= " AND fac.ref LIKE '%".$db->escape(GETPOST("search_ref"))."%'"; } if (GETPOST("search_ref_supplier")) {