From c786173baac3319350a0c217bba2d4251e72cb86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Jan 2009 12:20:58 +0000 Subject: [PATCH] Fix: Error when editing memeber card --- htdocs/adherents/fiche_subscription.php | 59 +++++++++++-------- .../modules/facture/pdf_crabe.modules.php | 26 ++++---- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + 4 files changed, 48 insertions(+), 39 deletions(-) diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index b0f9948ee7b..9cef42a005e 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -57,9 +57,9 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update if ($result > 0) { $db->begin(); - + $errmsg=''; - + if ($subscription->fk_bank) { $accountline=new AccountLine($db); @@ -82,7 +82,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update } } } - + if (! $errmsg) { // Modifie valeures @@ -170,13 +170,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') $subscription->fetch($rowid); $result=$adh->fetch($subscription->fk_adherent); - + /* * Affichage onglets */ $h = 0; $head = array(); - + $head[$h][0] = DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$subscription->id; $head[$h][1] = $langs->trans("SubscriptionCard"); $head[$h][2] = 'general'; @@ -195,10 +195,10 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print ""; print "fk_bank."\">"; print ''; - + // Ref print ''; - + // Member $adh->ref=$adh->fullname; print ''; @@ -224,16 +224,23 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') // Label print ''; - + if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) { print ''; } - + print '
'.$langs->trans("Ref").''.$subscription->ref.' 
'.$langs->trans("Label").''; print '
'.$langs->trans("BankTransactionLine").''; - $bankline=new AccountLine($db); - $result=$bankline->fetch($subscription->fk_bank); - print $bankline->getNomUrl(1,0,'showall'); + if ($subscription->fk_bank) + { + $bankline=new AccountLine($db); + $result=$bankline->fetch($subscription->fk_bank); + print $bankline->getNomUrl(1,0,'showall'); + } + else + { + print $langs->trans("NoneF"); + } print '
'; print ''; print '       '; @@ -243,8 +250,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print '
'; print ''; print "\n"; - - print ''; + + print ''; print "\n"; } @@ -258,13 +265,13 @@ if ($rowid && $action != 'edit') $result=$subscription->fetch($rowid); $result=$adh->fetch($subscription->fk_adherent); - + /* * Affichage onglets */ $h = 0; $head = array(); - + $head[$h][0] = DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$subscription->id; $head[$h][1] = $langs->trans("SubscriptionCard"); $head[$h][2] = 'general'; @@ -317,14 +324,14 @@ if ($rowid && $action != 'edit') // Amount print ''.$langs->trans("Amount").''.price($subscription->amount).''; - + // Amount print ''.$langs->trans("Label").''.$subscription->note.''; - + // Bank account if ($conf->banque->enabled) { - if ($subscription->fk_bank) + if ($subscription->fk_bank) { $bankline=new AccountLine($db); $result=$bankline->fetch($subscription->fk_bank); @@ -337,25 +344,25 @@ if ($rowid && $action != 'edit') print ''; $bankline=new AccountLine($db); $result=$bankline->fetch($subscription->fk_bank); - print $bankline->getNomUrl(1,0,'showall'); + print $bankline->getNomUrl(1,0,'showall'); print ''; print ''; } } - + print "\n"; print ''; - + print "\n"; - + /* * Barre d'actions * */ print '
'; - + if ($user->rights->adherent->cotisation->creer) { if (! $bankline->rappro) @@ -373,10 +380,10 @@ if ($rowid && $action != 'edit') { print "id."&action=delete\">".$langs->trans("Delete")."\n"; } - + print '
'; print "
\n"; - + } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index b83477b64c4..a64529b988d 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -70,12 +70,12 @@ class pdf_crabe extends ModelePDFFactures $this->option_logo = 1; // Affiche logo $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode règlement - $this->option_condreg = 1; // Affiche conditions règlement + $this->option_modereg = 1; // Affiche mode r�glement + $this->option_condreg = 1; // Affiche conditions r�glement $this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 1; // Affiche si il y a eu escompte - $this->option_credit_note = 1; // Gère les avoirs + $this->option_credit_note = 1; // G�re les avoirs $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts @@ -84,7 +84,7 @@ class pdf_crabe extends ModelePDFFactures // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini + if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini // Defini position des colonnes $this->posxdesc=$this->marge_gauche+1; @@ -101,8 +101,8 @@ class pdf_crabe extends ModelePDFFactures /** - * \brief Fonction générant la facture sur le disque - * \param fac Objet facture à générer (ou id si ancienne methode) + * \brief Fonction g�n�rant la facture sur le disque + * \param fac Objet facture � g�n�rer (ou id si ancienne methode) * \param outputlangs Lang object for output language * \return int 1=ok, 0=ko */ @@ -124,7 +124,7 @@ class pdf_crabe extends ModelePDFFactures if ($conf->facture->dir_output) { - // Définition de l'objet $fac (pour compatibilite ascendante) + // D�finition de l'objet $fac (pour compatibilite ascendante) if (! is_object($fac)) { $id = $fac; @@ -135,7 +135,7 @@ class pdf_crabe extends ModelePDFFactures $deja_regle = $fac->getSommePaiement(); $amount_credit_not_included = $fac->getSommeCreditNote(); - // Définition de $dir et $file + // D�finition de $dir et $file if ($fac->specimen) { $dir = $conf->facture->dir_output; @@ -167,7 +167,7 @@ class pdf_crabe extends ModelePDFFactures $pdf=new FPDI_Protection('P','mm',$this->format); $pdfrights = array('print'); // Ne permet que l'impression du document $pdfuserpass = ''; // Mot de passe pour l'utilisateur final - $pdfownerpass = NULL; // Mot de passe du propriétire, crée aléatoirement si pas défini + $pdfownerpass = NULL; // Mot de passe du propri�tire, cr�e al�atoirement si pas d�fini $pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass); } else @@ -259,7 +259,7 @@ class pdf_crabe extends ModelePDFFactures } else { - //$fac->lignes[$i]->desc='€zaaaa'; + //$fac->lignes[$i]->desc='�zaaaa'; //print dol_string_is_good_iso($fac->lignes[$i]->desc); //print dol_htmlentitiesbr($fac->lignes[$i]->desc); //print exit; @@ -342,9 +342,9 @@ class pdf_crabe extends ModelePDFFactures // Cherche nombre de lignes a venir pour savoir si place suffisante if ($i < ($nblignes - 1)) // If it's not last line { - //on récupère la description du produit suivant + //on r�cup�re la description du produit suivant $follow_descproduitservice = $fac->lignes[$i+1]->desc; - //on compte le nombre de ligne afin de vérifier la place disponible (largeur de ligne 52 caracteres) + //on compte le nombre de ligne afin de v�rifier la place disponible (largeur de ligne 52 caracteres) $nblineFollowDesc = dol_nboflines_bis($follow_descproduitservice,52)*4; // Et si on affiche dates de validite, on ajoute encore une ligne if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) @@ -853,7 +853,7 @@ class pdf_crabe extends ModelePDFFactures { global $conf; - // Montants exprimés en (en tab_top - 1) + // Montants exprim�s en (en tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','',8); $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie)); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 33144a369dc..174a11406f9 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -335,6 +335,7 @@ NextStep=Next step PreviousStep=Previous step Datas=Datas None=None +NoneF=None Late=Late Photo=Picture Photos=Pictures diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 83f8f554b90..de7d31b0f3f 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -336,6 +336,7 @@ NextStep= PreviousStep=Étape précédente Datas=Données None=Aucun +NoneF=Aucune Late=Retard Photo=Photo Photos=Photos