projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/platal-0.10.0'
[platal.git]
/
include
/
validations
/
paiements.inc.php
diff --git
a/include/validations/paiements.inc.php
b/include/validations/paiements.inc.php
index
6782166
..
bb3afe4
100644
(file)
--- a/
include/validations/paiements.inc.php
+++ b/
include/validations/paiements.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
7
Polytechnique.org *
+ * Copyright (C) 2003-200
9
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-38,15
+38,17
@@
class PayReq extends Validate
public $evt;
public $evt_intitule;
public $evt;
public $evt_intitule;
- public $rules = "Laisser la validation à un trésorier";
+ public $rules = "Vérifier que les balises <salutation>, <prenom>, <nom> et <montant> 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
// }}}
// {{{ constructor
- public function __construct(
$_uid
, $_intitule, $_site, $_montant, $_msg,
+ public function __construct(
User &$_user
, $_intitule, $_site, $_montant, $_msg,
$_montantmin=0, $_montantmax=999, $_asso_id = 0,
$_evt = 0, $_stamp=0)
{
$_montantmin=0, $_montantmax=999, $_asso_id = 0,
$_evt = 0, $_stamp=0)
{
- parent::__construct($_u
id
, false, 'paiements', $_stamp);
+ parent::__construct($_u
ser
, false, 'paiements', $_stamp);
$this->titre = $_intitule;
$this->site = $_site;
$this->titre = $_intitule;
$this->site = $_site;
@@
-86,11
+88,11
@@
class PayReq extends Validate
{
// no text [AI JMIAJM IJA MIJ]
if (preg_match('/\[[-\'"A-Z ]+\]/', $this->msg_reponse)) {
{
// no text [AI JMIAJM IJA MIJ]
if (preg_match('/\[[-\'"A-Z ]+\]/', $this->msg_reponse)) {
- $this->trig("La demande de paiement n'est pas valide. Merci de compléter le texte avant de la soumettre");
+ $this->trig
Error
("La demande de paiement n'est pas valide. Merci de compléter le texte avant de la soumettre");
return false;
}
if (!preg_match('/<montant>/', $this->msg_reponse)) {
return false;
}
if (!preg_match('/<montant>/', $this->msg_reponse)) {
- $this->trig("Le demande de paiement ne contient pas la balise obligatoire <montant>");
+ $this->trig
Error
("Le demande de paiement ne contient pas la balise obligatoire <montant>");
return false;
}
return true;
return false;
}
return true;
@@
-163,7
+165,6
@@
class PayReq extends Validate
public function commit()
{
public function commit()
{
- global $globals;
$res = XDB::query("SELECT MAX(id) FROM paiement.paiements");
$id = $res->fetchOneCell()+1;
$ret = XDB::execute("INSERT INTO paiement.paiements VALUES
$res = XDB::query("SELECT MAX(id) FROM paiement.paiements");
$id = $res->fetchOneCell()+1;
$ret = XDB::execute("INSERT INTO paiement.paiements VALUES
@@
-173,7
+174,7
@@
class PayReq extends Validate
",
$id, $this->titre, $this->site,
$this->montant, $this->montant_min, $this->montant_max,
",
$id, $this->titre, $this->site,
$this->montant, $this->montant_min, $this->montant_max,
- $this->
bestalias."@".$globals->mail->domain
, $this->msg_reponse, $this->asso_id);
+ $this->
user->bestEmail()
, $this->msg_reponse, $this->asso_id);
if ($this->asso_id && $this->evt) {
XDB::execute("UPDATE groupex.evenements
SET paiement_id = {?}
if ($this->asso_id && $this->evt) {
XDB::execute("UPDATE groupex.evenements
SET paiement_id = {?}
@@
-185,11
+186,6
@@
class PayReq extends Validate
WHERE e.eid = {?}",
$this->evt);
list($nom, $diminutif, $evt) = $res->fetchOneRow();
WHERE e.eid = {?}",
$this->evt);
list($nom, $diminutif, $evt) = $res->fetchOneRow();
- $mailer = new PlMailer('xnetevents/mail.new_payment.tpl');
- $mailer->assign('asso', $nom);
- $mailer->assign('diminutif', $diminutif);
- $mailer->assign('evt', $evt);
- $mailer->assign('payment', $id);
require_once dirname(__FILE__) . '/../../modules/xnetevents/xnetevents.inc.php';
$participants = get_event_participants(get_event_detail($this->evt, false, $this->asso_id), null, 'nom');
foreach ($participants as &$u) {
require_once dirname(__FILE__) . '/../../modules/xnetevents/xnetevents.inc.php';
$participants = get_event_participants(get_event_detail($this->evt, false, $this->asso_id), null, 'nom');
foreach ($participants as &$u) {
@@
-198,6
+194,11
@@
class PayReq extends Validate
}
$topay = $u['montant'] - $u['paid'];
if ($topay > 0) {
}
$topay = $u['montant'] - $u['paid'];
if ($topay > 0) {
+ $mailer = new PlMailer('xnetevents/newpayment.mail.tpl');
+ $mailer->assign('asso', $nom);
+ $mailer->assign('diminutif', $diminutif);
+ $mailer->assign('evt', $evt);
+ $mailer->assign('payment', $id);
$mailer->assign('prenom', $u['prenom']);
$mailer->assign('topay', $topay);
$mailer->assign('to', $u['email']);
$mailer->assign('prenom', $u['prenom']);
$mailer->assign('topay', $topay);
$mailer->assign('to', $u['email']);