diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index b010359a512..49f4f458349 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -33,13 +33,17 @@ if ($action == 'add') $don = new Don($db); + $don->prenom = $prenom; $don->nom = $nom; + $don->societe = $societe; $don->adresse = $adresse; $don->amount = $amount; $don->cp = $cp; $don->ville = $ville; + $don->email = $email; $don->date = mktime(12, 0 , 0, $remonth, $reday, $reyear); $don->note = $note; + $don->pays = $pays; $don->public = $public; $don->projetid = $projetid; $don->modepaiementid = $modepaiement; @@ -121,13 +125,8 @@ if ($action == 'create') { print_date_select(); print ""; - print 'Commentaires :
'; + print 'Commentaires :
'; print ""; - - $author = $GLOBALS["REMOTE_USER"]; - print "\n"; - - print "Type :\n"; $paiement = new Paiement($db); @@ -140,7 +139,6 @@ if ($action == 'create') { $sql = "SELECT rowid, libelle FROM llx_don_projet ORDER BY rowid"; - if ($db->query($sql)) { $num = $db->num_rows(); @@ -167,14 +165,15 @@ if ($action == 'create') { print "
"; print "\n"; - - + print 'Prénom'; print 'Nom'; - print 'Adresse'; + print 'Societe'; + print 'Adresse'; + print ''; print 'CP Ville '; - + print 'Pays'; + print 'Email'; print 'Montant euros'; - print ''; print "\n"; print "\n"; @@ -201,12 +200,9 @@ if ($rowid > 0 && $action == 'edit') print strftime("%d %B %Y",$don->date); print ""; - print 'Commentaires :
'; + print 'Commentaires :
'; print nl2br($don->commentaire).''; - $author = $GLOBALS["REMOTE_USER"]; - print "\n"; - if ($don->statut == 1) { print "Type :"; @@ -230,11 +226,13 @@ if ($rowid > 0 && $action == 'edit') print "\n"; - + print 'Prénom'.$don->prenom.' '; print 'Nom'.$don->nom.' '; - print 'Adresse'.$don->adresse.' '; + print 'Société'.$don->societe.' '; + print 'Adresse'.nl2br($don->adresse).' '; print 'CP Ville'.$don->cp.' '.$don->ville.' '; - + print 'Pays'.$don->pays.' '; + print 'Email'.$don->email.' '; print 'Montant'.price($don->amount).' euros'; print "\n"; diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 0f44450f26a..445b23af8b6 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -55,7 +55,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.nom, d.amount, p.libelle as projet"; +$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet"; $sql .= " FROM llx_don as d, llx_don_projet as p"; $sql .= " WHERE p.rowid = d.fk_don_projet AND d.fk_statut = $statut"; $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); @@ -70,7 +70,7 @@ if ($result) print ""; print ''; - print ""; + print ""; print ""; print ""; print ""; @@ -83,7 +83,7 @@ if ($result) $objp = $db->fetch_object( $i); $var=!$var; print ""; - print "\n"; + print "\n"; print "\n"; print "\n"; print ''; diff --git a/htdocs/don.class.php b/htdocs/don.class.php index aa08a6632a1..71c52e31784 100644 --- a/htdocs/don.class.php +++ b/htdocs/don.class.php @@ -24,13 +24,16 @@ class Don { var $id; var $db; + var $date; var $amount; + var $prenom; var $nom; + var $societe; var $adresse; var $cp; var $ville; - var $date; var $pays; + var $email; var $public; var $projetid; var $modepaiement; @@ -71,10 +74,14 @@ class Don Function check() { $err = 0; - if (strlen(trim($this->nom)) == 0) + + if (strlen(trim($this->societe)) == 0) { - $error_string[$err] = "Le nom saisi est invalide"; - $err++; + if ((strlen(trim($this->nom)) + strlen(trim($this->prenom))) == 0) + { + $error_string[$err] = "Vous devez saisir vos nom et prénom ou le nom de votre société."; + $err++; + } } if (strlen(trim($this->adresse)) == 0) @@ -95,12 +102,30 @@ class Don $err++; } - if ($this->amount == 0) + if (strlen(trim($this->email)) == 0) { - $error_string[$err] = "Le montant du don est invalide"; + $error_string[$err] = "L'email saisi est invalide"; $err++; } + $this->amount = trim($this->amount); + + $map = range(0,9); + for ($i = 0; $i < strlen($this->amount) ; $i++) + { + if (!isset($map[substr($this->amount, $i, 1)] )) + { + $error_string[$err] = "Le montant du don contient un/des caractère(s) invalide(s)"; + $err++; + break; + } + } + + if ($this->amount == 0) + { + $error_string[$err] = "Le montant du don est null"; + $err++; + } if ($err) { @@ -126,8 +151,8 @@ class Don $this->date = $this->db->idate($this->date); - $sql = "INSERT INTO llx_don (datec, amount, fk_paiement, nom, adresse, cp, ville, pays, public, fk_don_projet, note, fk_user_author, datedon)"; - $sql .= " VALUES (now(), $this->amount, $this->modepaiementid,'$this->nom','$this->adresse', '$this->cp','$this->ville','$this->pays',$this->public, $this->projetid, '$this->commentaire', $userid, '$this->date')"; + $sql = "INSERT INTO llx_don (datec, amount, fk_paiement,prenom, nom, societe,adresse, cp, ville, pays, public, fk_don_projet, note, fk_user_author, datedon, email)"; + $sql .= " VALUES (now(), $this->amount, $this->modepaiementid,'$this->prenom','$this->nom','$this->societe','$this->adresse', '$this->cp','$this->ville','$this->pays',$this->public, $this->projetid, '$this->commentaire', $userid, '$this->date','$this->email')"; $result = $this->db->query($sql); @@ -177,7 +202,7 @@ class Don */ Function fetch($rowid) { - $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.nom, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.public, d.amount, d.fk_paiement, d.note, cp.libelle"; + $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email"; $sql .= " FROM llx_don as d, llx_don_projet as p, c_paiement as cp"; $sql .= " WHERE p.rowid = d.fk_don_projet AND cp.id = d.fk_paiement AND d.rowid = $rowid"; @@ -189,11 +214,15 @@ class Don $obj = $this->db->fetch_object(0); $this->date = $obj->datedon; + $this->prenom = stripslashes($obj->prenom); $this->nom = stripslashes($obj->nom); + $this->societe = stripslashes($obj->societe); $this->statut = $obj->fk_statut; $this->adresse = stripslashes($obj->adresse); $this->cp = stripslashes($obj->cp); $this->ville = stripslashes($obj->ville); + $this->email = stripslashes($obj->email); + $this->pays = stripslashes($obj->pays); $this->projet = $obj->projet; $this->public = $obj->public; $this->modepaiementid = $obj->fk_paiement; diff --git a/htdocs/public/dons/don.xhtml b/htdocs/public/dons/don.xhtml index af5d32acffc..4cb40a92f0d 100644 --- a/htdocs/public/dons/don.xhtml +++ b/htdocs/public/dons/don.xhtml @@ -28,20 +28,21 @@ - - - - + + + + + + + + - + @@ -49,24 +50,35 @@ - + + + + + - + + + + + - + -
NomPrenom Nom / SociétéDateProjetMontant
rowid&action=edit\">".stripslashes($objp->nom)."rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."$objp->projet'.price($objp->amount).' 
- + +
diff --git a/htdocs/public/dons/erreur.xhtml b/htdocs/public/dons/erreur.xhtml index 631d5d1de43..5f8a0b53988 100644 --- a/htdocs/public/dons/erreur.xhtml +++ b/htdocs/public/dons/erreur.xhtml @@ -41,21 +41,29 @@ - - - - + + + + + + + + @@ -71,6 +79,12 @@ + + + + - + + + + + + + + + diff --git a/htdocs/public/dons/eucd-nav.fr.xsl b/htdocs/public/dons/eucd-nav.fr.xsl index aa2e6b1c036..5785be41300 100644 --- a/htdocs/public/dons/eucd-nav.fr.xsl +++ b/htdocs/public/dons/eucd-nav.fr.xsl @@ -5,13 +5,15 @@ - +

La FSF France s'engage à n'utliser vos informations personnelles - qu'exclusivement pour le traitement de votre don. + qu'exclusivement pour le traitement de votre don. Vous ne + receverez aucun email de la la part de la FSF France autre que + pour la gestion de votre don.

@@ -166,7 +168,7 @@
- + Montant @@ -188,8 +190,7 @@
- Acceptez-vous vos noms - et prénoms soient affichés dans la liste des donateurs ?
+ Acceptez-vous vos noms et prénoms ou le nom de votre société soient affichés dans la liste des donateurs ?
Do you allow us to list your name, firstaname or company name on the donations list ?
diff --git a/htdocs/public/dons/index.php b/htdocs/public/dons/index.php index c778ac55585..522b6f3b084 100644 --- a/htdocs/public/dons/index.php +++ b/htdocs/public/dons/index.php @@ -29,23 +29,26 @@ $conf = new Conf(); if ($conf->don->enabled) { + $db = new Db(); + $don = new Don($db); + + $don->projetid = $HTTP_POST_VARS["projetid"]; + $don->date = time(); + $don->prenom = $HTTP_POST_VARS["prenom"]; + $don->nom = $HTTP_POST_VARS["nom"]; + $don->societe = $HTTP_POST_VARS["societe"]; + $don->adresse = $HTTP_POST_VARS["adresse"]; + $don->cp = $HTTP_POST_VARS["cp"]; + $don->ville = $HTTP_POST_VARS["ville"]; + $don->pays = $HTTP_POST_VARS["pays"]; + $don->public = $HTTP_POST_VARS["public"]; + $don->email = $HTTP_POST_VARS["email"]; + $don->amount = $HTTP_POST_VARS["montant"]; + $don->commentaire = $HTTP_POST_VARS["commentaire"]; + + if ($HTTP_POST_VARS["action"] == 'add') { - - $db = new Db(); - $don = new Don($db); - - $don->projetid = $HTTP_POST_VARS["projetid"]; - $don->date = time(); - $don->nom = $HTTP_POST_VARS["nom"]; - $don->adresse = $HTTP_POST_VARS["adresse"]; - $don->cp = $HTTP_POST_VARS["cp"]; - $don->ville = $HTTP_POST_VARS["ville"]; - $don->public = $HTTP_POST_VARS["public"]; - $don->email = $HTTP_POST_VARS["email"]; - $don->amount = $HTTP_POST_VARS["montant"]; - $don->commentaire = $HTTP_POST_VARS["commentaire"]; - if ($don->check()) { @@ -58,20 +61,6 @@ if ($conf->don->enabled) } elseif ($HTTP_POST_VARS["action"] == 'valid') { - - $db = new Db(); - $don = new Don($db); - - $don->projetid = $HTTP_POST_VARS["projetid"]; - $don->date = time(); - $don->nom = $HTTP_POST_VARS["nom"]; - $don->adresse = $HTTP_POST_VARS["adresse"]; - $don->cp = $HTTP_POST_VARS["cp"]; - $don->ville = $HTTP_POST_VARS["ville"]; - $don->public = $HTTP_POST_VARS["public"]; - $don->email = $HTTP_POST_VARS["email"]; - $don->amount = $HTTP_POST_VARS["montant"]; - $don->commentaire = $HTTP_POST_VARS["commentaire"]; if ($don->check()) {