X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Faxletter.php;h=b0f654e94f6d437fea0f005a6a3e4f9832e20bd9;hb=dd9b361324a289efb9b4c9d67c5324a3d5036d53;hp=b47f1c5b7430e0c69bfab50240d738791698e244;hpb=b5721865fb7b05671137dd164d3d97480b7a4ebf;p=platal.git diff --git a/modules/axletter.php b/modules/axletter.php index b47f1c5..b0f654e 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -179,7 +179,7 @@ class AXLetterModule extends PLModule } $page->trigSuccess("Les adresses soumises correspondent à un total de " . count(array_unique($ids)) . " camarades."); } - // XXX : no break here, since Vérifier is a subcase of Aperçu. + // No break here, since Vérifier is a subcase of Aperçu. case 'Aperçu': $this->load('axletter.inc.php'); $al = new AXLetter(array($id, $short_name, $subject, $title, $body, $signature, @@ -188,10 +188,15 @@ class AXLetterModule extends PLModule break; case 'Confirmer': - XDB::execute("REPLACE INTO axletter - SET id = {?}, short_name = {?}, subject = {?}, title = {?}, body = {?}, - signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}, subset = {?}, subset_rm = {?}", - $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to) : null, $subset_rm); + XDB::execute('INSERT INTO axletter (id, short_name, subject, title, body, signature, + promo_min, promo_max, echeance, subset, subset_rm) + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}) + ON DUPLICATE KEY UPDATE short_name = VALUES(short_name), subject = VALUES(subject), title = VALUES(title), + body = VALUES(body), signature = VALUES(signature), promo_min = VALUES(promo_min), + promo_max = VALUES(promo_max), echeance = VALUES(echeance), subset = VALUES(subset), + subset_rm = VALUES(subset_rm)', + $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, + $subset ? implode("\n", $subset_to) : null, $subset_rm); if (!$saved) { global $globals; $mailer = new PlMailer();