From 6cf8c5c102e5cd5fea96a0dba71b2e0157e2286c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2012 10:37:03 +0200 Subject: [PATCH 1/3] Fix: Check for duplicate must ignore spaces before and after --- htdocs/societe/soc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f79e031c927..12f0b0e34a3 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -198,15 +198,18 @@ if (empty($reshook)) $action = ($action=='add'?'create':'edit'); } + // Check for duplicate prof id for ($i = 1; $i < 3; $i++) { - $slabel="idprof".$i; - if (($_POST[$slabel] && $object->id_prof_verifiable($i))) + $slabel="idprof".$i; + $_POST[$slabel]=trim($_POST[$slabel]); + $vallabel=$_POST[$slabel]; + if ($vallabel && $object->id_prof_verifiable($i)) { - if($object->id_prof_exists($i,$_POST["$slabel"],$object->id)) + if($object->id_prof_exists($i,$vallabel,$object->id)) { $langs->load("errors"); - $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $_POST[$slabel]); + $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel); $action = ($action=='add'?'create':'edit'); } } From 23226ad4728afd3bb04ab143936d67e8b4455d62 Mon Sep 17 00:00:00 2001 From: FHenry Date: Mon, 21 May 2012 11:00:08 +0200 Subject: [PATCH 2/3] correct bug #410 --- htdocs/comm/mailing/cibles.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 14b55e80b75..b4fba310447 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -151,13 +151,26 @@ if ($action == 'delete') $sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$id; $resql=$db->query($sql); if ($resql) - { - $file = $dirmod."/modules_mailings.php"; - $classname = "MailingTargets"; - require_once($file); + { //on récurpére l'id du mailing + $id = GETPOST('id','int'); - $obj = new $classname($db); - $obj->update_nb($id); + if (!empty($id)) + { + $file = $dirmod."/modules_mailings.php"; + $classname = "MailingTargets"; + require_once($file); + + $obj = new $classname($db); + $obj->update_nb($id); + + Header("Location: cibles.php?id=".$id); + exit; + } + else + { + Header("Location: liste.php"); + exit; + } } else { From 952864f5324990b57cc49ecb2051d9415055ddb5 Mon Sep 17 00:00:00 2001 From: juanjo Date: Mon, 21 May 2012 15:39:15 +0200 Subject: [PATCH 3/3] [ bug #399 ] Bad calculation of local taxes in update line products --- htdocs/fourn/facture/fiche.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index ad987627352..04fcd1e35ef 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -402,6 +402,7 @@ elseif ($action == 'update_line') if ($_REQUEST['etat'] == '1' && ! $_REQUEST['cancel']) // si on valide la modification { $object->fetch($id); + $object->fetch_thirdparty(); if ($_POST['puht']) {