*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-12-22 15:11:07 +00:00
parent 052c51f86f
commit f6cf259853
7 changed files with 142 additions and 85 deletions

View File

@ -33,13 +33,17 @@ if ($action == 'add')
$don = new Don($db); $don = new Don($db);
$don->prenom = $prenom;
$don->nom = $nom; $don->nom = $nom;
$don->societe = $societe;
$don->adresse = $adresse; $don->adresse = $adresse;
$don->amount = $amount; $don->amount = $amount;
$don->cp = $cp; $don->cp = $cp;
$don->ville = $ville; $don->ville = $ville;
$don->email = $email;
$don->date = mktime(12, 0 , 0, $remonth, $reday, $reyear); $don->date = mktime(12, 0 , 0, $remonth, $reday, $reyear);
$don->note = $note; $don->note = $note;
$don->pays = $pays;
$don->public = $public; $don->public = $public;
$don->projetid = $projetid; $don->projetid = $projetid;
$don->modepaiementid = $modepaiement; $don->modepaiementid = $modepaiement;
@ -121,13 +125,8 @@ if ($action == 'create') {
print_date_select(); print_date_select();
print "</td>"; print "</td>";
print '<td rowspan="9" valign="top">Commentaires :<br>'; print '<td rowspan="11" valign="top">Commentaires :<br>';
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\"></textarea></td></tr>"; print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\"></textarea></td></tr>";
$author = $GLOBALS["REMOTE_USER"];
print "<input type=\"hidden\" name=\"author\" value=\"$author\">\n";
print "<tr><td>Type :</td><td>\n"; print "<tr><td>Type :</td><td>\n";
$paiement = new Paiement($db); $paiement = new Paiement($db);
@ -140,7 +139,6 @@ if ($action == 'create') {
$sql = "SELECT rowid, libelle FROM llx_don_projet ORDER BY rowid"; $sql = "SELECT rowid, libelle FROM llx_don_projet ORDER BY rowid";
if ($db->query($sql)) if ($db->query($sql))
{ {
$num = $db->num_rows(); $num = $db->num_rows();
@ -167,14 +165,15 @@ if ($action == 'create') {
print "</select><br>"; print "</select><br>";
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr><td>Prénom</td><td><input type="text" name="prenom" size="40"></td></tr>';
print '<tr><td>Nom</td><td><input type="text" name="nom" size="40"></td></tr>'; print '<tr><td>Nom</td><td><input type="text" name="nom" size="40"></td></tr>';
print '<tr><td>Adresse</td><td><input type="text" name="adresse" size="40"></td></tr>'; print '<tr><td>Societe</td><td><input type="text" name="societe" size="40"></td></tr>';
print '<tr><td>Adresse</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="3"></textarea></td></tr>';
print '<tr><td>CP Ville</td><td><input type="text" name="cp" size="8"> <input type="text" name="ville" size="40"></td></tr>'; print '<tr><td>CP Ville</td><td><input type="text" name="cp" size="8"> <input type="text" name="ville" size="40"></td></tr>';
print '<tr><td>Pays</td><td><input type="text" name="pays" size="40"></td></tr>';
print '<tr><td>Email</td><td><input type="text" name="email" size="40"></td></tr>';
print '<tr><td>Montant</td><td><input type="text" name="amount" size="10"> euros</td></tr>'; print '<tr><td>Montant</td><td><input type="text" name="amount" size="10"> euros</td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>'; print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
print "</form>\n"; print "</form>\n";
print "</table>\n"; print "</table>\n";
@ -201,12 +200,9 @@ if ($rowid > 0 && $action == 'edit')
print strftime("%d %B %Y",$don->date); print strftime("%d %B %Y",$don->date);
print "</td>"; print "</td>";
print '<td rowspan="9" valign="top" width="50%">Commentaires :<br>'; print '<td rowspan="11" valign="top" width="50%">Commentaires :<br>';
print nl2br($don->commentaire).'</td></tr>'; print nl2br($don->commentaire).'</td></tr>';
$author = $GLOBALS["REMOTE_USER"];
print "<input type=\"hidden\" name=\"author\" value=\"$author\">\n";
if ($don->statut == 1) if ($don->statut == 1)
{ {
print "<tr><td>Type :</td><td>"; print "<tr><td>Type :</td><td>";
@ -230,11 +226,13 @@ if ($rowid > 0 && $action == 'edit')
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr><td>Prénom</td><td>'.$don->prenom.'&nbsp;</td></tr>';
print '<tr><td>Nom</td><td>'.$don->nom.'&nbsp;</td></tr>'; print '<tr><td>Nom</td><td>'.$don->nom.'&nbsp;</td></tr>';
print '<tr><td>Adresse</td><td>'.$don->adresse.'&nbsp;</td></tr>'; print '<tr><td>Société</td><td>'.$don->societe.'&nbsp;</td></tr>';
print '<tr><td>Adresse</td><td>'.nl2br($don->adresse).'&nbsp;</td></tr>';
print '<tr><td>CP Ville</td><td>'.$don->cp.' '.$don->ville.'&nbsp;</td></tr>'; print '<tr><td>CP Ville</td><td>'.$don->cp.' '.$don->ville.'&nbsp;</td></tr>';
print '<tr><td>Pays</td><td>'.$don->pays.'&nbsp;</td></tr>';
print '<tr><td>Email</td><td>'.$don->email.'&nbsp;</td></tr>';
print '<tr><td>Montant</td><td>'.price($don->amount).' euros</td></tr>'; print '<tr><td>Montant</td><td>'.price($don->amount).' euros</td></tr>';
print "</table>\n"; print "</table>\n";

View File

@ -55,7 +55,7 @@ $pageprev = $page - 1;
$pagenext = $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 .= " FROM llx_don as d, llx_don_projet as p";
$sql .= " WHERE p.rowid = d.fk_don_projet AND d.fk_statut = $statut"; $sql .= " WHERE p.rowid = d.fk_don_projet AND d.fk_statut = $statut";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
@ -70,7 +70,7 @@ if ($result)
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">'; print '<TR class="liste_titre">';
print "<td>Nom</td>"; print "<td>Prenom Nom / Société</td>";
print "<td>Date</td>"; print "<td>Date</td>";
print "<td>Projet</td>"; print "<td>Projet</td>";
print "<td align=\"right\">Montant</TD>"; print "<td align=\"right\">Montant</TD>";
@ -83,7 +83,7 @@ if ($result)
$objp = $db->fetch_object( $i); $objp = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->nom)."</a></TD>\n"; print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."</a></TD>\n";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n"; print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n";
print "<TD>$objp->projet</TD>\n"; print "<TD>$objp->projet</TD>\n";
print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>'; print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>';

View File

@ -24,13 +24,16 @@ class Don
{ {
var $id; var $id;
var $db; var $db;
var $date;
var $amount; var $amount;
var $prenom;
var $nom; var $nom;
var $societe;
var $adresse; var $adresse;
var $cp; var $cp;
var $ville; var $ville;
var $date;
var $pays; var $pays;
var $email;
var $public; var $public;
var $projetid; var $projetid;
var $modepaiement; var $modepaiement;
@ -71,11 +74,15 @@ class Don
Function check() Function check()
{ {
$err = 0; $err = 0;
if (strlen(trim($this->nom)) == 0)
if (strlen(trim($this->societe)) == 0)
{ {
$error_string[$err] = "Le nom saisi est invalide"; 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++; $err++;
} }
}
if (strlen(trim($this->adresse)) == 0) if (strlen(trim($this->adresse)) == 0)
{ {
@ -95,12 +102,30 @@ class Don
$err++; $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++; $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) if ($err)
{ {
@ -126,8 +151,8 @@ class Don
$this->date = $this->db->idate($this->date); $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 = "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->nom','$this->adresse', '$this->cp','$this->ville','$this->pays',$this->public, $this->projetid, '$this->commentaire', $userid, '$this->date')"; $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); $result = $this->db->query($sql);
@ -177,7 +202,7 @@ class Don
*/ */
Function fetch($rowid) 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 .= " 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"; $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); $obj = $this->db->fetch_object(0);
$this->date = $obj->datedon; $this->date = $obj->datedon;
$this->prenom = stripslashes($obj->prenom);
$this->nom = stripslashes($obj->nom); $this->nom = stripslashes($obj->nom);
$this->societe = stripslashes($obj->societe);
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->adresse = stripslashes($obj->adresse); $this->adresse = stripslashes($obj->adresse);
$this->cp = stripslashes($obj->cp); $this->cp = stripslashes($obj->cp);
$this->ville = stripslashes($obj->ville); $this->ville = stripslashes($obj->ville);
$this->email = stripslashes($obj->email);
$this->pays = stripslashes($obj->pays);
$this->projet = $obj->projet; $this->projet = $obj->projet;
$this->public = $obj->public; $this->public = $obj->public;
$this->modepaiementid = $obj->fk_paiement; $this->modepaiementid = $obj->fk_paiement;

View File

@ -29,19 +29,20 @@
</tr> </tr>
<tr id="public"> <tr id="prenom">
<select name="public"> <input type="text" name="prenom" size="30" />
<option value="1">oui</option>
<option value="0">non</option>
</select>
</tr> </tr>
<tr id="nom"> <tr id="nom">
<input type="text" name="nom" size="40" /> <input type="text" name="nom" size="40" />
</tr> </tr>
<tr id="societe">
<input type="text" name="societe" size="40" />
</tr>
<tr id="adresse"> <tr id="adresse">
<input type="text" name="adresse" size="40" /> <textarea name="adresse" wrap="soft" cols="40" rows="3"></textarea>
</tr> </tr>
<tr id="cp"> <tr id="cp">
@ -49,24 +50,35 @@
</tr> </tr>
<tr id="ville"> <tr id="ville">
<input type="text" name="ville" size="40" /> <input type="text" name="ville" size="30" />
</tr>
<tr id="pays">
<input type="text" name="pays" size="25" value="France"/>
</tr> </tr>
<tr id="email"> <tr id="email">
<input type="text" name="email" size="40" /> <input type="text" name="email" size="50" />
</tr> </tr>
<tr id="montant"> <tr id="montant">
<input type="text" name="montant" size="10" /> <input type="text" name="montant" size="10" />
</tr> </tr>
<tr id="public">
<select name="public">
<option value="1">oui/yes</option>
<option value="0">non/no</option>
</select>
</tr>
<tr id="commentaire"> <tr id="commentaire">
<textarea name="commentaire" wrap="soft" cols="40" rows="6"></textarea> <textarea name="commentaire" wrap="soft" cols="40" rows="6"></textarea>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center" class="titre"> <td colspan="3" align="center" class="titre">
<input type="submit" value="Enregistrer" /> <input type="submit" value="Enregistrer / Submit" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -43,8 +43,10 @@
</tr> </tr>
<tr id="public"> <tr id="prenom">
<script language="php">
print $don->prenom;
</script>
</tr> </tr>
<tr id="nom"> <tr id="nom">
@ -53,9 +55,15 @@
</script> </script>
</tr> </tr>
<tr id="societe">
<script language="php">
print $don->societe;
</script>
</tr>
<tr id="adresse"> <tr id="adresse">
<script language="php"> <script language="php">
print "$don->adresse"; print nl2br(stripslashes($don->adresse));
</script> </script>
</tr> </tr>
@ -71,6 +79,12 @@
</script> </script>
</tr> </tr>
<tr id="pays">
<script language="php">
print $don->pays;
</script>
</tr>
<tr id="email"> <tr id="email">
<script language="php"> <script language="php">
print $don->email; print $don->email;
@ -79,7 +93,21 @@
<tr id="montant"> <tr id="montant">
<script language="php"> <script language="php">
print number_format($don->amount, 2, '.', ' '); print $don->amount;
</script>
</tr>
<tr id="public">
<script language="php">
$yn[0]="non/no";
$yn[1]="oui/yes";
print $yn[$don->public];
</script>
</tr>
<tr id="commentaire">
<script language="php">
print nl2br(stripslashes($don->commentaire));
</script> </script>
</tr> </tr>

View File

@ -5,13 +5,15 @@
<!-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> --> <!-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> -->
<!-- $Id$ --> <!-- $Id$ -->
<xsl:template match="/html[@lang='fr']/body/div[@class='main']/form/table[@id='formulaire']"> <xsl:template match="table[@id='formulaire']">
<table cellpadding="4" cellspacing="0"> <table cellpadding="4" cellspacing="0">
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
</table> </table>
<p> <p>
La FSF France s'engage à n'utliser vos informations personnelles 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.
</p> </p>
@ -166,7 +168,7 @@
</tr> </tr>
</xsl:template> </xsl:template>
<xsl:template match="/html[@lang='fr']/body/div[@class='main']/form/table/tr[@id='montant']"> <xsl:template match="table/tr[@id='montant']">
<tr> <tr>
<td class="titre"> <td class="titre">
Montant Montant
@ -188,8 +190,7 @@
<td class="valeur"> <td class="valeur">
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
<div class="commentaire"> <div class="commentaire">
Acceptez-vous vos noms Acceptez-vous vos noms et prénoms ou le nom de votre société soient affichés dans la liste des <a href="donateurs.php">donateurs</a> ?<br />
et prénoms soient affichés dans la liste des <a href="donateurs.php">donateurs</a> ?<br />
Do you allow us to list your name, firstaname or company name on the donations list ? Do you allow us to list your name, firstaname or company name on the donations list ?
</div> </div>
</td> </td>

View File

@ -27,9 +27,6 @@ require("../../conf/conf.class.php3");
$conf = new Conf(); $conf = new Conf();
if ($conf->don->enabled) if ($conf->don->enabled)
{
if ($HTTP_POST_VARS["action"] == 'add')
{ {
$db = new Db(); $db = new Db();
@ -37,16 +34,22 @@ if ($conf->don->enabled)
$don->projetid = $HTTP_POST_VARS["projetid"]; $don->projetid = $HTTP_POST_VARS["projetid"];
$don->date = time(); $don->date = time();
$don->prenom = $HTTP_POST_VARS["prenom"];
$don->nom = $HTTP_POST_VARS["nom"]; $don->nom = $HTTP_POST_VARS["nom"];
$don->societe = $HTTP_POST_VARS["societe"];
$don->adresse = $HTTP_POST_VARS["adresse"]; $don->adresse = $HTTP_POST_VARS["adresse"];
$don->cp = $HTTP_POST_VARS["cp"]; $don->cp = $HTTP_POST_VARS["cp"];
$don->ville = $HTTP_POST_VARS["ville"]; $don->ville = $HTTP_POST_VARS["ville"];
$don->pays = $HTTP_POST_VARS["pays"];
$don->public = $HTTP_POST_VARS["public"]; $don->public = $HTTP_POST_VARS["public"];
$don->email = $HTTP_POST_VARS["email"]; $don->email = $HTTP_POST_VARS["email"];
$don->amount = $HTTP_POST_VARS["montant"]; $don->amount = $HTTP_POST_VARS["montant"];
$don->commentaire = $HTTP_POST_VARS["commentaire"]; $don->commentaire = $HTTP_POST_VARS["commentaire"];
if ($HTTP_POST_VARS["action"] == 'add')
{
if ($don->check()) if ($don->check())
{ {
require("valid.php"); require("valid.php");
@ -59,20 +62,6 @@ if ($conf->don->enabled)
elseif ($HTTP_POST_VARS["action"] == 'valid') 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()) if ($don->check())
{ {
$return = $don->create(0); $return = $don->create(0);