X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=050318c042db14e38fec6d78546a310ebd30ad71;hb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;hp=97e1b150b298aeb1ccb418fd034d4dc4d3a77c6c;hpb=34062b64fa9f161dc071527b2e864496555d598d;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 97e1b15..050318c 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -1,6 +1,6 @@ stamp = date('YmdHis'); $this->unique = $_unique; $this->type = $_type; - $res = XDB::query("SELECT promo_display AS promo - FROM profile_display - WHERE uid={?}", $_uid); - $this->promo = $res->fetchOneCell(); + $this->promo = $this->user->promo(); } // }}} @@ -187,7 +184,7 @@ abstract class Validate $mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}"); $mailer->addTo($globals->core->admin_email); - $body = "Validation {$this->type} pour {$this->user->id()}\n\n" + $body = "Validation {$this->type} pour {$this->user->login()}\n\n" . S::user()->login() . " a ajouté le commentaire :\n\n" . Env::v('comm') . "\n\n" . "cf la discussion sur : " . $globals->baseurl . "/admin/validate"; @@ -219,7 +216,7 @@ abstract class Validate $this->trigSuccess('Email de refus envoyé'); return true; } else { - $this->trigError('pas de motivation pour le refus !!!'); + $this->trigError('Pas de motivation pour le refus !!!'); } } @@ -240,8 +237,9 @@ abstract class Validate $body = ($this->user->isFemale() ? "Chère camarade,\n\n" : "Cher camarade,\n\n") . $this->_mail_body($isok) - . (Env::has('comm') ? "\n\n".Env::v('comm') : '') - . "\n\nCordialement,\n\n-- \nL'équipe de Polytechnique.org\n"; + . (Env::has('comm') ? "\n\n" . Env::v('comm') : '') + . "\n\nCordialement,\n-- \nL'équipe de Polytechnique.org\n" + . $this->_mail_ps($isok); $mailer->setTxtBody(wordwrap($body)); $mailer->send(); @@ -337,6 +335,14 @@ abstract class Validate abstract protected function _mail_subj(); // }}} + // {{{ function _mail_ps + + protected function _mail_ps($isok) + { + return ''; + } + + // }}} // {{{ function commit() /** fonction à utiliser pour insérer les données dans x4dat @@ -367,7 +373,7 @@ abstract class Validate static $answers_table; if (!isset($answers_table[$this->type])) { $r = XDB::query("SELECT id, title, answer FROM requests_answers WHERE category = {?}", $this->type); - $answers_table[$this->type] = $r->fetchAllAssoc($r); + $answers_table[$this->type] = $r->fetchAllAssoc(); } return $answers_table[$this->type]; }