From 0655fa1a50d68b0d6a0dd718b1d1dedb3c3386a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Nov 2006 18:05:08 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Correction=20affichage=20pays=20sur=20fi?= =?UTF-8?q?ches=20adh=E9rents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/cartes/PDF_card.class.php | 7 +++-- htdocs/adherents/cartes/carte.php | 33 ++++++++++++++-------- htdocs/adherents/cartes/etiquette.php | 30 ++++++++++++-------- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/htdocs/adherents/cartes/PDF_card.class.php b/htdocs/adherents/cartes/PDF_card.class.php index 070e639a80d..c8e28c3ae66 100755 --- a/htdocs/adherents/cartes/PDF_card.class.php +++ b/htdocs/adherents/cartes/PDF_card.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -18,7 +19,6 @@ * * $Id$ * $Source$ - * */ /* Inspire de PDF_Label @@ -370,6 +370,8 @@ class PDF_card extends FPDF { */ function _Croix($x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=5) { + //$this->Color('#888888'); + $this->SetLineWidth($epaisseur); $lg=$taille/2; // croix haut gauche @@ -385,6 +387,7 @@ class PDF_card extends FPDF { $this->Line($x2,$y2-$lg,$x2,$y2+$lg); $this->Line($x2-$lg,$y2,$x2+$lg,$y2); + //$this->Color('#000000'); } } ?> diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 42b0548898a..978b693252a 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -18,10 +19,10 @@ * * $Id$ * $Source$ - * */ -/*! \file htdocs/adherents/cartes/carte.php +/** + \file htdocs/adherents/cartes/carte.php \ingroup adherent \brief Page de creation d'une carte PDF \version $Revision$ @@ -70,15 +71,19 @@ if (!isset($annee)){ } // requete en prenant que les adherents a jour de cotisation -$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin, adresse,cp,ville,pays, t.libelle as type, d.naiss, d.email, d.photo"; -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; -$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin > now()"; -$sql .= " ORDER BY d.rowid ASC "; +$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin,"; +$sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,"; +$sql.= " t.libelle as type,"; +$sql.= " p.libelle as pays"; +$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; +$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin >= now()"; +$sql.= " ORDER BY d.rowid ASC"; $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; while ($i < $num) { @@ -100,6 +105,7 @@ if ($result) $objp->rowid, $annee ); + // imprime le texte specifique sur la carte //$pdf->Add_PDF_card(sprintf("%s\n%s\n%s\n%s\n%s, %s\n%s", $objp->type." n° ".$objp->rowid,ucfirst(strtolower($objp->prenom))." ".strtoupper($objp->nom),"<".$objp->email.">", ucwords(strtolower($objp->adresse)), $objp->cp, strtoupper($objp->ville), ucfirst(strtolower($objp->pays))),$annee,"Association FreeLUG http://www.freelug.org/"); $pdf->Add_PDF_card(preg_replace ($patterns, $replace, ADHERENT_CARD_TEXT),preg_replace ($patterns, $replace, ADHERENT_CARD_HEADER_TEXT),preg_replace ($patterns, $replace, ADHERENT_CARD_FOOTER_TEXT)); @@ -108,9 +114,12 @@ if ($result) $db->close(); $pdf->Output(); -}else{ - llxHeader(); - print "Erreur de la base de données"; - llxFooter("Dernière modification $Date$ révision $Revision$"); } +else +{ + dolibarr_print_error($db); + + llxFooter('$Date$ - $Revision$'); +} + ?> diff --git a/htdocs/adherents/cartes/etiquette.php b/htdocs/adherents/cartes/etiquette.php index 7c19ca11a23..1ea3e2bb3ba 100755 --- a/htdocs/adherents/cartes/etiquette.php +++ b/htdocs/adherents/cartes/etiquette.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -18,10 +19,10 @@ * * $Id$ * $Source$ - * */ -/*! \file htdocs/adherents/cartes/etiquette.php +/** + \file htdocs/adherents/cartes/etiquette.php \ingroup adherent \brief Page de creation d'etiquettes \version $Revision$ @@ -58,10 +59,14 @@ if (!isset($annee)){ } // requete en prenant que les adherents a jour de cotisation -$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin, adresse,cp,ville,pays, t.libelle as type, d.naiss, d.email, d.photo"; -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; -$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin > now()"; -$sql .= " ORDER BY d.rowid ASC "; +$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin,"; +$sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,"; +$sql.= " t.libelle as type,"; +$sql.= " p.libelle as pays"; +$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; +$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin >= now()"; +$sql.= " ORDER BY d.rowid ASC"; $result = $db->query($sql); if ($result) @@ -78,9 +83,12 @@ if ($result) $db->close(); $pdf->Output(); -}else{ - llxHeader(); - print "Erreur de la base de données : ".$db->error(); - llxFooter("Dernière modification $Date$ révision $Revision$"); } +else +{ + dolibarr_print_error($db); + + llxFooter('$Date$ - $Revision$'); +} + ?>