<?php
/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
public $evt;
public $evt_intitule;
- public $rules = "Vérifier que les balises <salutation>, <prenom>, <nom> et <montant> n'ont pas été modifiées.
+ public $rules = "Vérifier que les balises <salutation>, <prenom>, <nom>, <montant> et <comment> n'ont pas été modifiées.
Vérifier que le demandeur n'a pas laissé les crochets [].
Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, laisser la validation à un trésorier";
// }}}
// {{{ constructor
- public function __construct(User &$_user, $_intitule, $_site, $_montant, $_msg,
+ public function __construct(User $_user, $_intitule, $_site, $_montant, $_msg,
$_montantmin=0, $_montantmax=999, $_asso_id = 0,
$_evt = 0, $_stamp=0)
{
$this->montant_max = $_montantmax;
if ($_asso_id) {
- $res = XDB::query("SELECT nom FROM groupex.asso WHERE id = {?}", $_asso_id);
+ $res = XDB::query("SELECT nom FROM groups WHERE id = {?}", $_asso_id);
$this->asso = $res->fetchOneCell();
}
if ($_asso_id && $_evt) {
- $res = XDB::query("SELECT intitule FROM groupex.evenements WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt);
+ $res = XDB::query("SELECT intitule FROM group_events WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt);
$this->evt_intitule = $res->fetchOneCell();
}
}
public function commit()
{
- $res = XDB::query("SELECT MAX(id) FROM paiement.paiements");
+ $res = XDB::query("SELECT MAX(id) FROM payments");
$id = $res->fetchOneCell()+1;
- $ret = XDB::execute("INSERT INTO paiement.paiements VALUES
+ $ret = XDB::execute("INSERT INTO payments VALUES
( {?}, {?}, {?}, '',
{?}, {?}, {?},
{?}, {?}, {?} )
$this->montant, $this->montant_min, $this->montant_max,
$this->user->bestEmail(), $this->msg_reponse, $this->asso_id);
if ($this->asso_id && $this->evt) {
- XDB::execute("UPDATE groupex.evenements
+ XDB::execute("UPDATE group_events
SET paiement_id = {?}
WHERE asso_id = {?} AND eid = {?}",
$id, $this->asso_id, $this->evt);
$res = XDB::query("SELECT a.nom, a.diminutif, e.intitule
- FROM groupex.asso AS a
- INNER JOIN groupex.evenements AS e ON (a.id = e.asso_id)
+ FROM groups AS a
+ INNER JOIN group_events AS e ON (a.id = e.asso_id)
WHERE e.eid = {?}",
$this->evt);
list($nom, $diminutif, $evt) = $res->fetchOneRow();
require_once dirname(__FILE__) . '/../../modules/xnetevents/xnetevents.inc.php';
- $participants = get_event_participants(get_event_detail($this->evt, false, $this->asso_id), null, 'nom');
+ $participants = get_event_participants(get_event_detail($this->evt, false, $this->asso_id), null);
foreach ($participants as &$u) {
if (!$u['notify_payment']) {
continue;
$mailer->assign('payment', $id);
$mailer->assign('prenom', $u['prenom']);
$mailer->assign('topay', $topay);
- $mailer->assign('to', $u['email']);
+
+ if (strpos($u['email'], '@') === false) {
+ $mailer->assign('to', $u['email'] . '@' . $globals->mail->domain);
+ } else {
+ $mailer->assign('to', $u['email']);
+ }
$mailer->send();
}
}