X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Faxletter.php;h=466dcc2ae071fb12c990773e39149a56cdcc3c16;hb=aef0283bdf24c94d640a16ccac08191980ae7a25;hp=9414f8df980086ad93c72d74a149a2f459292d39;hpb=a0c034efcf0777541e087500e94853f515cda1ca;p=platal.git diff --git a/modules/axletter.php b/modules/axletter.php index 9414f8d..466dcc2 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -1,6 +1,6 @@ kill("L'envoi de l'annonce {$al->title()} est annulé"); + $page->killSuccess("L'envoi de l'annonce {$al->title()} est annulé."); } function handler_valid(&$page, $force = null) @@ -260,7 +260,7 @@ class AXLetterModule extends PLModule return; } - $page->kill("L'envoi de l'annonce aura lieu dans l'heure qui vient."); + $page->killSuccess("L'envoi de l'annonce aura lieu dans l'heure qui vient."); } function handler_show(&$page, $nid = 'last') @@ -268,16 +268,20 @@ class AXLetterModule extends PLModule $this->load('axletter.inc.php'); $page->changeTpl('axletter/show.tpl'); - $nl = new AXLetter($nid); - if (Get::has('text')) { - $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme')); - } else { - $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme')); - } - if (Post::has('send')) { - $nl->sendTo(S::user()->login(), S::user()->bestEmail(), - S::v('prenom'), S::v('nom'), - S::v('femme'), S::v('mail_fmt') != 'texte'); + try { + $nl = new AXLetter($nid); + if (Get::has('text')) { + $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme')); + } else { + $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme')); + } + if (Post::has('send')) { + $nl->sendTo(S::user()->login(), S::user()->bestEmail(), + S::v('prenom'), S::v('nom'), + S::v('femme'), S::v('mail_fmt') != 'texte'); + } + } catch (MailNotFound $e) { + return PL_NOT_FOUND; } } @@ -365,7 +369,7 @@ class AXLetterModule extends PLModule return $id ? $id : '0'; } - function createHash($line, $key) + function createHash($line, $partial_result, $key) { $hash = implode(time(), $line) . rand(); $hash = md5($hash);