diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index f6457002474..94a8170cd0a 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -47,6 +47,7 @@ class Adherent extends CommonObject var $id; var $ref; + var $civilite_id; var $prenom; var $nom; var $fullname; @@ -148,6 +149,7 @@ class Adherent extends CommonObject } $infos=''; + if ($this->civilite_id) $infos.= $langs->trans("UserTitle").": ".$this->getCivilityLabel()."\n"; $infos.= $langs->trans("Lastname").": $this->nom\n"; $infos.= $langs->trans("Firstname").": $this->prenom\n"; $infos.= $langs->trans("Company").": $this->societe\n"; @@ -165,7 +167,8 @@ class Adherent extends CommonObject // Substitutions $patterns = array ( - '/%PRENOM%/', + '/%CIVILITE%/', + '/%PRENOM%/', '/%NOM%/', '/%INFOS%/', '/%DOL_MAIN_URL_ROOT%/', @@ -181,6 +184,7 @@ class Adherent extends CommonObject '/%PASSWORD%/' ); $replace = array ( + $this->getCivilityLabel(), $this->prenom, $this->nom, $infos, @@ -388,7 +392,8 @@ class Adherent extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; - $sql.= " prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null"); + $sql.= " civilite = ".($this->civilite_id?"'".$this->civilite_id."'":"null"); + $sql.= ", prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null"); $sql.= ", nom=" .($this->nom?"'".addslashes($this->nom)."'":"null"); $sql.= ", login=" .($this->login?"'".addslashes($this->login)."'":"null"); $sql.= ", societe=" .($this->societe?"'".addslashes($this->societe)."'":"null"); @@ -504,6 +509,7 @@ class Adherent extends CommonObject if ($result >= 0) { + $luser->civilite_id=$this->civilite_id; $luser->prenom=$this->prenom; $luser->nom=$this->nom; $luser->login=$this->user_login; @@ -926,7 +932,7 @@ class Adherent extends CommonObject { global $conf, $langs; - $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.fk_soc, d.statut, d.public, d.adresse, d.cp, d.ville, d.note,"; + $sql = "SELECT d.rowid, d.civilite, d.prenom, d.nom, d.societe, d.fk_soc, d.statut, d.public, d.adresse, d.cp, d.ville, d.note,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy,"; $sql.= " d.datec as datec,"; @@ -957,6 +963,7 @@ class Adherent extends CommonObject $this->ref = $obj->rowid; $this->id = $obj->rowid; + $this->civilite_id = $obj->civilite; $this->prenom = $obj->prenom; $this->nom = $obj->nom; $this->fullname = trim($obj->nom.' '.$obj->prenom); @@ -1699,6 +1706,18 @@ class Adherent extends CommonObject return ''; } + /** + * \brief Retourne le libelle de civilite du contact + * \return string Nom traduit de la civilite + */ + function getCivilityLabel() + { + global $langs; + $langs->load("dict"); + + $code=$this->civilite_id; + return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : $code; + } /** * \brief Renvoie nom clicable (avec eventuellement le picto) @@ -1907,6 +1926,7 @@ class Adherent extends CommonObject // Initialise parametres $this->id=0; $this->specimen=1; + $this->civilite_id = 0; $this->nom = 'DOLIBARR'; $this->prenom = 'SPECIMEN'; $this->fullname=trim($this->nom.' '.$this->prenom); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index c4c64d73406..a92b5dde4dd 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -21,7 +21,7 @@ /** * \file htdocs/adherents/fiche.php * \ingroup member - * \brief Page d'ajout, edition, suppression d'une fiche adherent + * \brief Page of member * \version $Id$ */ @@ -35,6 +35,7 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formcompany.class.php"); $langs->load("companies"); $langs->load("bills"); @@ -218,14 +219,14 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe { $datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); } - //print $_POST["naissmonth"].", ".$_POST["naissday"].", ".$_POST["naissyear"]." ".$datenaiss." ".adodb_strftime('%Y-%m-%d %H:%M:%S',$datenaiss); // Create new object if ($result > 0) { $adh->oldcopy=dol_clone($adh); - // Modifie valeures + // Change values + $adh->civilite_id = trim($_POST["civilite_id"]); $adh->prenom = trim($_POST["prenom"]); $adh->nom = trim($_POST["nom"]); $adh->fullname = trim($adh->prenom.' '.$adh->nom); @@ -347,6 +348,7 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) } $typeid=$_POST["typeid"]; + $civilite_id=$_POST["civilite_id"]; $nom=$_POST["nom"]; $prenom=$_POST["prenom"]; $societe=$_POST["societe"]; @@ -370,6 +372,7 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) $userid=$_POST["userid"]; $socid=$_POST["socid"]; + $adh->civilite_id = $civilite_id; $adh->prenom = $prenom; $adh->nom = $nom; $adh->societe = $societe; @@ -650,6 +653,7 @@ if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_add_spip' && llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $html = new Form($db); +$htmlcompany = new FormCompany($db); // fetch optionals attributes and labels $adho->fetch_name_optionals_label(); @@ -715,8 +719,10 @@ if ($action == 'edit') // Societe print ''.$langs->trans("Company").''; - // Nom - print ''.$langs->trans("Lastname").''; + // Civilite + print ''.$langs->trans("UserTitle").''; + print $htmlcompany->select_civilite($adh->civilite_id); + print ''; // Photo print ''; @@ -731,8 +737,12 @@ if ($action == 'edit') print ''; print ''; + // Nom + print ''.$langs->trans("Lastname").''; + print ''; + // Prenom - print ''.$langs->trans("Firstname").''; + print ''.$langs->trans("Firstname").''; print ''; // Login @@ -867,6 +877,11 @@ if ($action == 'create') // Company print ''.$langs->trans("Company").''; + // Civility + print ''.$langs->trans("UserTitle").''; + print $htmlcompany->select_civilite($adh->civilite_id,'civilite_id').''; + print ''; + // Nom print ''.$langs->trans("Lastname").''; print ''; @@ -1112,7 +1127,11 @@ if ($rowid && $action != 'edit') // Company print ''.$langs->trans("Company").''.$adh->societe.''; - // Nom + // Civility + print ''.$langs->trans("UserTitle").''.$adh->getCivilityLabel().' '; + print ''; + + // Nom print ''.$langs->trans("Lastname").''.$adh->nom.' '; print ''; diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index faf5ec35394..6f1a9f31adf 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -422,7 +422,7 @@ class Categorie } /** - * \brief Retourne les produits de la categorie + * \brief Return list of contents of a category * \param field Field name for select in table. Full field name will be fk_field. * \param class PHP Class of object to store entity * \param table Table name for select in table. Full table name will be PREFIX_categorie_table. @@ -434,18 +434,17 @@ class Categorie // Clean parameters if (empty($table)) $table=$field; - - $sql = "SELECT fk_".$field." FROM ".MAIN_DB_PREFIX."categorie_".$table; - $sql .= " WHERE fk_categorie = ".$this->id; + $sql = "SELECT fk_".$field." FROM ".MAIN_DB_PREFIX."categorie_".$table; + $sql.= " WHERE fk_categorie = ".$this->id; dol_syslog("Categorie::get_type sql=".$sql); - $res = $this->db->query($sql); - if ($res) + $resql = $this->db->query($sql); + if ($resql) { - while ($rec = $this->db->fetch_array ($res)) + while ($rec = $this->db->fetch_array($resql)) { - $obj = new $class ($this->db, $rec['fk_'.$field]); - $obj->fetch ($obj->id); + $obj = new $class($this->db); + $obj->fetch($rec['fk_'.$field]); $objs[] = $obj; } return $objs; @@ -459,8 +458,6 @@ class Categorie } - - /** * Retourne les filles de la categorie */ diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index e5c302b8baf..ba7586cc88a 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -431,7 +431,7 @@ function formCategory($db,$object,$typeid) if ($typeid == 0) $title=$langs->trans("ProductIsInCategories"); if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories"); if ($typeid == 2) $title=$langs->trans("CompanyIsInCustomersCategories"); - if ($typeid == 3) $title=$langs->trans("MemberIsInCustomersCategories"); + if ($typeid == 3) $title=$langs->trans("MemberIsInCategories"); print "\n"; print ''; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 9dd42e9f466..e8eec0a0939 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -218,7 +218,7 @@ else if ($c->type == 0) { - $prods = $c->get_type ("product","Product"); + $prods = $c->get_type("product","Product"); if ($prods < 0) { dol_print_error(); @@ -227,7 +227,7 @@ if ($c->type == 0) { print "
"; print "
'.$title.':
\n"; - print "\n"; + print "\n"; if (sizeof ($prods) > 0) { @@ -243,7 +243,6 @@ if ($c->type == 0) else print img_object($langs->trans("ShowProduct"),"product"); print " ".$prod->ref."\n"; print '\n"; - print '\n"; print "\n"; } } @@ -257,7 +256,7 @@ if ($c->type == 0) if ($c->type == 1) { - $socs = $c->get_type ("societe","Fournisseur","fournisseur"); + $socs = $c->get_type("societe","Fournisseur","fournisseur"); if ($socs < 0) { dol_print_error(); @@ -277,9 +276,10 @@ if ($c->type == 1) $i++; $var=!$var; print "\t\n"; + print '\n"; + print $soc->getNomUrl(1); + print "\n"; print "\n"; } @@ -294,7 +294,7 @@ if ($c->type == 1) if($c->type == 2) { - $socs = $c->get_type ("societe","Societe"); + $socs = $c->get_type("societe","Societe"); if ($socs < 0) { dol_print_error(); @@ -309,14 +309,14 @@ if($c->type == 2) { $i = 0; $var=true; - foreach ($socs as $soc) + foreach ($socs as $key => $soc) { $i++; $var=!$var; print "\t\n"; print '\n"; + print $soc->getNomUrl(1); + print "\n"; print "\n"; } @@ -332,8 +332,9 @@ if($c->type == 2) // List of members if ($c->type == 3) { + require_once(DOL_DOCUMENT_ROOT."/adherents/Adherent.class.php"); - $prods = $c->get_type ("member","Member"); + $prods = $c->get_type("member","Adherent"); if ($prods < 0) { dol_print_error($db,$c->error); @@ -348,16 +349,16 @@ if ($c->type == 3) { $i = 0; $var=true; - foreach ($prods as $prod) + foreach ($prods as $key => $member) { $i++; $var=!$var; print "\t\n"; print '\n"; - print '\n"; - print '\n"; + print $member->getNomUrl(1); + print "\n"; + print '\n"; + print '\n"; print "\n"; } } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 5524304bd93..1d319407de3 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -725,7 +725,7 @@ if ($step == 4 && $datatoexport) print ''."\n"; $liste=$objmodelexport->liste_modeles($db); - foreach($liste as $key) + foreach($liste as $key => $val) { $var=!$var; print ''; diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 659fb66b55f..2ba8a714047 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2010 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 @@ -19,7 +19,7 @@ /** * \file htdocs/exports/index.php * \ingroup export - * \brief Page accueil de la zone export + * \brief Home page of export tools * \version $Id$ */ @@ -57,7 +57,7 @@ print '
".$langs->trans("ProductsAndServices")."
".$langs->trans("ProductsAndServices")."
'.$prod->libelle."'.$prod->description."
'; - print img_object($langs->trans("ShowSuppliers"),"company"); - print " ".$soc->nom."
'; - print img_object($langs->trans("ShowCompany"),"company"); - print " ".$soc->nom."
'; - print img_object($langs->trans("ShowMember"),"member"); - print " ".$prod->ref."'.$prod->libelle."'.$prod->description."'.$member->nom."'.$member->prenom."
'; print '
'; -// Liste des formats d'exports disponibles +// List of available export format $var=true; print ''; print ''; @@ -70,9 +70,8 @@ include_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php'); $model=new ModeleExports(); $liste=$model->liste_modeles($db); -foreach($liste as $key) +foreach($liste as $key => $val) { - $var=!$var; print ''; print ''; $text=$model->getDriverDesc($key); diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 4d1fe557f14..2fbabad6058 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1542,8 +1542,6 @@ class Form { print ''; $i++; diff --git a/htdocs/html.formcompany.class.php b/htdocs/html.formcompany.class.php index 98079a31409..543fb94dcb0 100644 --- a/htdocs/html.formcompany.class.php +++ b/htdocs/html.formcompany.class.php @@ -321,29 +321,31 @@ class FormCompany /** - * \brief Retourne la liste deroulante des civilite actives - * \param selected civilite pre-selectionnee + * \brief Retourne la liste deroulante des civilite actives + * \param selected civilite pre-selectionnee + * \param htmlname Name of HTML select combo field */ - function select_civilite($selected='') + function select_civilite($selected='',$htmlname='civilite_id') { global $conf,$langs,$user; $langs->load("dict"); $sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite"; - $sql .= " WHERE active = 1"; + $sql.= " WHERE active = 1"; dol_syslog("Form::select_civilite sql=".$sql); - if ($this->db->query($sql)) + $resql=$this->db->query($sql); + if ($resql) { - print ''; print ''; - $num = $this->db->num_rows(); + $num = $this->db->num_rows($resql); $i = 0; if ($num) { while ($i < $num) { - $obj = $this->db->fetch_object(); + $obj = $this->db->fetch_object($resql); if ($selected == $obj->code) { print ''; $i++; diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php index b09b9453ea4..cdc69d0ec5a 100644 --- a/htdocs/includes/modules/modAdherent.class.php +++ b/htdocs/includes/modules/modAdherent.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * @@ -22,7 +22,7 @@ /** * \defgroup adherent Module foundation - * \brief Module pour gerer les adherents d'une association + * \brief Module to manage members of a foundation */ /** @@ -43,7 +43,7 @@ class modAdherent extends DolibarrModules /** * \brief Constructeur. Definit les noms, constantes et boites - * \param DB handler d'acc�s base + * \param DB Database handler */ function modAdherent($DB) { @@ -184,9 +184,9 @@ class modAdherent extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='MembersAndSubscriptions'; $this->export_permission[$r]=array(array("adherent","export")); - $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'MorPhy','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); - $this->export_entities_array[$r]=array('a.rowid'=>'member','a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); - $this->export_alias_array[$r]=array('a.rowid'=>'Id','a.nom'=>"lastname",'a.prenom'=>"firstname",'a.login'=>"login",'a.morphy'=>'morphy','a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.phone'=>"phone",'a.phone_perso'=>"phone_perso",'a.phone_mobile'=>"phone_mobile",'a.email'=>"email",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.tms'=>'datem','a.datefin'=>'dateend','ta.rowid'=>'type_id','ta.libelle'=>'type_label','c.rowid'=>'id_subscription','c.dateadh'=>'date_subscription','c.cotisation'=>'amount_subscription'); + $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'MorPhy','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); + $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); + $this->export_alias_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"civility",'a.nom'=>"lastname",'a.prenom'=>"firstname",'a.login'=>"login",'a.morphy'=>'morphy','a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.phone'=>"phone",'a.phone_perso'=>"phone_perso",'a.phone_mobile'=>"phone_mobile",'a.email'=>"email",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.tms'=>'datem','a.datefin'=>'dateend','ta.rowid'=>'type_id','ta.libelle'=>'type_label','c.rowid'=>'id_subscription','c.dateadh'=>'date_subscription','c.cotisation'=>'amount_subscription'); // On complete avec champs options $sql='SELECT name, label FROM '.MAIN_DB_PREFIX.'adherent_options_label'; $resql=$this->db->query($sql); diff --git a/htdocs/includes/modules/modCategorie.class.php b/htdocs/includes/modules/modCategorie.class.php index c8db13dccea..ad6d850c8c6 100644 --- a/htdocs/includes/modules/modCategorie.class.php +++ b/htdocs/includes/modules/modCategorie.class.php @@ -143,6 +143,19 @@ class modCategorie extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_product = p.rowid'; $this->export_sql_end[$r] .=' AND u.type = 0'; // Supplier categories + + $r++; + $this->export_code[$r]='category_'.$r; + $this->export_label[$r]='CatMemberList'; + $this->export_icon[$r]='category'; + $this->export_permission[$r]=array(array("categorie","lire")); + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'MemberId','p.nom'=>'Name','p.prenom'=>'Firstname'); + $this->export_entities_array[$r]=array('p.rowid'=>'member','p.nom'=>'member','p.prenom'=>'member'); // We define here only fields that use another picto + $this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'p.rowid'=>'idprod','p.nom'=>'name','p.prenom'=>'firstname'); + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_member as cp, '.MAIN_DB_PREFIX.'adherent as p'; + $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid'; + $this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories } diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index 0224125f243..4f1c6c91bb1 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -140,13 +140,13 @@ class modProduit extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("produit","export")); - $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); + $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.barcode'=>'Barcode')); - $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.envente'=>"product",'p.datec'=>"product",'p.tms'=>"product"); + $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.envente'=>"product",'p.datec'=>"product",'p.tms'=>"product"); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.barcode'=>'product')); - $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.length'=>"length",'p.surface'=>"area",'p.volume'=>"volume",'p.weight'=>"weight",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.datec'=>'datecreation','p.tms'=>'datemodification'); + $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.length'=>"length",'p.surface'=>"area",'p.volume'=>"volume",'p.weight'=>"weight",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.datec'=>'datecreation','p.tms'=>'datemodification'); if (! empty($conf->stock->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.stock'=>'stock','p.pmp'=>'pmp')); if (! empty($conf->barcode->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.barcode'=>'barcode')); diff --git a/htdocs/includes/modules/modService.class.php b/htdocs/includes/modules/modService.class.php index 615b35dd81a..da4a54b977c 100644 --- a/htdocs/includes/modules/modService.class.php +++ b/htdocs/includes/modules/modService.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2009 Regis Houssin @@ -132,11 +132,11 @@ class modService extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="Services"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("service","export")); - $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); + $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock')); - $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.envente'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); + $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.envente'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product')); - $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification'); + $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification'); if (! empty($conf->stock->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.stock'=>'stock')); $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql index fa21e2a3908..d1a7297dc8c 100755 --- a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql +++ b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql @@ -120,3 +120,5 @@ ALTER TABLE llx_facturedet_rec MODIFY total_ht double(24,8); ALTER TABLE llx_facturedet_rec MODIFY total_tva double(24,8); ALTER TABLE llx_facturedet_rec MODIFY total_ttc double(24,8); + +ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity; diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index cfc45cb1dbd..5a1b2b02fa3 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -30,6 +30,7 @@ create table llx_adherent ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id + civilite varchar(6), nom varchar(50), prenom varchar(50), login varchar(50) NOT NULL, -- login diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index e1034565fec..a469e561f69 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -49,6 +49,7 @@ ProductIsInCategories=Product/service owns to following categories SupplierIsInCategories=Third party owns to following suppliers categories CompanyIsInCustomersCategories=This third party owns to following customers/prospects categories CompanyIsInSuppliersCategories=This third party owns to following suppliers categories +MemberIsInCategories=This member owns to following members categories ProductHasNoCategory=This product/service is not in any categories SupplierHasNoCategory=This supplier is not in any categories CompanyHasNoCategory=This company is not in any categories diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index da849c570ae..1fc0c2d3aa5 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -49,6 +49,7 @@ ProductIsInCategories=Ce produit/service est dans les catégories suivantes SupplierIsInCategories=Ce fournisseur est dans les catégories suivantes CompanyIsInCustomersCategories=Cette société est dans les catégories clients/prospects suivantes CompanyIsInSuppliersCategories=Cette société est dans les catégories fournisseurs suivantes +MemberIsInCategories=Cet adhérent est dans les catégories adhérent suivantes ProductHasNoCategory=Ce produit/service n'est dans aucune catégorie en particulier SupplierHasNoCategory=Ce fournisseur n'est dans aucune catégorie en particulier CompanyHasNoCategory=Cette société n'est dans aucune catégorie en particulier
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).'