From 016872b49ff56e639c5b3cac95bb52eea37c4815 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 11 Apr 2009 18:28:11 +0200 Subject: [PATCH] Fixes changes in graduation year. --- include/validations/orange.inc.php | 15 +++++++++------ templates/include/form.valid.orange.tpl | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/validations/orange.inc.php b/include/validations/orange.inc.php index ae5f3ee..1d2acda 100644 --- a/include/validations/orange.inc.php +++ b/include/validations/orange.inc.php @@ -27,7 +27,9 @@ class OrangeReq extends Validate public $unique = true; - public $promo_sortie; + public $oldGradYear; + public $newGradYear; + public $entryYear; public $rules = "À priori accepter (la validation sert à repousser les petits malins). Refuse si tu connais la personne et que tu es sûr @@ -36,14 +38,15 @@ class OrangeReq extends Validate // }}} // {{{ constructor - public function __construct(User &$_user, $_sortie) + public function __construct(User &$_user, $_newGradYear) { parent::__construct($_user, true, 'orange'); - $this->promo_sortie = $_sortie; + $this->newGradYear = $_newGradYear; $res = XDB::query("SELECT entry_year FROM profile_education - WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $_uid); - $this->promo = $res->fetchOneCell(); + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->user->id()); + $this->entryYear = $res->fetchOneCell(); + $this->oldGradYear = $this->entryYear + 3; } // }}} @@ -83,7 +86,7 @@ class OrangeReq extends Validate { XDB::execute("UPDATE profile_education SET grad_year = {?} - WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->promo_sortie, $this->uid); + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->newGradYear, $this->user->id()); return true; } diff --git a/templates/include/form.valid.orange.tpl b/templates/include/form.valid.orange.tpl index d4c4741..6b8a357 100644 --- a/templates/include/form.valid.orange.tpl +++ b/templates/include/form.valid.orange.tpl @@ -23,11 +23,11 @@ Promotion : - {$valid->user->promo()} + {$valid->entryYear} Année de sortie : - {$valid->promo_sortie} au lieu de {math equation="a + b" a=$valid->user->promo() b=3} + {$valid->newGradYear} au lieu de {$valid->oldGradYear} {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} -- 2.1.4