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 { 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']) { 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'); } }