<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// }}}
// {{{ constructor
- public function __construct($_titre, $_texte, $_pmin, $_pmax, $_expiration, $_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;
// }}}
// {{{ function readImage()
- private function readImage(PlUpload &$upload)
+ private function readImage(PlUpload $upload)
{
if ($upload->exists() && $upload->isType('image')) {
list($this->imgx, $this->imgy, $this->imgtype) = $upload->imageInfo();
protected function _mail_body($isok)
{
+ $you_have = ($this->formal ? 'vous aviez' : 'tu avais');
if ($isok) {
- return " L'annonce que tu avais proposée ({$this->titre}) vient d'être validée.";
+ return " L'annonce que $you_have proposée ({$this->titre}) vient d'être validée.";
} else {
- return " L'annonce que tu avais proposée ({$this->titre}) a été refusée.";
+ return " L'annonce que $you_have proposée ({$this->titre}) a été refusée.";
}
}
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={?},
expiration={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')",