X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fevts.inc.php;h=4a7416f6baf688c6e9992b6ea852ff50789f9933;hb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;hp=bb2ebb5fa6b7fdd1a593a49e783ada87fd92c8cd;hpb=684195f33b11e3067200dd3a9e14304bd7d04463;p=platal.git diff --git a/include/validations/evts.inc.php b/include/validations/evts.inc.php index bb2ebb5..4a7416f 100644 --- a/include/validations/evts.inc.php +++ b/include/validations/evts.inc.php @@ -30,7 +30,7 @@ class EvtReq extends Validate public $texte; public $pmin; public $pmax; - public $peremption; + public $expiration; public $comment; public $imgtype; @@ -41,14 +41,14 @@ class EvtReq extends Validate // }}} // {{{ constructor - public function __construct($_titre, $_texte, $_pmin, $_pmax, $_peremption, $_comment, User &$_user, PlUpload &$upload = null) + public function __construct($_titre, $_texte, $_pmin, $_pmax, $_expiration, $_comment, User &$_user, PlUpload &$upload = null) { parent::__construct($_user, false, 'evts'); $this->titre = $_titre; $this->texte = $_texte; $this->pmin = $_pmin; $this->pmax = $_pmax; - $this->peremption = $_peremption; + $this->expiration = $_expiration; $this->comment = $_comment; if ($upload) { $this->readImage($upload); @@ -92,7 +92,7 @@ class EvtReq extends Validate $this->texte = Env::v('texte'); $this->pmin = Env::i('promo_min'); $this->pmax = Env::i('promo_max'); - $this->peremption = Env::v('peremption'); + $this->expiration = Env::v('expiration'); if (@$_FILES['image']['tmp_name']) { $upload = PlUpload::get($_FILES['image'], S::user()->login(), 'event'); if (!$upload) { @@ -134,11 +134,12 @@ class EvtReq extends Validate public function commit() { + /* TODO: refines this filter on promotions by using userfilter. */ if (XDB::execute("INSERT INTO announces SET uid = {?}, creation_date=NOW(), titre={?}, texte={?}, - peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')", + expiration={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')", $this->user->id(), $this->titre, $this->texte, - $this->peremption, $this->pmin, $this->pmax)) { + $this->expiration, $this->pmin, $this->pmax)) { $eid = XDB::insertId(); if ($this->img) { XDB::execute("INSERT INTO announce_photos