X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fmedals.inc.php;h=e448358fb5febace8403c9c58f38ca598065ce85;hb=0783a5ed4d3409bcd7a7e1d908696159999810c8;hp=98d14d24e61a9a5c25cdbbd1da4d86b20da87966;hpb=5f30b30e8b2657ade5c727e98de286386ee002d8;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index 98d14d2..e448358 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -1,6 +1,6 @@ mid = $_idmedal; + parent::__construct($_user, false, 'medal', $_stamp); + $this->mid = $_idmedal; $this->gid = $_subidmedal; + if (is_null($this->gid)) { + $this->gid = 0; + } } // }}} @@ -101,10 +104,11 @@ class MedalReq extends Validate public function commit () { require_once 'notifs.inc.php'; - register_watch_op($this->uid, WATCH_FICHE, 'medals'); + register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals'); return XDB::execute('REPLACE INTO profile_medals_sub VALUES ({?}, {?}, {?})', - $this->uid, $this->mid, $this->gid); + $this->user->id(), $this->mid, + is_null($this->gid) ? 0 : $this->gid); } // }}}