X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fmedals.inc.php;h=16f5b99730958fe89434f7d6eaf2ebd14b1cad8f;hb=a19178e9a93c4eb3eb750845e85f87f2294ed1e4;hp=e448358fb5febace8403c9c58f38ca598065ce85;hpb=1f58ccb1e75eca08fbd04971d617ea372bc77b5a;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index e448358..16f5b99 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -1,6 +1,6 @@ gid, $this->mid); return $r->fetchOneCell(); } @@ -89,7 +89,7 @@ class MedalReq extends Validate public function submit() { $res = XDB::query("SELECT FIND_IN_SET('validation', flags) - FROM profile_medals + FROM profile_medal_enum WHERE id = {?}", $this->mid); if ($res->fetchOneCell()) { parent::submit(); @@ -103,11 +103,9 @@ class MedalReq extends Validate public function commit () { - require_once 'notifs.inc.php'; - register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals'); - return XDB::execute('REPLACE INTO profile_medals_sub + return XDB::execute('REPLACE INTO profile_medals VALUES ({?}, {?}, {?})', - $this->user->id(), $this->mid, + $this->user->profile()->id(), $this->mid, is_null($this->gid) ? 0 : $this->gid); }