diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index f087538613d..ac46a47fdaf 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin - * + * * * 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 @@ -47,6 +47,11 @@ if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { if (($_POST["constname"]=='ADHERENT_CARD_TYPE' || $_POST["constname"]=='ADHERENT_ETIQUETTE_TYPE') && $_POST["constvalue"] == -1) $_POST["constvalue"]=''; + if ($_POST["constname"]=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice + { + if ($_POST["constvalue"]) $_POST["constvalue"]=0; + else $_POST["constvalue"]=1; + } $const=$_POST["constname"]; $value=$_POST["constvalue"]; @@ -106,6 +111,23 @@ print "\n"; $var=true; $form = new Form($db); +// Login/Pass required for members +if ($conf->global->MAIN_FEATURES_LEVEL > 0) +{ + $var=!$var; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''.$langs->trans("AdherentLoginRequired").''; + print $form->selectyesno('constvalue',!$conf->global->ADHERENT_LOGIN_NOT_REQUIRED,1); + print ''; + print ''; + print "\n"; + print '
'; +} + // Mail required for members $var=!$var; print '
'; diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index bc72771e7c1..049e209ce6b 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -96,7 +96,7 @@ if ($action == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes' && $use // Creation user $company = new Societe($db); $result=$company->create_from_member($adh,$_POST["companyname"]); - + if ($result < 0) { $langs->load("errors"); @@ -457,6 +457,10 @@ if ($rowid) dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); + $rowspan=9; + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; + if ($conf->societe->enabled) $rowspan++; + print ''; print ''; print ''; @@ -464,10 +468,33 @@ if ($rowid) // Ref print ''.$langs->trans("Ref").''; - print ''; + print ''; print $html->showrefnav($adh,'rowid'); print ''; + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''.$langs->trans("Login").''.$adh->login.' '; + } + + // Morphy + print ''.$langs->trans("Nature").''.$adh->getmorphylib().''; + print ''; + print $html->showphoto('memberphoto',$adh); + print ''; + print ''; + + // Type + print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + + // Company + print ''.$langs->trans("Company").''.$adh->societe.''; + + // Civility + print ''.$langs->trans("UserTitle").''.$adh->getCivilityLabel().' '; + print ''; + // Name print ''.$langs->trans("Lastname").''.$adh->lastname.' '; print ''; @@ -476,12 +503,6 @@ if ($rowid) print ''.$langs->trans("Firstname").''.$adh->firstname.' '; print ''; - // Login - print ''.$langs->trans("Login").''.$adh->login.' '; - - // Type - print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; - // Status print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; @@ -749,16 +770,16 @@ if ($rowid) { $name=$adh->societe; } - + // Create a form array $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); - + $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); if ($ret == 'html') print '
'; } - + print ''; print ''; print ''; @@ -842,7 +863,7 @@ if ($rowid) if (empty($adh->fk_soc) || empty($bankviainvoice)) print ' disabled="true"'; print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else + else { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; @@ -857,7 +878,7 @@ if ($rowid) if (empty($adh->fk_soc) || empty($bankviainvoice)) print ' disabled="true"'; print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else + else { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index aecf23dbf7b..db31d26ed75 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -150,6 +150,29 @@ if ($id > 0) print $html->showrefnav($member,'rowid'); print ''; + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''.$langs->trans("Login").''.$member->login.' '; + } + + // Morphy + print ''.$langs->trans("Nature").''.$member->getmorphylib().''; + /*print ''; + print $html->showphoto('memberphoto',$member); + print '';*/ + print ''; + + // Type + print ''.$langs->trans("Type").''.$membert->getNomUrl(1)."\n"; + + // Company + print ''.$langs->trans("Company").''.$member->societe.''; + + // Civility + print ''.$langs->trans("UserTitle").''.$member->getCivilityLabel().' '; + print ''; + // Nom print ''.$langs->trans("Lastname").''.$member->nom.' '; print ''; @@ -158,12 +181,6 @@ if ($id > 0) print ''.$langs->trans("Firstname").''.$member->prenom.' '; print ''; - // Login - print ''.$langs->trans("Login").''.$member->login.' '; - - // Type - print ''.$langs->trans("Type").''.$membert->getNomUrl(1)."\n"; - // Status print ''.$langs->trans("Status").''.$member->getLibStatut(4).''; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 9bf6aba401c..8e75f25d164 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -98,19 +98,36 @@ if ($id) print ''; print ''; - // Nom - print ''.$langs->trans("Lastname").''.$adh->nom.' '; - print ''; - - // Prenom - print ''.$langs->trans("Firstname").''.$adh->prenom.' '; - // Login - print ''.$langs->trans("Login").''.$adh->login.' '; + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''.$langs->trans("Login").''.$adh->login.' '; + } + + // Morphy + print ''.$langs->trans("Nature").''.$adh->getmorphylib().''; + /*print ''; + print $html->showphoto('memberphoto',$member); + print '';*/ + print ''; // Type print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + // Company + print ''.$langs->trans("Company").''.$adh->societe.''; + + // Civility + print ''.$langs->trans("UserTitle").''.$adh->getCivilityLabel().' '; + print ''; + + // Lastname + print ''.$langs->trans("Lastname").''.$adh->nom.' '; + print ''; + + // Firstname + print ''.$langs->trans("Firstname").''.$adh->prenom.' '; + // Status print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index daea7cc2aa0..509486a7c44 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -358,8 +358,8 @@ else if ($_GET["id"] || $_GET["ref"]) if ($_GET["ref"]) $result = $member->fetch('',$_GET["ref"]); if ($_GET["id"]) $result = $member->fetch($_GET["id"]); - $adht = new AdherentType($db); - $adht->fetch($member->typeid); + $membert = new AdherentType($db); + $membert->fetch($member->typeid); llxHeader("","",$langs->trans("Member")); @@ -369,6 +369,9 @@ else if ($_GET["id"] || $_GET["ref"]) $picto='user'; dol_fiche_head($head, 'category', $titre,0,$picto); + $rowspan=5; + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; + if ($conf->societe->enabled) $rowspan++; print ''; @@ -378,7 +381,30 @@ else if ($_GET["id"] || $_GET["ref"]) print $html->showrefnav($member,'rowid'); print ''; - // Nom + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''; + } + + // Morphy + print ''; + /*print '';*/ + print ''; + + // Type + print '\n"; + + // Company + print ''; + + // Civility + print ''; + print ''; + + // Nom print ''; print ''; @@ -386,12 +412,6 @@ else if ($_GET["id"] || $_GET["ref"]) print ''; print ''; - // Login - print ''; - - // Type - print '\n"; - // Status print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c8b6c2ef621..4fe38c99f04 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3226,7 +3226,7 @@ class Form { global $dolibarr_main_url_root; $ret.=''; - $ret.='Photo found on Gravatar'; + $ret.='Photo found on Gravatar'; } else { diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index 8f82af018e6..1ff5950b3b9 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -10,6 +10,8 @@ -- To change type of field: ALTER TABLE llx_table MODIFY name varchar(60); -- +ALTER TABLE llx_adherent MODIFY login varchar(50); + ALTER TABLE llx_c_actioncomm add COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_commande_fournisseur MODIFY model_pdf varchar(255); diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 7bf9ae2adee..caf6f6848a4 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -33,7 +33,7 @@ create table llx_adherent civilite varchar(6), nom varchar(50), prenom varchar(50), - login varchar(50) NOT NULL, -- login + login varchar(50), -- login pass varchar(50), -- password fk_adherent_type integer NOT NULL, morphy varchar(3) NOT NULL, -- personne morale / personne physique diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e6ab70df4fb..45358a32ade 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -925,6 +925,7 @@ ContractsNumberingModules=Contracts numbering modules MembersSetup=Members module setup MemberMainOptions=Main options AddSubscriptionIntoAccount=Suggest by default to create a bank transaction, in bank module, when adding a new payed subscription +AdherentLoginRequired= Manage a Login for each member AdherentMailRequired=EMail required to create a new member MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default ##### LDAP setup ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ee9fadfed7f..cd1ba82423f 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -935,6 +935,7 @@ ContractsNumberingModules=Modèles de numérotation des contrats MembersSetup= Configuration du module Adhérents MemberMainOptions= Options principales AddSubscriptionIntoAccount= Proposer par défaut la création d'une écriture bancaire, dans le module banque, à l'enregistrement d'une adhésion payante +AdherentLoginRequired= Gérer un login pour chaque adhérent AdherentMailRequired= EMail obligatoire pour créer un nouvel adhérent MemberSendInformationByMailByDefault= Case à cocher pour envoyer un mail de confirmation (validation ou nouvelle cotisation) aux adhérents est à oui par défaut. ##### LDAP setup ##### diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 97c5322baf2..65accc1bc61 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -118,7 +118,7 @@ function dol_buildpath($path,$type=0) $res = DOL_URL_ROOT.$path; // Standard value if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT) // We check only if alternate feature is used { - preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?)/i',$path,$regs); // Take part before '?' + preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?(\.png)?(\.jpg)?)/i',$path,$regs); // Take part before '?' if (! empty($regs[1])) { if (! file_exists(DOL_DOCUMENT_ROOT.$regs[1])) $res = DOL_URL_ROOT_ALT.$path; @@ -130,7 +130,7 @@ function dol_buildpath($path,$type=0) $res = DOL_MAIN_URL_ROOT.$path; // Standard value if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT) // We check only if alternate feature is used { - preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?)/i',$path,$regs); // Take part before '?' + preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?(\.png)?(\.jpg)?)/i',$path,$regs); // Take part before '?' if (! empty($regs[1])) { if (! file_exists(DOL_DOCUMENT_ROOT.$regs[1])) $res = DOL_MAIN_URL_ROOT_ALT.$path;
'.$langs->trans("Login").''.$member->login.' 
'.$langs->trans("Nature").''.$member->getmorphylib().''; + print $html->showphoto('memberphoto',$member); + print '
'.$langs->trans("Type").''.$membert->getNomUrl(1)."
'.$langs->trans("Company").''.$member->societe.'
'.$langs->trans("UserTitle").''.$member->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$member->nom.' 
'.$langs->trans("Firstname").''.$member->prenom.' 
'.$langs->trans("Login").''.$member->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Status").''.$member->getLibStatut(4).'