X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fmedals.inc.php;h=7e65dc5cee7be8653c95f3e9d226d93576970de6;hb=be6ab042d1dc34d9e42557281b48dd8da400231b;hp=a742da5e6dd3d93c08e9f81d68aa8cae13606c4b;hpb=010268b2e818de5aa8db1cef05bca1c91701b2f9;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index a742da5..7e65dc5 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -42,7 +42,7 @@ class MedalReq extends Validate // {{{ function formu() public function formu() - { + { return 'include/form.valid.medals.tpl'; } @@ -73,11 +73,11 @@ class MedalReq extends Validate { //var_dump($this); $r = XDB::query(" - SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text) + SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text) FROM profile_medals AS m LEFT JOIN profile_medals_grades AS g ON(g.mid = m.id AND g.gid = {?}) WHERE m.id = {?}", $this->gid, $this->mid); - return $r->fetchOneCell(); + return $r->fetchOneCell(); } // }}} @@ -104,6 +104,20 @@ class MedalReq extends Validate } // }}} + // {{{ function get_request($medal) + + static public function get_request($uid, $type) + { + $reqs = Validate::get_typed_requests($uid, 'medal'); + foreach ($reqs as &$req) { + if ($req->mid == $type) { + return $req; + } + } + return null; + } + + // }}} } // }}}