From c2042fd16f7ed927c7a64207e55bd5ec41287869 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Sep 2004 11:02:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Corrections=20diverses=20de=20mauvais=20?= =?UTF-8?q?fonctionnement=20sur=20les=20adh=E9rents.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/adherent.class.php | 49 +++++----- htdocs/adherents/adherent_options.class.php | 30 +++--- htdocs/adherents/fiche.php | 47 +++++---- htdocs/adherents/options.php | 101 ++++++++++---------- htdocs/adherents/type.php | 8 +- 5 files changed, 123 insertions(+), 112 deletions(-) diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index 701e84b1f66..a167d7c7850 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -167,7 +167,7 @@ class Adherent /*! - \brief fonction qui renvoie la nature physique ou morale d'un adherent + \brief fonction qui renvoie la nature physique ou morale d'un adherent \param morphy nature physique ou morale de l'adhérent */ @@ -180,7 +180,7 @@ class Adherent } /*! - \brief fonction qui vérifie les données entrées + \brief fonction qui vérifie les données entrées \param minimum */ @@ -265,7 +265,6 @@ class Adherent /* * Return errors - * */ if ($err) @@ -281,7 +280,7 @@ class Adherent } /*! - \brief fonction qui crée l'adhérent + \brief fonction qui crée l'adhérent \param userid userid de l'adhérent */ @@ -305,16 +304,15 @@ class Adherent } else { - print $this->db->error(); - print "


$sql

"; + dolibarr_print_error($this->db); return 0; } } + /*! \brief fonction qui met à jour l'adhérent */ - function update() { @@ -343,8 +341,7 @@ class Adherent if (!$result) { - print $this->db->error(); - print "
$sql
"; + dolibarr_print_error($this->db); return 0; } @@ -352,14 +349,21 @@ class Adherent { $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options WHERE adhid = $this->id;"; $this->db->query($sql_del); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid) VALUES ($this->id);"; - //$sql = "REPLACE INTO ".MAIN_DB_PREFIX."adherent_options SET adhid = $this->id"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid"; foreach($this->array_options as $key => $value) { // recupere le nom de l'attribut $attr=substr($key,8); - $sql.=",$attr = '".$this->array_options[$key]."'"; + $sql.=",$attr"; } + $sql .= ") VALUES ($this->id"; + foreach($this->array_options as $key => $value) + { + + $sql.=",'".$this->array_options[$key]."'"; + } + $sql.=");"; + $result = $this->db->query($sql); } @@ -369,8 +373,7 @@ class Adherent } else { - print $this->db->error(); - print "


$sql

"; + dolibarr_print_error($this->db); return 0; } } @@ -411,7 +414,7 @@ class Adherent } else { - print "Err : ".$this->db->error(); + dolibarr_print_error($this->db); } return $result; @@ -436,7 +439,7 @@ class Adherent } else { - print $this->db->error(); + dolibarr_print_error($this->db); } } @@ -485,7 +488,7 @@ class Adherent } else { - print $this->db->error(); + dolibarr_print_error($this->db); } } @@ -516,7 +519,7 @@ class Adherent } } }else{ - print $this->db->error(); + dolibarr_print_error($this->db); } } @@ -544,7 +547,7 @@ class Adherent return array(); } }else{ - print $this->db->error(); + dolibarr_print_error($this->db); return array() ; } @@ -586,7 +589,7 @@ class Adherent } else { - print "Err : ".$this->db->error(); + dolibarr_print_error($this->db); return 0; } } @@ -613,8 +616,7 @@ class Adherent } else { - print $this->db->error(); - print "


$sql

"; + dolibarr_print_error($this->db); return 0; } } @@ -641,8 +643,7 @@ class Adherent } else { - print $this->db->error(); - print "


$sql

"; + dolibarr_print_error($this->db); return 0; } } diff --git a/htdocs/adherents/adherent_options.class.php b/htdocs/adherents/adherent_options.class.php index c65da06bdb7..3125a69bfad 100644 --- a/htdocs/adherents/adherent_options.class.php +++ b/htdocs/adherents/adherent_options.class.php @@ -161,8 +161,7 @@ class AdherentOptions } else { - print $this->db->error(); - print "


$sql

"; + dolibarr_print_error($this->db); return 0; } }else{ @@ -173,7 +172,7 @@ class AdherentOptions /*! \brief fonction qui crée un label \param attrname nom de l'atribut - \param label nom du label + \param label nom du label */ function create_label($attrname,$label='') { @@ -213,8 +212,7 @@ class AdherentOptions } else { - print "Err : ".$this->db->error(); - print "


$sql

"; + print dolibarr_print_error($this->db); return 0; } }else{ @@ -239,8 +237,7 @@ class AdherentOptions } else { - print "Err : ".$this->db->error(); - print "


$sql

"; + print dolibarr_print_error($this->db); return 0; } }else{ @@ -282,8 +279,7 @@ class AdherentOptions } else { - print "Err : ".$this->db->error(); - print "


$sql

"; + print dolibarr_print_error($this->db); return 0; } }else{ @@ -315,8 +311,7 @@ class AdherentOptions } else { - print "Err : ".$this->db->error(); - print "


$sql

"; + print dolibarr_print_error($this->db); return 0; } }else{ @@ -325,12 +320,20 @@ class AdherentOptions } + +/*! + \brief fonction qui modifie un label +*/ function fetch_optionals() { $this->fetch_name_optionals(); $this->fetch_name_optionals_label(); } + +/*! + \brief fonction qui modifie un label +*/ function fetch_name_optionals() { $array_name_options=array(); @@ -360,6 +363,9 @@ class AdherentOptions } +/*! + \brief fonction qui modifie un label +*/ function fetch_name_optionals_label() { $array_name_label=array(); @@ -380,7 +386,7 @@ class AdherentOptions return array(); } }else{ - print $this->db->error(); + print dolibarr_print_error($this->db); return array() ; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 4c431e7a8f4..019e00af5d5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -31,6 +31,7 @@ require("./pre.inc.php"); $langs->load("companies"); +$langs->load("bills"); require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); @@ -186,7 +187,8 @@ if ($_POST["action"] == 'add') $public=0; } if (!$error){ - // email a peu pres correct et le login n'existe pas + + // Email a peu pres correct et le login n'existe pas if ($adh->create($user->id) ) { if ($cotisation > 0) @@ -202,7 +204,7 @@ if ($_POST["action"] == 'add') $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE); if ($insertid == '') { - print "

Probleme d'insertion : ".$db->error(); + dolibarr_print_error($db); } else { @@ -215,13 +217,16 @@ if ($_POST["action"] == 'add') } else { - print "

Probleme d'insertion $sql : ".$db->error(); + dolibarr_print_error($db); } } } } Header("Location: liste.php?statut=-1"); } + else { + dolibarr_print_error($db); + } } } @@ -374,13 +379,13 @@ if ($action == 'create') { print ''; - print ''.$langs->trans("FirstName").''; + print ''.$langs->trans("Firstname").''; print ''.$langs->trans("LastName").''; - print 'Societe'; - print 'Adresse'; + print ''.$langs->trans("Company").''; + print ''.$langs->trans("Address").''; print ''; - print 'CP Ville '; - print 'Pays'; + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' '; + print ''.$langs->trans("Country").''; print ''.$langs->trans("EMail").''; print ''.$langs->trans("Login").''; print ''.$langs->trans("Password").''; @@ -393,10 +398,10 @@ if ($action == 'create') { print "Date de cotisation\n"; print_date_select(); print "\n"; - print "Mode de paiement\n"; + print 'Mode de paiment'; print ' euros'; if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0 && defined("ADHERENT_BANK_USE_AUTO") && ADHERENT_BANK_USE_AUTO !=0){ - print 'Libelle'; + print ''.$langs->trans("Label").''; } print ''; print "\n"; @@ -512,7 +517,7 @@ if ($rowid > 0) print "

\n"; - print ''; + print '
'; print ''; print ''; @@ -524,16 +529,16 @@ if ($rowid > 0) print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; // print ''; print ''; print ''; @@ -573,7 +578,7 @@ if ($user->admin) print "Résilier l'adhésion\n"; } - print "id&action=delete\">Supprimer\n"; + print "id&action=delete\">".$langs->trans("Delete")."\n"; /* * bouton : "Envoie des informations" diff --git a/htdocs/adherents/options.php b/htdocs/adherents/options.php index 4dec847ef22..309d712d972 100644 --- a/htdocs/adherents/options.php +++ b/htdocs/adherents/options.php @@ -74,54 +74,55 @@ if ($_GET["action"] == 'delete' && $user->admin) llxHeader(); -//if ($_GET["action"] != 'create') { - print_titre("Configuration des champs optionnels"); - print '
'; - - /* ************************************************************************** */ - /* */ - /* */ - /* */ - /* ************************************************************************** */ - - $array_options=$adho->fetch_name_optionals(); - $array_label=$adho->fetch_name_optionals_label(); - if (sizeof($array_options)>0) +print_titre("Configuration des champs optionnels"); +print '
'; + +/* ************************************************************************** */ +/* */ +/* */ +/* */ +/* ************************************************************************** */ + +$array_options=$adho->fetch_name_optionals(); +$array_label=$adho->fetch_name_optionals_label(); + +print "
Numero'.$adh->id.' '.$langs->trans("Comments").'
Personne'.$adh->getmorphylib().' 
Prénom'.$adh->prenom.' 
'.$langs->trans("Firstname").''.$adh->prenom.' 
Nom'.$adh->nom.' 
'.$langs->trans("LastName").''.$adh->nom.' 
Société'.$adh->societe.' 
Adresse'.nl2br($adh->adresse).' 
CP Ville'.$adh->cp.' '.$adh->ville.' 
Pays'.$adh->pays.' 
Email'.$adh->email.' 
Login'.$adh->login.' 
'.$langs->trans("Company").''.$adh->societe.' 
'.$langs->trans("Address").''.nl2br($adh->adresse).' 
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$adh->cp.' '.$adh->ville.' 
'.$langs->trans("Country").''.$adh->pays.' 
'.$langs->trans("EMail").''.$adh->email.' 
'.$langs->trans("Login").''.$adh->login.' 
Pass'.$adh->pass.' 
Date de Naissance'.$adh->naiss.' 
URL Photo'.$adh->photo.' 
"; + +print ''; +print ''; +print ""; +print ''; +print "\n"; + +if (sizeof($array_options)>0) +{ + $var=True; + foreach($adho->attribute_name as $key => $value) { - print "
'.$langs->trans("Label").'Nom de l'attribut'.$langs->trans("Type").' 
"; - - print ''; - print ''; - print ""; - print ''; - print "\n"; - - $var=True; - foreach($adho->attribute_name as $key => $value) - { - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print ""; - // $i++; - } - print "
'.$langs->trans("Label").'Nom de l'attribut'.$langs->trans("Type").' 
".$adho->attribute_label[$key]." $key$value".img_edit().""; - print "  ".img_delete()."
"; - - /* - * Barre d'actions - * - */ - print '
'; - print "Nouvel attribut"; - print "
"; + $var=!$var; + print ""; + print "".$adho->attribute_label[$key]." \n"; + print "$key\n"; + print "$value\n"; + print "".img_edit().""; + print "  ".img_delete()."\n"; + print ""; + // $i++; } -//} +} + +print ""; + +/* + * Barre d'actions + * + */ +print '
'; +print "Nouvel attribut"; +print "
"; + /* ************************************************************************** */ /* */ @@ -132,10 +133,9 @@ llxHeader(); if ($_GET["action"] == 'create') { print_titre("Nouvel attribut"); - print '
'; print ""; - print ''; + print '
'; print ''; @@ -165,8 +165,7 @@ if ($_GET["action"] == 'create') { if ($_GET["attrname"] && $_GET["action"] == 'edit') { - print_titre("Edition du champ $attrname"); - print '
'; + print_titre("Edition du champ ".$_GET["attrname"]); /* * formulaire d'edition @@ -174,7 +173,7 @@ if ($_GET["attrname"] && $_GET["action"] == 'edit') print ''; print ''; print ''; - print '
'; + print '
'; print ''; print ''; @@ -186,8 +185,8 @@ if ($_GET["attrname"] && $_GET["action"] == 'edit') 'date'=>'date', 'datetime'=>'date et heure'),$type); print ''; - // print ''; - print ''; + + print ''; print ''; print '
'.$langs->trans("Label").'
Nom de l\'attribut'.$_GET["attrname"].' 
Type (non pris en compte)
Taille
'.$langs->trans("Size").'
  '; print '
'; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 81ac371fa6a..d3594715ede 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -99,11 +99,11 @@ if ($result) $num = $db->num_rows(); $i = 0; - print ""; + print '
'; print ''; print ""; - print ''; + print ''; print "\n"; $var=True; @@ -114,8 +114,8 @@ if ($result) print ""; print "\n"; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ""; $i++;
Id'.$langs->trans("Label").'Cotisation ?Vote ? '.$langs->trans("Label").'Cotisation ?Vote ? 
".$objp->rowid."'.$objp->libelle.''.$objp->cotisation.''.$objp->vote.''.$langs->trans($objp->cotisation).''.$langs->trans($objp->vote).''.img_edit().'