This commit is contained in:
Raphaël Doursenaud 2012-05-22 15:15:07 +02:00
commit 96294403e2
3 changed files with 27 additions and 10 deletions

View File

@ -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
{

View File

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

View File

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