Look: Mise au look de la fiche adherent

Norm: Utilisation de la fonction form_confirm plutot que le code en dur
Fix: Corrections diverses
Look: Les liens editer, résilier et supprimer utilisent les icones.
Fix: La nature de l'adhérent (moral ou physique) est affiché correctement.
Norm: La liste des modes de paiement pour la saisie d'une cotisation vient de la table des type de paiement plutot que codé en dur.
This commit is contained in:
Laurent Destailleur 2004-07-16 23:35:53 +00:00
parent 44076df5df
commit 4ceeca130f
4 changed files with 574 additions and 760 deletions

View File

@ -1,6 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -119,13 +120,12 @@ class Adherent
$texttosend = preg_replace ($patterns, $replace, $text); $texttosend = preg_replace ($patterns, $replace, $text);
$subjectosend = preg_replace ($patterns, $replace, $subject); $subjectosend = preg_replace ($patterns, $replace, $subject);
if (defined('ADHERENT_MAIL_FROM') && ADHERENT_MAIL_FROM != ''){ if (defined('ADHERENT_MAIL_FROM') && ADHERENT_MAIL_FROM != ''){
return mail($recipients,$subjectosend,$texttosend,"From: ".ADHERENT_MAIL_FROM."\nReply-To: ".ADHERENT_MAIL_FROM."\nX-Mailer: PHP/" . phpversion()); return mail($recipients,$subjectosend,$texttosend,"From: ".ADHERENT_MAIL_FROM."\nReply-To: ".ADHERENT_MAIL_FROM."\nX-Mailer: PHP/" . phpversion());
}else{ }else{
return mail($recipients,$subjectosend,$texttosend); return mail($recipients,$subjectosend,$texttosend);
} }
} }
/* /*
*
* *
* *
*/ */
@ -137,6 +137,19 @@ class Adherent
print "<li>" . $this->errorstr[$i]; print "<li>" . $this->errorstr[$i];
} }
} }
/*!
\brief fonction qui renvoi la nature physique ou morale d'un adherent
*/
Function getmorphylib($morphy='')
{
if (! $morphy) { $morphy=$this->morphy; }
if ($morphy == 'phy') { return "Physique"; }
if ($morphy == 'mor') { return "Morale"; }
return $morphy;
}
/* /*
* *
* *

View File

@ -1,6 +1,8 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -33,33 +35,33 @@ $adho = new AdherentOptions($db);
if ($action == 'update') if ($action == 'update')
{ {
if ($HTTP_POST_VARS["bouton"] == "Enregistrer") if ($_POST["bouton"] == "Enregistrer")
{ {
$adh = new Adherent($db); $adh = new Adherent($db);
$adh->id = $HTTP_POST_VARS["rowid"]; $adh->id = $_POST["rowid"];
$adh->prenom = $prenom; $adh->prenom = $prenom;
$adh->nom = $nom; $adh->nom = $nom;
$adh->societe = $societe; $adh->societe = $societe;
$adh->adresse = $adresse; $adh->adresse = $adresse;
$adh->amount = $amount; $adh->amount = $amount;
$adh->cp = $cp; $adh->cp = $cp;
$adh->ville = $HTTP_POST_VARS["ville"]; $adh->ville = $_POST["ville"];
$adh->email = $HTTP_POST_VARS["email"]; $adh->email = $_POST["email"];
$adh->login = $HTTP_POST_VARS["login"]; $adh->login = $_POST["login"];
$adh->pass = $HTTP_POST_VARS["pass"]; $adh->pass = $_POST["pass"];
$adh->naiss = $HTTP_POST_VARS["naiss"]; $adh->naiss = $_POST["naiss"];
$adh->photo = $HTTP_POST_VARS["photo"]; $adh->photo = $_POST["photo"];
$adh->date = mktime(12, 0 , 0, $remonth, $reday, $reyear); $adh->date = mktime(12, 0 , 0, $remonth, $reday, $reyear);
$adh->note = $HTTP_POST_VARS["note"]; $adh->note = $_POST["note"];
$adh->pays = $HTTP_POST_VARS["pays"]; $adh->pays = $_POST["pays"];
$adh->typeid = $HTTP_POST_VARS["type"]; $adh->typeid = $_POST["type"];
$adh->commentaire = $HTTP_POST_VARS["comment"]; $adh->commentaire = $_POST["comment"];
$adh->morphy = $HTTP_POST_VARS["morphy"]; $adh->morphy = $_POST["morphy"];
// recuperation du statut et public // recuperation du statut et public
$adh->statut = $HTTP_POST_VARS["statut"]; $adh->statut = $_POST["statut"];
$adh->public = $HTTP_POST_VARS["public"]; $adh->public = $_POST["public"];
foreach($_POST as $key => $value){ foreach($_POST as $key => $value){
if (ereg("^options_",$key)){ if (ereg("^options_",$key)){
@ -115,38 +117,6 @@ if ($rowid)
print_titre("Edition de la fiche adhérent"); print_titre("Edition de la fiche adhérent");
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
print "<tr><td>Type</td><td class=\"valeur\">$adh->type</td>";
print '<td valign="top" width="50%">Commentaires</td></tr>';
print '<tr><td>Personne</td><td class="valeur">'.$adh->morphy.'&nbsp;</td>';
print '<td rowspan="15" valign="top" width="50%">';
print nl2br($adh->commentaire).'&nbsp;</td></tr>';
print '<tr><td width="15%">Prénom</td><td class="valeur" width="35%">'.$adh->prenom.'&nbsp;</td></tr>';
print '<tr><td>Nom</td><td class="valeur">'.$adh->nom.'&nbsp;</td></tr>';
print '<tr><td>Société</td><td class="valeur">'.$adh->societe.'&nbsp;</td></tr>';
print '<tr><td>Adresse</td><td class="valeur">'.nl2br($adh->adresse).'&nbsp;</td></tr>';
print '<tr><td>CP Ville</td><td class="valeur">'.$adh->cp.' '.$adh->ville.'&nbsp;</td></tr>';
print '<tr><td>Pays</td><td class="valeur">'.$adh->pays.'&nbsp;</td></tr>';
print '<tr><td>Email</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>';
print '<tr><td>Login</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
// print '<tr><td>Password</td><td class="valeur">'.$adh->pass.'&nbsp;</td></tr>';
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>';
print '<tr><td>URL Photo</td><td class="valeur">'.$adh->photo.'&nbsp;</td></tr>';
// $adho->fetch_optionals();
foreach($adho->attribute_label as $key=>$value){
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]."&nbsp;</td></tr>\n";
}
print "</table>\n";
print "<hr>";
print "<form action=\"$PHP_SELF\" method=\"post\">"; print "<form action=\"$PHP_SELF\" method=\"post\">";
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">'; print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,8 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require("./adherent.class.php");
llxHeader(); llxHeader();
@ -104,24 +106,27 @@ if ($result)
$var=True; $var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object( $i); $objp = $db->fetch_object($i);
$adh=new Adherent($db);
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<tr $bc[$var]>";
if ($objp->societe != ''){ if ($objp->societe != ''){
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\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."</a></td>\n";
}else{ }else{
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></TD>\n"; print "<td><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></td>\n";
} }
print "<TD>"; print "<td>";
if ($objp->cotisation == 'yes') if ($objp->cotisation == 'yes')
{ {
if ($objp->datefin < time()) if ($objp->datefin < time())
{ {
print "<b><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)."</a> - Cotisation non recue</b></td>\n"; print dolibarr_print_date($objp->datefin)." - Cotisation non recue ".img_warning()."</td>\n";
} }
else else
{ {
print "<a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)."</a></td>\n"; print dolibarr_print_date($objp->datefin)."</td>\n";
} }
} }
else else
@ -131,7 +136,7 @@ if ($result)
print "<td>$objp->email</td>\n"; print "<td>$objp->email</td>\n";
print "<td>$objp->type</td>\n"; print "<td>$objp->type</td>\n";
print "<td>$objp->morphy</td>\n"; print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
print "<td>"; print "<td>";
if ($objp->statut == -1) if ($objp->statut == -1)
@ -148,7 +153,8 @@ if ($result)
} }
print "</td>"; print "</td>";
print "<td><a href=\"edit.php?rowid=$objp->rowid\">".img_edit()."</a> &nbsp; <a href=\"fiche.php?rowid=$objp->rowid&action=resign\">Resilier</a> &nbsp; <a href=\"fiche.php?rowid=$objp->rowid&action=delete\">".img_delete()."</a></td>\n"; print "<td><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".img_edit()."</a> &nbsp; ";
print "<a href=\"fiche.php?rowid=$objp->rowid&action=resign\">".img_disable("Résilier")."</a> &nbsp; <a href=\"fiche.php?rowid=$objp->rowid&action=delete\">".img_delete()."</a></td>\n";
print "</tr>"; print "</tr>";
$i++; $i++;
} }