diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index 67254a35f16..1605a3afa81 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * @@ -87,24 +87,25 @@ class Adherent } -/** + /** \brief function envoyant un email au destinataire (recipient) avec le text fourni en parametre. \param recipients destinataires \param text contenu du message \param subject sujet du message - \remarks La particularite de cette fonction est de remplacer certains champs - \remarks par leur valeur pour l'adherent en l'occurrence : - \remarks %PRENOM% : est remplace par le prenom - \remarks %NOM% : est remplace par nom - \remarks %INFOS% : l'ensemble des attributs de cet adherent - \remarks %SERVEUR% : URL du serveur web - \remarks etc.. - \todo Utiliser classe CMailFile -*/ - - function send_an_email($recipients,$text,$subject="Vos coordonnees sur %SERVEUR%") - { - $patterns = array ( + \return int <0 si ko, >0 si ok + \remarks La particularite de cette fonction est de remplacer certains champs + \remarks par leur valeur pour l'adherent en l'occurrence : + \remarks %PRENOM% : est remplace par le prenom + \remarks %NOM% : est remplace par nom + \remarks %INFOS% : l'ensemble des attributs de cet adherent + \remarks %SERVEUR% : URL du serveur web + \remarks etc.. + */ + function send_an_email($recipients,$text,$subject="Vos coordonnees sur %SERVEUR%") + { + global $conf,$langs; + + $patterns = array ( '/%PRENOM%/', '/%NOM%/', '/%INFOS%/', @@ -121,16 +122,21 @@ class Adherent '/%LOGIN%/', '/%PASS%/' ); - $infos = "Prenom : $this->prenom\nNom : $this->nom\nSociete : $this->societe\nAdresse : $this->adresse\nCP : $this->cp\nVille : $this->ville\nPays : $this->pays\nEmail : $this->email\nLogin : $this->login\nPassword : $this->pass\nDate de naissance : $this->naiss\nPhoto : $this->photo\n"; - if ($this->public == 1) - { - $infos.="Fiche Publique : Oui\n"; - } - else - { - $infos.="Fiche Publique : Non\n"; - } - $replace = array ( + $infos.= $langs->trans("Lastname").": $this->nom\n"; + $infos = $langs->trans("Firstname").": $this->prenom\n"; + $infos.= $langs->trans("Company").": $this->societe\n"; + $infos.= $langs->trans("Address").": $this->adresse\n"; + $infos.= $langs->trans("Zip").": $this->cp\n"; + $infos.= $langs->trans("Town").": $this->ville\n"; + $infos.= $langs->trans("Country").": $this->pays\n"; + $infos.= $langs->trans("EMail").": $this->email\n"; + $infos.= $langs->trans("Login").": $this->login\n"; + $infos.= $langs->trans("Password").": $this->pass\n"; + $infos.= $langs->trans("Birthday").": $this->naiss\n"; + $infos.= $langs->trans("Photo").": $this->photo\n"; + $infos.= $langs->trans("Public").": ".yn($this->public)."\n"; + + $replace = array ( $this->prenom, $this->nom, $infos, @@ -147,14 +153,29 @@ class Adherent $this->login, $this->pass ); - $texttosend = preg_replace ($patterns, $replace, $text); - $subjectosend = preg_replace ($patterns, $replace, $subject); - if (defined('ADHERENT_MAIL_FROM') && ADHERENT_MAIL_FROM != ''){ - return mail($recipients,$subjectosend,$texttosend,"From: ".ADHERENT_MAIL_FROM."\nReply-To: ".ADHERENT_MAIL_FROM."\nX-Mailer: php/" . phpversion()); - }else{ - return mail($recipients,$subjectosend,$texttosend); - } - } + $texttosend = preg_replace ($patterns, $replace, $text); + $subjectosend = preg_replace ($patterns, $replace, $subject); + + // Envoi mail confirmation + include_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); + + $from=$conf->email_from; + if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + + $mailfile = new CMailFile($subject,$this->email,$from,$mesg,array(),array(),array()); + + if ($mailfile->sendfile()) + { + return 1; + } + else + { + $this->error=$langs->trans("ErrorFailedToSendPassword"); + return -1; + } + + } + /** \brief imprime une liste d'erreur. @@ -284,109 +305,120 @@ class Adherent } -/** - \brief fonction qui crée l'adhérent - \param userid userid de l'adhérent -*/ - - function create($userid) - { - /* - * Insertion dans la base - */ - - $this->date = $this->db->idate($this->date); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent (datec)"; - $sql .= " VALUES (now())"; - - $result = $this->db->query($sql); - - if ($result) + /** + \brief Fonction qui crée l'adhérent + \param userid userid de l'adhérent + \return int <0 si ko, >0 si ok + */ + function create($userid) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent"); - return $this->update(); + global $conf,$langs; + + // Verification parametres + if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email)) { + $this->error = $langs->trans("ErrorBadEMail",$this->email); + return -1; + } + + $this->date = $this->db->idate($this->date); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent (datec)"; + $sql .= " VALUES (now())"; + + $result = $this->db->query($sql); + + if ($result) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent"); + return $this->update(); + } + else + { + dolibarr_print_error($this->db); + return -1; + } } - else + + + /** + \brief fonction qui met à jour l'adhérent + \return int <0 si ko, >0 si ok + */ + function update() { - dolibarr_print_error($this->db); - return 0; - } - } - - -/** - \brief fonction qui met à jour l'adhérent -*/ - function update() - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; - $sql .= " prenom = '".$this->prenom ."'"; - $sql .= ",nom='" .$this->nom."'"; - $sql .= ",societe='".$this->societe."'"; - $sql .= ",adresse='".$this->adresse."'"; - $sql .= ",cp='" .$this->cp."'"; - $sql .= ",ville='" .$this->ville."'"; - $sql .= ",pays='" .$this->pays."'"; - $sql .= ",note='" .$this->commentaire."'"; - $sql .= ",email='" .$this->email."'"; - $sql .= ",login='" .$this->login."'"; - $sql .= ",pass='" .$this->pass."'"; - if ($this->naiss) $sql .= ",naiss='" .$this->naiss."'"; - else $sql .= ",naiss=null"; - $sql .= ",photo='" .$this->photo."'"; - $sql .= ",public='" .$this->public."'"; - $sql .= ",statut=" .$this->statut; - $sql .= ",fk_adherent_type=".$this->typeid; - $sql .= ",morphy='".$this->morphy."'"; - - $sql .= " WHERE rowid = $this->id"; - - $result = $this->db->query($sql); - - if (!$result) - { - dolibarr_print_error($this->db); - return 0; - } - - if (sizeof($this->array_options) > 0 ) - { - $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"; - foreach($this->array_options as $key => $value) - { - // recupere le nom de l'attribut - $attr=substr($key,8); - $sql.=",$attr"; - } - $sql .= ") VALUES ($this->id"; - foreach($this->array_options as $key => $value) - { - - $sql.=",'".$this->array_options[$key]."'"; - } - $sql.=");"; - - $result = $this->db->query($sql); - - if ($result) - { - return 1; - } - else - { - dolibarr_print_error($this->db); - return 0; - } - - } - - return 1; - } + global $conf,$langs; + + // Verification parametres + if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email)) { + $this->error = $langs->trans("ErrorBadEMail",$this->email); + return -1; + } + + + $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; + $sql .= " prenom = '".$this->prenom ."'"; + $sql .= ",nom='" .$this->nom."'"; + $sql .= ",societe='".$this->societe."'"; + $sql .= ",adresse='".$this->adresse."'"; + $sql .= ",cp='" .$this->cp."'"; + $sql .= ",ville='" .$this->ville."'"; + $sql .= ",pays='" .$this->pays_code."'"; + $sql .= ",note='" .$this->commentaire."'"; + $sql .= ",email='" .$this->email."'"; + $sql .= ",login='" .$this->login."'"; + $sql .= ",pass='" .$this->pass."'"; + $sql .= ",naiss=" .$this->naiss?"'".$this->naiss."'":"null"; + $sql .= ",photo=" .$this->photo?"'".$this->photo."'":"null"; + $sql .= ",public='" .$this->public."'"; + $sql .= ",statut=" .$this->statut; + $sql .= ",fk_adherent_type=".$this->typeid; + $sql .= ",morphy='".$this->morphy."'"; + $sql .= " WHERE rowid = ".$this->id; + + $result = $this->db->query($sql); + + if (!$result) + { + dolibarr_print_error($this->db); + return -1; + } + + if (sizeof($this->array_options) > 0 ) + { + $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"; + foreach($this->array_options as $key => $value) + { + // recupere le nom de l'attribut + $attr=substr($key,8); + $sql.=",$attr"; + } + $sql .= ") VALUES ($this->id"; + foreach($this->array_options as $key => $value) + { + + $sql.=",'".$this->array_options[$key]."'"; + } + $sql.=");"; + + $result = $this->db->query($sql); + + if ($result) + { + return 1; + } + else + { + dolibarr_print_error($this->db); + return -2; + } + + } + + return 1; + } /** @@ -469,9 +501,9 @@ class Adherent $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.public, d.adresse, d.cp, d.ville, d.note, d.email, d.login, d.pass, d.naiss, d.photo, d.fk_adherent_type, d.morphy, t.libelle as type"; $sql .= ",".$this->db->pdate("d.datefin")." as datefin"; $sql .= ", d.pays, p.rowid as pays_id, p.code as pays_code, p.libelle as pays_lib"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; + $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.rowid = $rowid AND d.fk_adherent_type = t.rowid"; + $sql .= " WHERE d.rowid = ".$rowid." AND d.fk_adherent_type = t.rowid"; $result=$this->db->query( $sql); if ($result) @@ -1257,10 +1289,10 @@ class Adherent } } - /** - * \brief Retourne le nom complet de l'adhérent - * \return string Nom complet - */ + /** + * \brief Retourne le nom complet de l'adhérent + * \return string Nom complet + */ function getFullname() { if ($this->nom && $this->prenom) return $this->nom.' '.$this->prenom; @@ -1269,27 +1301,56 @@ class Adherent return ''; } - /** - * \brief Retourne le libellé du statut d'un adhérent (brouillon, validé, résilié) - * \return string Libellé - */ - function getLibStatut() + /** + * \brief Retourne le libellé du statut d'un adhérent (brouillon, validé, résilié) + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long + * \return string Libellé + */ + function getLibStatut($mode=0) { - return $this->LibStatut($this->statut); + return $this->LibStatut($this->statut,$mode); } - /** - * \brief Renvoi le libellé d'un statut donné - * \param statut id statut - * \return string Libellé - */ - function LibStatut($statut) + /** + * \brief Renvoi le libellé d'un statut donné + * \param statut id statut + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long + * \return string Libellé + */ + function LibStatut($statut,$mode=0) { global $langs; $langs->load("members"); - if ($statut == -1) return $langs->trans("MemberStatusDraft"); - if ($statut == 1) return $langs->trans("MemberStatusActive"); - if ($statut == 0) return $langs->trans("MemberStatusResiliated"); + if ($mode == 0) + { + if ($statut == -1) return $langs->trans("MemberStatusDraft"); + if ($statut == 1) return $langs->trans("MemberStatusActive"); + if ($statut == 0) return $langs->trans("MemberStatusResiliated"); + } + if ($mode == 1) + { + if ($statut == -1) return $langs->trans("MemberStatusDraft"); + if ($statut == 1) return $langs->trans("MemberStatusActive"); + if ($statut == 0) return $langs->trans("MemberStatusResiliated"); + } + if ($mode == 2) + { + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); + if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4').' '.$langs->trans("MemberStatusActive"); + if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); + } + if ($mode == 3) + { + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4'); + if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + } + if ($mode == 4) + { + if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); + if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4').' '.$langs->trans("MemberStatusActive"); + if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); + } } diff --git a/htdocs/adherents/cartes/pre.inc.php b/htdocs/adherents/cartes/pre.inc.php index fe920d2b50b..1a8a1e74442 100644 --- a/htdocs/adherents/cartes/pre.inc.php +++ b/htdocs/adherents/cartes/pre.inc.php @@ -45,7 +45,7 @@ function llxHeader($head = "") { $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate")); $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated")); - $menu->add(DOL_URL_ROOT."/public/adherents/","Espace adherents public"); + $menu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks")); $menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports")); $menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas")); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index fc0c884d673..0cf1efdd9a5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-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 @@ -47,6 +47,11 @@ $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; + +/* + * Actions + */ + if ($_POST["action"] == 'sendinfo') { $adh = new Adherent($db); @@ -55,7 +60,6 @@ if ($_POST["action"] == 'sendinfo') $adh->send_an_email($adh->email,"Voici le contenu de votre fiche\n\n%INFOS%\n\n","Contenu de votre fiche adherent"); } - if ($_POST["action"] == 'cotisation') { $reday=$_POST["reday"]; @@ -73,9 +77,9 @@ if ($_POST["action"] == 'cotisation') // Rajout du nouveau cotisant dans les listes qui vont bien // if (defined("ADHERENT_MAILMAN_LISTS_COTISANT") && ADHERENT_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == "0000-00-00 00:00:00"){ - if (defined("ADHERENT_MAILMAN_LISTS_COTISANT") && ADHERENT_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == 0) + if ($conf->global->ADHERENT_MAILMAN_LISTS_COTISANT && $adh->datefin == 0) { - $adh->add_to_mailman(ADHERENT_MAILMAN_LISTS_COTISANT); + $adh->add_to_mailman($conf->global->ADHERENT_MAILMAN_LISTS_COTISANT); } $crowid=$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation); @@ -133,8 +137,9 @@ if ($_POST["action"] == 'cotisation') } // Envoi mail - if (defined("ADHERENT_MAIL_COTIS") && defined("ADHERENT_MAIL_COTIS_SUBJECT")){ - $adh->send_an_email($adh->email,ADHERENT_MAIL_COTIS,ADHERENT_MAIL_COTIS_SUBJECT); + if ($conf->global->ADHERENT_MAIL_COTIS) + { + $adh->send_an_email($adh->email,$conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT); } } else @@ -143,13 +148,80 @@ if ($_POST["action"] == 'cotisation') $adh->id = $rowid; $adh->fetch($rowid); } - $mesg='
'.$langs->trans("FieldRequired",$langs->trans("Amount")).'
'; + $errmsg=$langs->trans("FieldRequired",$langs->trans("Amount")); $action = "edit"; } +if ($action == 'update') +{ + if ($_POST["bouton"] == $langs->trans("Save")) + { + $datenaiss=mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + + $adh = new Adherent($db); + + $adh->id = $_POST["rowid"]; + $adh->prenom = $_POST["prenom"]; + $adh->nom = $_POST["nom"]; + $adh->societe = $_POST["societe"]; + $adh->adresse = $_POST["adresse"]; + $adh->amount = $_POST["amount"]; + $adh->cp = $_POST["cp"]; + $adh->ville = $_POST["ville"]; + $adh->email = $_POST["email"]; + $adh->login = $_POST["login"]; + $adh->pass = $_POST["pass"]; + $adh->naiss = $_POST["naiss"]; + $adh->photo = $_POST["photo"]; + $adh->date = $datenaiss; + $adh->note = $_POST["note"]; + $adh->pays = $_POST["pays"]; + $adh->typeid = $_POST["type"]; + $adh->commentaire = $_POST["comment"]; + $adh->morphy = $_POST["morphy"]; + // recuperation du statut et public + $adh->statut = $_POST["statut"]; + $adh->public = $_POST["public"]; + + foreach($_POST as $key => $value){ + if (ereg("^options_",$key)){ + $adh->array_options[$key]=$_POST[$key]; + } + } + if ($adh->update($user->id)>=0) + { + Header("Location: fiche.php?rowid=".$adh->id); + exit; + } + else + { + $errmsg=$adh->error; + $action=''; + } + } + else + { + Header("Location: fiche.php?rowid=".$rowid); + exit; + } +} + if ($_POST["action"] == 'add') { + $datenaiss=''; + if (isset($_POST["naissday"]) && $_POST["naissday"] + && isset($_POST["naissmonth"]) + && isset($_POST["naissyear"]) && $_POST["naissyear"]) + { + $datenaiss=mktime(12, 0 , 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); + } + $datecotisation=''; + if (isset($_POST["naissday"]) && isset($_POST["naissmonth"]) && isset($_POST["naissyear"])) + { + $datecotisation=mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + } + $type=$_POST["type"]; $nom=$_POST["nom"]; $prenom=$_POST["prenom"]; @@ -157,18 +229,14 @@ if ($_POST["action"] == 'add') $adresse=$_POST["adresse"]; $cp=$_POST["cp"]; $ville=$_POST["ville"]; - $pays=$_POST["pays"]; - $email=$_POST["email"]; - $login=$_POST["login"]; - $pass=$_POST["pass"]; - $naiss=$_POST["naiss"]; + $pays_code=$_POST["pays_code"]; + $email=$_POST["member_email"]; + $login=$_POST["member_login"]; + $pass=$_POST["member_pass"]; $photo=$_POST["photo"]; $note=$_POST["note"]; $comment=$_POST["comment"]; $morphy=$_POST["morphy"]; - $reday=$_POST["reday"]; - $remonth=$_POST["remonth"]; - $reyear=$_POST["reyear"]; $cotisation=$_POST["cotisation"]; $adh = new Adherent($db); @@ -178,11 +246,11 @@ if ($_POST["action"] == 'add') $adh->adresse = $adresse; $adh->cp = $cp; $adh->ville = $ville; - $adh->pays = $pays; + $adh->pays_code = $pays_code; $adh->email = $email; $adh->login = $login; $adh->pass = $pass; - $adh->naiss = $naiss; + $adh->naiss = $datenaiss; $adh->photo = $photo; $adh->note = $note; $adh->typeid = $type; @@ -231,17 +299,8 @@ if ($_POST["action"] == 'add') $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Password"))."
\n"; } - if (isset($naiss) && $naiss !=''){ - if (!preg_match("/^\d\d\d\d-\d\d-\d\d$/",$naiss)) { - $error++; - $errmsg .= $langs->trans("DateSubscription")." (".$langs->trans("DateFormatYYYYMMDD").")
\n"; - } - } - if (isset($public)) { - $public=1; - } else { - $public=0; - } + $public=0; + if (isset($public)) $public=1; if (!$error) { @@ -250,9 +309,10 @@ if ($_POST["action"] == 'add') { if ($cotisation > 0) { - $crowid=$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation); + $crowid=$adh->cotisation($datecotisation, $cotisation); + // insertion dans la gestion banquaire si configure pour - if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE) + if ($global->conf->ADHERENT_BANK_USE) { $dateop=strftime("%Y%m%d",time()); $amount=$cotisation; @@ -265,7 +325,8 @@ if ($_POST["action"] == 'add') else { // met a jour la table cotisation - $sql="UPDATE ".MAIN_DB_PREFIX."cotisation SET fk_bank=$insertid WHERE rowid=$crowid "; + $sql ="UPDATE ".MAIN_DB_PREFIX."cotisation"; + $sql.=" SET fk_bank=$insertid WHERE rowid=$crowid "; $result = $db->query($sql); if ($result) { @@ -279,6 +340,7 @@ if ($_POST["action"] == 'add') } } Header("Location: liste.php?statut=-1"); + exit; } else { dolibarr_print_error($db); @@ -294,6 +356,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') $adh = new Adherent($db); $adh->delete($rowid); Header("Location: liste.php"); + exit; } @@ -308,12 +371,13 @@ if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes') if (isset($adht->mail_valid) && $adht->mail_valid != '') { - $adh->send_an_email($adh->email,$adht->mail_valid,$conf->adherent->email_valid_subject); + $result=$adh->send_an_email($adh->email,$adht->mail_valid,$conf->adherent->email_valid_subject); } else { - $adh->send_an_email($adh->email,$conf->adherent->email_valid,$conf->adherent->email_valid_subject); + $result=$adh->send_an_email($adh->email,$conf->adherent->email_valid,$conf->adherent->email_valid_subject); } + // rajoute l'utilisateur dans les divers abonnements .. if (!$adh->add_to_abo($adht)) { @@ -392,38 +456,137 @@ if ($_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes') +/* + * + */ + llxHeader(); - -/* ************************************************************************** */ -/* */ -/* Création d'une fiche */ -/* */ -/* ************************************************************************** */ if ($errmsg != '') { - print ''; - print "\n"; - print '
$errmsg

'; + print '
'.$errmsg.'
'; + print "\n"; } // fetch optionals attributes and labels $adho->fetch_optionals(); +if ($action == 'edit') +{ + /******************************************** + * + * Fiche en mode edition + * + ********************************************/ + + $adho = new AdherentOptions($db); + $adh = new Adherent($db); + $adh->id = $rowid; + $adh->fetch($rowid); + // fetch optionals value + $adh->fetch_optionals($rowid); + // fetch optionals attributes and labels + $adho->fetch_optionals(); + + $adht = new AdherentType($db); + + + /* + * Affichage onglets + */ + $h = 0; + + $head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$rowid; + $head[$h][1] = $langs->trans("MemberCard"); + $hselected=$h; + $h++; + + dolibarr_fiche_head($head, $hselected, $adh->fullname); + + + print '
'; + print ''; + + print ""; + print ""; + print "statut."\">"; + print "public."\">"; + + $htmls = new Form($db); + + + print '"; + + print ''; + + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Morale"); + + print ""; + + $rowspan=13; + print ''; + + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + // Date naissance + print "\n"; + + // Url photo + print ''; + foreach($adho->attribute_label as $key=>$value) + { + print "\n"; + } + print ''; + print '
'.$langs->trans("Type").''; + $htmls->select_array("type", $adht->liste_array(), $adh->typeid); + print "'.$langs->trans("Comments").'
".$langs->trans("Person").""; + $htmls->select_array("morphy", $morphys, $adh->morphy); + print "'; + print '
'.$langs->trans("Firstname").'
'.$langs->trans("Name").'
'.$langs->trans("Company").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Zip").'/'.$langs->trans("Town").'
'.$langs->trans("Country").''; + $htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays'); + print '
'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
'.$langs->trans("Login").'
'.$langs->trans("Password").'
".$langs->trans("Birthday")."\n"; + $htmls->select_date(-1,'naiss','','',1,'update'); + print "
URL photo
$valuearray_options["options_$key"]."\">
'; + print ' '; + print ''; + print '
'; + print '
'; + + print ''; +} + if ($action == 'create') { - - print_titre($langs->trans("NewMember")); - print "
\n"; - print ''; - - print ''; + /* ************************************************************************** */ + /* */ + /* Fiche création */ + /* */ + /* ************************************************************************** */ $htmls = new Form($db); $adht = new AdherentType($db); + print_titre($langs->trans("NewMember")); + print "\n"; + print ''; + + print '
'; + print '\n"; - print ''; + $rowspan=12; + print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + + // Date naissance + print "\n"; + + // Url photo print ''; foreach($adho->attribute_label as $key=>$value){ print "\n"; @@ -470,7 +640,7 @@ if ($action == 'create') $htmls->select_date('','','','','','add'); print "\n"; - if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE) + if ($conf->global->ADHERENT_BANK_USE) { print ''; - print ''; + print ''; foreach($adho->attribute_label as $key=>$value){ print "\n"; @@ -641,7 +806,7 @@ if ($rowid) print '
'; - print "".$langs->trans("Edit").""; + print "".$langs->trans("Edit").""; // Valider if ($adh->statut < 1) diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 9b9b13d0615..4d9e89bafca 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-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 @@ -162,7 +162,7 @@ if ($result) // Statut print "
"; print "'; print ''; - $liste=$objmodel->liste_modeles($db); + $liste=$objmodelexport->liste_modeles($db); foreach($liste as $key) { $var=!$var; - print ''; + print ''; } print '
'.$langs->trans("MemberType").''; $listetype=$adht->liste_array(); if (sizeof($listetype)) { @@ -442,21 +605,28 @@ if ($action == 'create') $htmls->select_array("morphy", $morphys); print "
'.$langs->trans("Firstname").'*
'.$langs->trans("Lastname").'*
'.$langs->trans("Company").'
'.$langs->trans("Address").''; print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").''; - $htmls->select_pays($adh->pays?$adh->pays:$mysoc->pays,'pays'); + $htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays_code'); print '
'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
'.$langs->trans("Login").'*
'.$langs->trans("Password").'*
'.$langs->trans("Birthday").' ('.$langs->trans("DateFormatYYYYMMDD").')
'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
'.$langs->trans("Login").'*
'.$langs->trans("Password").'*
".$langs->trans("Birthday")."\n"; + $htmls->select_date(-1,'naiss','','',1,'add'); + print "
Url photo
$value
'.$langs->trans("PaymentMode").''; $htmls->select_types_paiements('','operation'); @@ -498,13 +668,14 @@ if ($action == 'create') } -/* ************************************************************************** */ -/* */ -/* Edition de la fiche */ -/* */ -/* ************************************************************************** */ -if ($rowid) +if ($rowid && $action != 'edit') { + /* ************************************************************************** */ + /* */ + /* Mode affichage */ + /* */ + /* ************************************************************************** */ + $adh = new Adherent($db); $adh->id = $rowid; $adh->fetch($rowid); @@ -527,27 +698,21 @@ if ($rowid) dolibarr_fiche_head($head, $hselected, $adh->fullname); - /* - * Confirmation de la suppression de l'adhérent - */ + // Confirmation de la suppression de l'adhérent if ($action == 'delete') { $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_delete"); print '
'; } - /* - * Confirmation de la validation - */ + // Confirmation de la validation if ($action == 'valid') { $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid"); print '
'; } - /* - * Confirmation de la Résiliation - */ + // Confirmation de la Résiliation if ($action == 'resign') { $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign"); @@ -622,7 +787,7 @@ if ($rowid) if ($adh->public==1) print $langs->trans("Yes"); else print $langs->trans("No"); print '
'.$langs->trans("Status").''.$adh->getLibStatut($adh).'
'.$langs->trans("Status").''.$adh->getLibStatut(4).'
$value".$adh->array_options["options_$key"]." 
"; - print $adh->LibStatut($objp->statut); + print $adh->LibStatut($objp->statut,2); print "rowid&action=edit\">".img_edit()."   "; diff --git a/htdocs/adherents/pre.inc.php b/htdocs/adherents/pre.inc.php index 0c7a275ead8..8301212b7be 100644 --- a/htdocs/adherents/pre.inc.php +++ b/htdocs/adherents/pre.inc.php @@ -46,7 +46,7 @@ function llxHeader($head = "") { $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate")); $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated")); - $menu->add(DOL_URL_ROOT."/public/adherents/","Espace adherents public"); + $menu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks")); $menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports")); $menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas")); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 1a4b4856efb..db0b2910b7c 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -38,8 +38,14 @@ $user->getrights(); if (! $user->societe_id == 0) accessforbidden(); -$entitytoicon=array('invoice'=>'bill','invoice_line'=>'bill'); -$entitytolang=array('user'=>'User','company'=>'Company','contact'=>'Contact','invoice'=>'Bill','invoice_line'=>'InvoiceLine'); +$entitytoicon=array( + 'invoice'=>'bill','invoice_line'=>'bill', + 'member'=>'user', 'member_type'=>'user'); +$entitytolang=array( + 'user'=>'User', + 'company'=>'Company','contact'=>'Contact', + 'invoice'=>'Bill','invoice_line'=>'InvoiceLine', + 'member'=>'Member','member_type'=>'MemberType'); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); $datatoexport=isset($_GET["datatoexport"])?$_GET["datatoexport"]:''; @@ -49,7 +55,7 @@ $step=isset($_GET["step"])?$_GET["step"]:'1'; $objexport=new Export($db); $objexport->load_arrays($user,$datatoexport); -$objmodel=new ModeleExports(); +$objmodelexport=new ModeleExports(); /* @@ -467,11 +473,11 @@ if ($step == 4 && $datatoexport) print ''.$langs->trans("LibraryVersion").'
'.$objmodel->getDriverLabel($key).''.$objmodel->getLibLabel($key).''.$objmodel->getLibVersion($key).'
'.$objmodelexport->getDriverLabel($key).''.$objmodelexport->getLibLabel($key).''.$objmodelexport->getLibVersion($key).'
'; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 913409076d9..4e74c75997f 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1576,17 +1576,23 @@ class Form * Les champs sont présélectionnées avec: * - La date set_time (timestamps ou date au format YYYY-MM-DD ou YYYY-MM-DD HH:MM) * - La date du jour si set_time vaut '' - * - Aucune date (champs vides) si set_time vaut -1 - * \param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre. + * - Aucune date (champs vides) si set_time vaut -1 (dans ce cas empty doit valoir 0) + * \param set_time Date de pré-sélection + * \param prefix Prefix pour nom champ + * \param h Heure + * \param m Minutes + * \param empty 0=Champ obligatoire, 1=Permet une saisie vide + * \param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre. */ - function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0,$form_name="") + function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0, $form_name="") { global $conf,$langs; + if($prefix=='') $prefix='re'; if($h == '') $h=0; if($m == '') $m=0; if($empty == '') $empty=0; - + if (! $set_time && $empty == 0) $set_time = time(); $strmonth[1] = $langs->trans("January"); @@ -1603,7 +1609,8 @@ class Form $strmonth[12] = $langs->trans("December"); // Analyse de la date de préselection - if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$set_time,$reg)) { + if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$set_time,$reg)) + { // Date au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS' $syear = $reg[1]; $smonth = $reg[2]; @@ -1611,7 +1618,8 @@ class Form $shour = $reg[4]; $smin = $reg[5]; } - elseif ($set_time) { + elseif ($set_time > 0) + { // Date est un timestamps $syear = date("Y", $set_time); $smonth = date("n", $set_time); @@ -1619,8 +1627,9 @@ class Form $shour = date("H", $set_time); $smin = date("i", $set_time); } - else { - // Date est vide + else + { + // Date est vide ou vaut -1 $syear = ''; $smonth = ''; $sday = ''; @@ -1633,16 +1642,15 @@ class Form */ if ($conf->use_javascript && $conf->use_popup_calendar && $h==0 && $m==0) { + //print "e".$set_time." t ".$conf->format_date_short; + if ($set_time > 0) + { + $formated_date=dolibarr_print_date($set_time,$conf->format_date_short); + } + // Calendrier popup version eldy if ("$conf->use_popup_calendar" == "eldy") // Laissé conf->use_popup_calendar entre quote { - //print "e".$set_time." t ".$conf->format_date_short; - if ($set_time) - { - $timearray=getDate($set_time); - $formated_date=dolibarr_print_date($set_time,$conf->format_date_short); - } - // Zone de saisie manuelle de la date print 'defaultlang != "") { - print ''; } print ''; - $formated_date=dolibarr_print_date($set_time,$conf->format_date_short); - if($formated_date=="?") $formated_date=""; print ' '; print ''."\n"; print ''."\n"; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index bde52f5e911..aa4c283e634 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -617,8 +617,15 @@ class MenuLeft { if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adhérents",1,$user->rights->adherent->export); - $newmenu->add(DOL_URL_ROOT."/public/adherents/index.php","Espace adherents public"); - + $newmenu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks")); + /* + if ($leftmenu=="member_public") $newmenu->add(DOL_URL_ROOT."/public/adherents/","Non adherent"); + if ($leftmenu=="member_public") $newmenu->add_submenu("new.php","Inscription"); + if ($leftmenu=="member_public") $newmenu->add(DOL_URL_ROOT."/public/adherents/","Adherents"); + if ($leftmenu=="member_public") $newmenu->add_submenu("priv_edit.php",$langs->trans("EditCard")); + if ($leftmenu=="member_public") $newmenu->add_submenu("priv_liste.php",$langs->trans("List")); + */ + $newmenu->add(DOL_URL_ROOT."/adherents/index.php?leftmenu=setup&mainmenu=members",$langs->trans("Setup"),0,$user->rights->adherent->configurer); $newmenu->add_submenu(DOL_URL_ROOT."/adherents/type.php?leftmenu=setup&",$langs->trans("MembersTypes"),1,$user->rights->adherent->configurer); $newmenu->add_submenu(DOL_URL_ROOT."/adherents/options.php?leftmenu=setup&",$langs->trans("MembersAttributes"),1,$user->rights->adherent->configurer); diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php index f74ec1bc84b..f5222f77ff4 100644 --- a/htdocs/includes/modules/export/export_excel.modules.php +++ b/htdocs/includes/modules/export/export_excel.modules.php @@ -71,7 +71,7 @@ class ExportExcel extends ModeleExports // If driver use an external library, put its name here $this->label_lib='Php_WriteExcel'; - $this->version_lib='?'; + $this->version_lib='0.3.0'; $this->row=0; } diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php index 9df351e5652..4ecbd1ed657 100644 --- a/htdocs/includes/modules/modAdherent.class.php +++ b/htdocs/includes/modules/modAdherent.class.php @@ -197,8 +197,9 @@ class modAdherent extends DolibarrModules $r++; $this->export_code[$r]=$this->id.'_'.$r; $this->export_label[$r]='Adhérents et attributs'; - $this->export_fields_array[$r]=array('a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.email'=>"Email",'a.login'=>"Login",'a.naiss'=>"Birthday"); - $this->export_alias_array[$r]=array('a.nom'=>"lastname",'a.prenom'=>"firstname",'a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.email'=>"email",'a.login'=>"login",'a.naiss'=>"birthday"); + $this->export_fields_array[$r]=array('a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.email'=>"Email",'a.login'=>"Login",'a.naiss'=>"Birthday",'a.statut'=>"Satus",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.datefin'=>'DateEnd','a.tms'=>'DateLastModification','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel'); + $this->export_entities_array[$r]=array('a.nom'=>"member",'a.prenom'=>"member",'a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.email'=>"member",'a.login'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.datefin'=>'member','a.tms'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type'); + $this->export_alias_array[$r]=array('a.nom'=>"lastname",'a.prenom'=>"firstname",'a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.email'=>"email",'a.login'=>"login",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.datefin'=>'dateend','a.tms'=>'datem','ta.rowid'=>'type_id','ta.libelle'=>'type_label'); $this->export_sql[$r]="select "; $i=0; foreach ($this->export_alias_array[$r] as $key => $value) @@ -207,7 +208,7 @@ class modAdherent extends DolibarrModules else $i++; $this->export_sql[$r].=$key.' as '.$value; } - $this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'adherent as a'; + $this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'adherent as a, '.MAIN_DB_PREFIX.'adherent_type as ta WHERE a.fk_adherent_type = ta.rowid'; $this->export_permission[$r]=array(array("adherent","export")); } diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index c35060d0c12..4b5eefe9400 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -1,4 +1,6 @@ # Dolibarr language file - en_US - members +MembersArea=Members area +PublicMembersArea=Public members area MemberCard=Member card Member=Member Members=Members @@ -19,9 +21,13 @@ MenuMembersResiliated=Resiliated members DateAbonment=Subscription date DateSubscription=Subscription date DateNextSubscription=Next subscription +DateEndSubscription=Subscription end date EndSubscription=End subscription NewMember=New member NewType=New member type +MemberType=Member type +MemberTypeId=Member type id +MemberTypeLabel=Member type label MembersTypes=Members types MembersAttributes=Members attributes SearchAMember=Search a member @@ -36,7 +42,6 @@ MembersStatusResiliated=Members resiliated NewCotisation=New cotisation EditMember=Edit member SubscriptionEndDate=Subscription end date -MembersArea=Members area NewAttribute=New attribut AttributeCode=Attribute code OptionalFieldsSetup=Optional fields setup @@ -65,4 +70,8 @@ ConfirmDeleteMember=Are you sure you want to delete this member (Deleting a meme Filehtpasswd=htpasswd file ValidateMember=Validate a member ConfirmValidateMember=Are you sure you want to validate this member ? +FollowingLinksArePublic=Following links ares opened pages not protected by any Dolibarr permission. +PublicMemberList=Public member list +BlankSubscriptionForm=Subscription form +MemberPublicLinks=Public links/pages ExportDataset_member_1=Members and properties \ No newline at end of file diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 57d77c389d1..91b4eeaf770 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -1,4 +1,6 @@ # Dolibarr language file - fr_FR - members +MembersArea=Espace adhérents +PublicMembersArea=Espace public des adhérents MemberCard=Fiche adhérent Member=Adhérent Members=Adhérents @@ -18,10 +20,14 @@ MenuMembersUpToDate=Adh MenuMembersResiliated=Adhérents résiliés DateAbonment=Date cotisation DateSubscription=Date cotisation -DateNextSubscription=Prochaine cotisation +DateNextSubscription=Date prochaine cotisation +DateEndSubscription=Date fin adhésion EndSubscription=Fin adhésion NewMember=Nouvel adhérent NewType=Nouveau type d'adhérent +MemberType=Type d'adhérent +MemberTypeId=Id type adhérent +MemberTypeLabel=Libellé du type adhérent MembersTypes=Types d'adhérents MembersAttributes=Attributs adhérents SearchAMember=Rechercher un membre @@ -36,7 +42,6 @@ MembersStatusResiliated=Adh NewCotisation=Nouvelle adhésion EditMember=Édition adhérent SubscriptionEndDate=Date de fin adhésion -MembersArea=Espace adhérents NewAttribute=Nouvel attribut AttributeCode=Code de l'attribut OptionalFieldsSetup=Configuration des champs optionnels @@ -65,4 +70,8 @@ ConfirmDeleteMember=Etes-vous s Filehtpasswd=Fichier htpasswd ValidateMember=Valider un adhérent ConfirmValidateMember=Etes-vous sûr de vouloir valider cet adhérent ? +FollowingLinksArePublic=Les liens suivants sont des pages accessibles à tous et non protégées par aucune habilitation Dolibarr. +PublicMemberList=Liste des membres publiques +BlankSubscriptionForm=Formulaire inscription +MemberPublicLinks=Liens/pages publiques ExportDataset_member_1=Adhérentes et caractéristiques diff --git a/htdocs/public/adherents/index.php b/htdocs/public/adherents/index.php index caac942004c..83c297e6010 100644 --- a/htdocs/public/adherents/index.php +++ b/htdocs/public/adherents/index.php @@ -1,5 +1,6 @@ + * 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 @@ -17,25 +18,48 @@ * * $Id$ * $Source$ - * */ + +/** + \file htdocs/public/adherents/index.php + \ingroup member + \brief Fichier de la page de l'espace publique adherent + \author Laurent Destailleur + \version $Revision$ +*/ + require("./pre.inc.php"); + + +/* + * Afffichage page + */ + llxHeader(); -print_titre("Gestion des adhesions a l'association"); +print_fiche_titre($langs->trans("PublicMembersArea")); + + +print ''; + +print '
'; + +print $langs->trans('FollowingLinksArePublic').'
'; +print '
'; print ''; -print ''; -print ''; -print ''; -print ''; - - - +print ''; +print ''; +print ''; +print ''; print '
Les menus ci-contre correspondent a:
-Inscription : Formulaires d\'inscription pour les non-adherents
-Edition de sa fiche : Permet d\'editer sa fiche d\'adherent
-Liste des adherents : Permet de voir la liste des adherents (reserve aux adherents)
'.$langs->trans("Description").''.$langs->trans("URL").'
'.$langs->trans("BlankSubscriptionForm").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/new.php'.'
'.$langs->trans("BlankSubscriptionEditForm").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/priv_edit.php?id=xxx'.'
'.$langs->trans("PublicMemberList").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/priv_liste.php'.'
'; + +print '
'; + + $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/public/adherents/new.php b/htdocs/public/adherents/new.php index 459e1817b56..c2df57a83da 100644 --- a/htdocs/public/adherents/new.php +++ b/htdocs/public/adherents/new.php @@ -1,6 +1,7 @@ - * Jean-Louis Bergamo + * 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 * the Free Software Foundation; either version 2 of the License, or @@ -116,7 +117,8 @@ if ($_POST["action"] == 'add') } } -llxHeader(); + +llxHeaderVierge(); /* ************************************************************************** */ @@ -128,7 +130,8 @@ llxHeader(); // fetch optionals attributes and labels $adho->fetch_optionals(); -if (isset($action) && $action== 'added'){ +if (isset($action) && $action== 'added') +{ print ''; print "\n"; print '
Nouvel Adhérent ajouté. En attente de validation
'; diff --git a/htdocs/public/adherents/pre.inc.php b/htdocs/public/adherents/pre.inc.php index a33b9a10126..1124cebcfa8 100644 --- a/htdocs/public/adherents/pre.inc.php +++ b/htdocs/public/adherents/pre.inc.php @@ -37,6 +37,12 @@ function llxHeader($head = "") $menu->add_submenu("priv_liste.php","Liste des adherents"); left_menu($menu->liste); +} + + +function llxHeaderVierge($head = "") +{ + global $user, $conf, $langs; } diff --git a/htdocs/public/adherents/priv_edit.php b/htdocs/public/adherents/priv_edit.php index be025aa4020..e3e6fcfc5dd 100644 --- a/htdocs/public/adherents/priv_edit.php +++ b/htdocs/public/adherents/priv_edit.php @@ -18,8 +18,8 @@ * * $Id$ * $Source$ - * */ + require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); @@ -129,7 +129,7 @@ if ($action == 'update') } -llxHeader(); +llxHeaderVierge(); if (isset($user->login)) { diff --git a/htdocs/public/adherents/priv_liste.php b/htdocs/public/adherents/priv_liste.php index 4781aecea21..43d20d744ce 100644 --- a/htdocs/public/adherents/priv_liste.php +++ b/htdocs/public/adherents/priv_liste.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-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 @@ -19,11 +19,12 @@ * * $Id$ * $Source$ - * */ + require("./pre.inc.php"); -llxHeader(); + +llxHeaderVierge(); if ($sortorder == "") { $sortorder="ASC"; }