projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removes the call to get_user_forlife in massmailer, and updates dependencies of metho...
[platal.git]
/
modules
/
axletter.php
diff --git
a/modules/axletter.php
b/modules/axletter.php
index
68577c5
..
7b7f754
100644
(file)
--- a/
modules/axletter.php
+++ b/
modules/axletter.php
@@
-53,7
+53,7
@@
class AXLetterModule extends PLModule
require_once dirname(__FILE__) . '/axletter/axletter.inc.php';
$page->changeTpl('axletter/index.tpl');
require_once dirname(__FILE__) . '/axletter/axletter.inc.php';
$page->changeTpl('axletter/index.tpl');
- $page->
assign('xorg_title',
'Polytechnique.org - Envois de l\'AX');
+ $page->
setTitle(
'Polytechnique.org - Envois de l\'AX');
switch ($action) {
case 'in': AXLetter::subscribe(); break;
switch ($action) {
case 'in': AXLetter::subscribe(); break;
@@
-119,27
+119,27
@@
class AXLetterModule extends PLModule
$title = $subject;
}
if (!$subject || !$title || !$body) {
$title = $subject;
}
if (!$subject || !$title || !$body) {
- $page->trig("L'article doit avoir un sujet et un contenu");
+ $page->trig
Error
("L'article doit avoir un sujet et un contenu");
Post::kill('valid');
}
if (($promo_min > $promo_max && $promo_max != 0)||
($promo_min != 0 && ($promo_min <= 1900 || $promo_min >= 2020)) ||
($promo_max != 0 && ($promo_max <= 1900 || $promo_max >= 2020)))
{
Post::kill('valid');
}
if (($promo_min > $promo_max && $promo_max != 0)||
($promo_min != 0 && ($promo_min <= 1900 || $promo_min >= 2020)) ||
($promo_max != 0 && ($promo_max <= 1900 || $promo_max >= 2020)))
{
- $page->trig("L'intervalle de promotions n'est pas valide");
+ $page->trig
Error
("L'intervalle de promotions n'est pas valide");
Post::kill('valid');
}
if (empty($short_name)) {
Post::kill('valid');
}
if (empty($short_name)) {
- $page->trig("L'annonce doit avoir un nom raccourci pour simplifier la navigation dans les archives");
+ $page->trig
Error
("L'annonce doit avoir un nom raccourci pour simplifier la navigation dans les archives");
Post::kill('valid');
} elseif (!preg_match('/^[a-z][-a-z0-9]*[a-z0-9]$/', $short_name)) {
Post::kill('valid');
} elseif (!preg_match('/^[a-z][-a-z0-9]*[a-z0-9]$/', $short_name)) {
- $page->trig("Le nom raccourci n'est pas valide, il doit comporter au moins 2 caractères et n'être composé "
+ $page->trig
Error
("Le nom raccourci n'est pas valide, il doit comporter au moins 2 caractères et n'être composé "
. "que de chiffres, lettres et tirets");
Post::kill('valid');
} elseif ($short_name != Post::v('old_short_name')) {
$res = XDB::query("SELECT id FROM axletter WHERE short_name = {?}", $short_name);
if ($res->numRows() && $res->fetchOneCell() != $id) {
. "que de chiffres, lettres et tirets");
Post::kill('valid');
} elseif ($short_name != Post::v('old_short_name')) {
$res = XDB::query("SELECT id FROM axletter WHERE short_name = {?}", $short_name);
if ($res->numRows() && $res->fetchOneCell() != $id) {
- $page->trig("Le nom $short_name est déjà utilisé, merci d'en choisir un autre");
+ $page->trig
Error
("Le nom $short_name est déjà utilisé, merci d'en choisir un autre");
$short_name = Post::v('old_short_name');
if (empty($short_name)) {
Post::kill('valid');
$short_name = Post::v('old_short_name');
if (empty($short_name)) {
Post::kill('valid');
@@
-164,14
+164,14
@@
class AXLetterModule extends PLModule
global $globals;
$mailer = new PlMailer();
$mailer->setFrom("support@" . $globals->mail->domain);
global $globals;
$mailer = new PlMailer();
$mailer->setFrom("support@" . $globals->mail->domain);
- $mailer->setSubject("Un nouveau projet d
e
mail de l'AX vient d'être proposé");
- $mailer->setTxtBody("Un nouve
au
mail vient d'être rédigé en prévision d'un envoi prochain. Vous pouvez "
+ $mailer->setSubject("Un nouveau projet d
'e
mail de l'AX vient d'être proposé");
+ $mailer->setTxtBody("Un nouve
l e
mail vient d'être rédigé en prévision d'un envoi prochain. Vous pouvez "
. "le modifier jusqu'à ce qu'il soit verrouillé pour l'envoi\n\n"
. "le modifier jusqu'à ce qu'il soit verrouillé pour l'envoi\n\n"
- . "Le sujet d
u
mail : $subject\n"
+ . "Le sujet d
e l'e
mail : $subject\n"
. "L'échéance d'envoi est fixée à $echeance.\n"
. "L'échéance d'envoi est fixée à $echeance.\n"
- . "L
e
mail pourra néanmoins partir avant cette échéance si un administrateur de "
+ . "L
'e
mail pourra néanmoins partir avant cette échéance si un administrateur de "
. "Polytechnique.org le valide.\n\n"
. "Polytechnique.org le valide.\n\n"
- . "Pour modifier, valider ou annuler l
e
mail :\n"
+ . "Pour modifier, valider ou annuler l
'e
mail :\n"
. "https://www.polytechnique.org/ax/edit\n"
. "-- \n"
. "Association Polytechnique.org\n");
. "https://www.polytechnique.org/ax/edit\n"
. "-- \n"
. "Association Polytechnique.org\n");
@@
-275,9
+275,9
@@
class AXLetterModule extends PLModule
$nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
}
if (Post::has('send')) {
$nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
}
if (Post::has('send')) {
- $nl->sendTo(S::
v('prenom'), S::v('nom'
),
- S::v('
bestalias'), S::v('femme
'),
- S::v('mail_fmt') != 'texte');
+ $nl->sendTo(S::
user()->login(), S::user()->bestEmail(
),
+ S::v('
prenom'), S::v('nom
'),
+ S::v('
femme'), S::v('
mail_fmt') != 'texte');
}
}
}
}
@@
-302,7
+302,7
@@
class AXLetterModule extends PLModule
break;
}
if (!$res) {
break;
}
if (!$res) {
- $page->trig("Personne ne correspond à l'identifiant '$uid'");
+ $page->trig
Error
("Personne ne correspond à l'identifiant '$uid'");
}
}
}
}
}
}