From 37eef68ad78521f7da538b3468f0f396c7dc6281 Mon Sep 17 00:00:00 2001 From: jlb Date: Mon, 5 May 2003 11:14:48 +0000 Subject: [PATCH] rajout d'un envoi d'email pour confirmer la reception de la cotisation --- htdocs/adherents/TODO | 2 ++ htdocs/adherents/cotisations.php | 36 +++++++++++++++++++++++++------- htdocs/adherents/fiche.php | 4 ++++ htdocs/adherents/liste.php | 13 ++++++++++-- htdocs/lib/functions.inc.php3 | 19 ++++++++++++++++- mysql/data/data.sql | 2 ++ 6 files changed, 66 insertions(+), 10 deletions(-) diff --git a/htdocs/adherents/TODO b/htdocs/adherents/TODO index 09a14575627..5e272e2d7b8 100644 --- a/htdocs/adherents/TODO +++ b/htdocs/adherents/TODO @@ -5,3 +5,5 @@ - ne pas afficher le / apres Prenom Nom lorsque le champs suivant est vide (details mais ca aide a lire) - faire un compatge automatique du nombre d'adherents - eventuellement aussi sur la page Adherent cotisant, faire la disctinction membres zeune et autre +- dans la liste des cotisants, changer l'ordre de classement par defaut (avec possibilite de pourvoir le changer) + diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index ba280478578..944c0f0b9b5 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -90,7 +90,7 @@ if ($result) $num = $db->num_rows(); $i = 0; - print_barre_liste("Liste des cotisations", $page, $PHP_SELF, "&statut=$statut"); + print_barre_liste("Liste des cotisations", $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); print "\n"; print ''; @@ -98,8 +98,8 @@ if ($result) print ''; print ""; print "\n"; - // print ""; print "\n"; + foreach ($Total as $key=>$value){ $var=!$var; print "\n"; @@ -109,9 +109,23 @@ if ($result) print "
MontantNombreMoyennePrenom Nom / Société
$key".price($value)."".$Number[$key]."".price($value/$Number[$key])."
"; print ''; - print ""; - print ""; - print ""; + //print ""; + print '\n"; + + //print ""; + print '\n"; + + //print ""; + print '\n"; + print "\n"; $var=True; @@ -125,7 +139,11 @@ if ($result) print ''; //$Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation); $total+=price($objp->cotisation); - print "\n"; + if ($objp->societe != ''){ + print "\n"; + }else{ + print "\n"; + } print ""; $i++; } @@ -133,7 +151,11 @@ if ($result) print ""; print "\n"; print "\n"; - print "\n"; + // print "\n"; + print "\n"; + print "\n"; print "
DateMontantPrenom Nom / SociétéDate'; + print_liste_field_titre("Date",$PHP_SELF,"c.dateadh","&page=$page&statut=$statut"); + print "Montant'; + print_liste_field_titre("Montant",$PHP_SELF,"c.cotisation","&page=$page&statut=$statut"); + print "Prenom Nom / Société'; + // print_liste_field_titre("Prenom",$PHP_SELF,"d.prenom","&page=$page&statut=$statut"); + print_liste_field_titre("Prenom Nom",$PHP_SELF,"d.nom","&page=$page&statut=$statut"); + print " / Société"; + print "
'.price($objp->cotisation).'rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."
Total".price($total)."  "; + print_fleche_navigation($page,$PHP_SELF,"&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); + print "
"; print "
\n"; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index d58c6bc7544..68f48172ae5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -36,10 +36,14 @@ if ($HTTP_POST_VARS["action"] == 'cotisation') { $adh = new Adherent($db); $adh->id = $rowid; + $adh->fetch($rowid); if ($cotisation > 0) { $adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation); + if (defined("MAIN_MAIL_COTIS") && defined("MAIN_MAIL_COTIS_SUBJECT")){ + $adh->send_an_email($adh->email,MAIN_MAIL_COTIS,MAIN_MAIL_COTIS_SUBJECT); + } } $action = "edit"; } diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index a68e29486e7..0184a7698cb 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -73,7 +73,12 @@ if ($result) print ''; - print "Prenom Nom / Société\n"; + // print "Prenom Nom / Société\n"; + print ''; + // print_liste_field_titre("Prenom",$PHP_SELF,"d.prenom","&page=$page&statut=$statut"); + print_liste_field_titre("Prenom Nom",$PHP_SELF,"d.nom","&page=$page&statut=$statut"); + print " / Société"; + print "\n"; print ""; print_liste_field_titre("Date cotisation",$PHP_SELF,"t.cotisation","&page=$page&statut=$statut"); @@ -104,7 +109,11 @@ if ($result) $objp = $db->fetch_object( $i); $var=!$var; print ""; - print "rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."\n"; + if ($objp->societe != ''){ + print "rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."\n"; + }else{ + print "rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."\n"; + } print ""; if ($objp->cotisation == 'yes') { diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3 index 0b4ad38d357..4385139f3ea 100644 --- a/htdocs/lib/functions.inc.php3 +++ b/htdocs/lib/functions.inc.php3 @@ -297,14 +297,31 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $options .= "&sortorder=$sortorder"; } - + // affichage des fleches de navigation + print_fleche_navigation($page,$file,$options); + /* if ($page > 0) { print 'Page précédente'; } print 'Page suivante'; + */ print '

'; } + +/* + * fonction servant a afficher les fleches de navigation dans les + * pages de liste + */ +function print_fleche_navigation($page,$file,$options='') +{ + global $conf; + if ($page > 0) + { + print 'Page précédente'; + } + print 'Page suivante'; +} /* * * diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 9280458aa57..9832dd69aca 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -50,8 +50,10 @@ INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_RESIL','Votre INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_VALID','MAIN\r\nVotre adhesion vient d\'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante : \r\n%SERVEUR%public/adherents/','texte','Mail de validation'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_EDIT','Voici le rappel des coordonnees que vous avez modifiees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante :\r\n%SERVEUR%public/adherents/','texte','Mail d\'edition'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_NEW','Merci de votre inscription. Votre adhesion devrait etre rapidement validee.\r\nVoici le rappel des coordonnees que vous avez rentrees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante :\r\n%SERVEUR%public/adherents/','texte','Mail de nouvel inscription'); +INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_COTIS','Bonjour %PRENOM%,\r\nMerci de votre inscription.\r\nCet email confirme que votre cotisation a ete recue et enregistree.\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante :\r\n%SERVEUR%public/adherents/','texte','Mail de validation de cotisation'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_VALID_SUBJECT','Votre adhésion a ete validée sur %SERVEUR%','chaine','sujet du mail de validation'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_RESIL_SUBJECT','Resiliation de votre adhesion sur %SERVEUR%','chaine','sujet du mail de resiliation'); +INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_COTIS_SUBJECT','Recu de votre cotisation','chaine','sujet du mail de validation de cotisation'); INSERT INTO llx_const (name, value, type, note) VALUES ('SIZE_LISTE_LIMIT','50','chaine','Taille des listes'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_NEW_SUBJECT','Bienvenue sur %SERVEUR%','chaine','Sujet du mail de nouvelle adhesion'); INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MAIL_EDIT_SUBJECT','Votre fiche a ete editee sur %SERVEUR%','chaine','Sujet du mail d\'edition');