projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevents warnings in flags template.
[platal.git]
/
include
/
reminder
/
promotion_ml.inc.php
diff --git
a/include/reminder/promotion_ml.inc.php
b/include/reminder/promotion_ml.inc.php
index
b67b59b
..
987785e
100644
(file)
--- a/
include/reminder/promotion_ml.inc.php
+++ b/
include/reminder/promotion_ml.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-23,18
+23,19
@@
class ReminderPromotionMl extends Reminder
{
public function HandleAction($action)
{
{
public function HandleAction($action)
{
+ $user = S::user();
switch ($action) {
case 'yes':
$res = XDB::query('SELECT id
switch ($action) {
case 'yes':
$res = XDB::query('SELECT id
- FROM group
ex.asso
+ FROM group
s
WHERE diminutif = {?}',
WHERE diminutif = {?}',
-
S::v('promo'
));
+
$user->profile()->yearPromo(
));
$asso_id = $res->fetchOneCell();
$asso_id = $res->fetchOneCell();
- XDB::execute('REPLACE INTO group
ex.membre
s (uid, asso_id)
+ XDB::execute('REPLACE INTO group
_member
s (uid, asso_id)
VALUES ({?}, {?})',
VALUES ({?}, {?})',
-
S::v('uid'
), $asso_id);
- $mmlist = new MMList(
S::v('uid'), S::v('password')
);
- $mmlist->subscribe('promo' .
S::v('promo'
));
+
$user->id(
), $asso_id);
+ $mmlist = new MMList(
$user
);
+ $mmlist->subscribe('promo' .
$user->profile()->yearPromo(
));
$this->UpdateOnYes();
break;
$this->UpdateOnYes();
break;
@@
-67,12
+68,11
@@
class ReminderPromotionMl extends Reminder
// We only test if the user is in her promotion group for it is too
// expensive to check if she is in the corresponding ML as well.
$res = XDB::query('SELECT COUNT(*)
// We only test if the user is in her promotion group for it is too
// expensive to check if she is in the corresponding ML as well.
$res = XDB::query('SELECT COUNT(*)
- FROM group
ex.membre
s
+ FROM group
_member
s
WHERE uid = {?} AND asso_id = (SELECT id
WHERE uid = {?} AND asso_id = (SELECT id
- FROM group
ex.asso
+ FROM group
s
WHERE diminutif = {?})',
WHERE diminutif = {?})',
- $user->id(), S::v('promo'));
-
+ $user->id(), $user->profile()->yearPromo());
$mlCount = $res->fetchOneCell();
if ($mlCount) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
$mlCount = $res->fetchOneCell();
if ($mlCount) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);