diff --git a/htdocs/public/adherents/index.php b/htdocs/public/adherents/index.php index 68158747d9a..b6ac8075c86 100644 --- a/htdocs/public/adherents/index.php +++ b/htdocs/public/adherents/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2007 Laurent Destailleur + * Copyright (C) 2006-2008 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 @@ -15,9 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** @@ -25,18 +22,35 @@ \ingroup member \brief Fichier de la page de l'espace publique adherent \author Laurent Destailleur - \version $Revision$ + \version $Id$ */ -require("./pre.inc.php"); +require("../../master.inc.php"); +function llxHeaderVierge($title, $head = "") +{ + global $user, $conf, $langs; + + print "\n"; + print "\n"; + print "".$title."\n"; + if ($head) print $head."\n"; + print "\n"; + print "\n"; +} + +function llxFooter() +{ + print "\n"; + print "\n"; +} /* * Afffichage page */ -llxHeader(); +llxHeaderVierge("Index public"); print_fiche_titre($langs->trans("PublicMembersArea")); @@ -51,8 +65,8 @@ print '
'; print ''; print ''; print ''; -print ''; print ''; +print ''; print '
'.$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'.'
'.$langs->trans("PublicMemberCard").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/priv_fiche.php?id=xxx'.'
'; diff --git a/htdocs/public/adherents/new.php b/htdocs/public/adherents/new.php index af17372ae06..5cbbf275118 100644 --- a/htdocs/public/adherents/new.php +++ b/htdocs/public/adherents/new.php @@ -16,22 +16,39 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/public/adherents/new.php \ingroup adherent - \brief formulaire exemple pour inscription publique d'un nouveau membre - \version $Revision$ + \brief Form example to add a new member + \version $Id$ */ -require("./pre.inc.php"); +require("../../master.inc.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); 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."/html.form.class.php"); + +function llxHeaderVierge($title, $head = "") +{ + global $user, $conf, $langs; + + print "\n"; + print "\n"; + print "".$title."\n"; + if ($head) print $head."\n"; + print "\n"; + print "\n"; +} + +function llxFooter() +{ + print "\n"; + print "\n"; +} + $adho = new AdherentOptions($db); $errmsg=''; @@ -139,7 +156,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'added' && $conf->global->MEMBE -llxHeaderVierge(); +llxHeaderVierge("New member form"); $html = new Form($db); print_titre("Nouvel adhérent"); @@ -185,11 +202,11 @@ print '
  • Les champs Commencant par un * sont obligat print '
  • Les champs Commencant par un * seront affiche sur la liste publique des membres. Si vous ne souhaite pas cela DECOCHEZ la case public ci dessous'; print "
  • Les login et password vous serviront a editer vos coordonnees ulterieurement
    \n"; print "
    \n"; -print "
    \n"; -print ''; +print "\n"; print ''; +print '
    '; print '\n"; } print ''; -print "\n"; print "
    '.$langs->trans("Type").''; $html->select_array("type", $adht->liste_array()); @@ -224,11 +241,11 @@ foreach($adho->attribute_label as $key=>$value){ print "
    $value
    \n"; - +print "\n"; + $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/public/adherents/pre.inc.php b/htdocs/public/adherents/pre.inc.php index b58c9c743a8..09d4f897dcf 100644 --- a/htdocs/public/adherents/pre.inc.php +++ b/htdocs/public/adherents/pre.inc.php @@ -14,14 +14,17 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * */ +/** + \file htdocs/lib/datepicker.php + \brief Fichier de gestion de la popup de selection de date eldy + \version $Id$ +*/ + require("../../main.inc.php"); + function llxHeader($head = "") { global $user, $conf, $langs; @@ -39,14 +42,4 @@ function llxHeader($head = "") left_menu($menu->liste); } - -function llxHeaderVierge($head = "") -{ - global $user, $conf, $langs; - - top_htmlhead(''); - print ''; - -} - ?> diff --git a/htdocs/public/adherents/priv_edit.php b/htdocs/public/adherents/priv_edit.php deleted file mode 100644 index f6fdb279e75..00000000000 --- a/htdocs/public/adherents/priv_edit.php +++ /dev/null @@ -1,278 +0,0 @@ - - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2007 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/public/adherents/priv_edit.php - \ingroup adherent - \brief Page edition de sa fiche adherent - \version $Revision$ -*/ - -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); - -$adho = new AdherentOptions($db); - -$langs->load("companies"); -$langs->load("main"); -$langs->load("other"); -$langs->load("users"); - -$errmsg=''; -$num=0; -$error=0; - - -/* - * Actions - */ - -if ($action == 'update') -{ - - if ($_POST["bouton"] == $langs->trans("Save")) - { - if (isset($user->login)){ - $adh = new Adherent($db); - $adh->fetch_login($user->login); - if ($_POST["rowid"] == $adh->id){ - // user and rowid is the same => good - - // test some values - // test si le login existe deja - $sql = "SELECT rowid,login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$user->login."';"; - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - } - if (!isset($nom) || !isset($prenom) || $prenom=='' || $nom==''){ - $error+=1; - $errmsg .="Nom et Prenom obligatoires
    \n"; - } - if (!isset($email) || $email == '' || !ereg('@',$email)){ - $error+=1; - $errmsg .="Adresse Email invalide
    \n"; - } - if ($num !=0){ - $obj=$db->fetch_object(0); - if ($obj->rowid != $adh->id){ - $error+=1; - $errmsg .="Login deja utilise. Veuillez en changer
    \n"; - } - } - if (isset($naiss) && $naiss !=''){ - if (!preg_match("/^\d\d\d\d-\d\d-\d\d$/",$naiss)){ - $error+=1; - $errmsg .="Date de naissance invalide (Format AAAA-MM-JJ)
    \n"; - } - } - if (!$error){ - // email a peu pres correct et le login n'existe pas - $adh->id = $_POST["rowid"]; - $adh->prenom = $prenom; - $adh->nom = $nom; - $adh->societe = $societe; - $adh->adresse = $adresse; - $adh->amount = $amount; - $adh->cp = $cp; - $adh->ville = $_POST["ville"]; - $adh->email = $_POST["email"]; - // interdiction de la modif du login adherent - // $adh->login = $_POST["login"]; - $adh->login = $adh->login; - $adh->pass = $_POST["pass"]; - $adh->naiss = $_POST["naiss"]; - $adh->photo = $_POST["photo"]; - $adh->date = mktime(12, 0 , 0, $remonth, $reday, $reyear); - $adh->note = $_POST["note"]; - $adh->pays = $_POST["pays"]; - $adh->typeid = $_POST["type"]; - $adh->note = $_POST["comment"]; - $adh->morphy = $_POST["morphy"]; - // recuperation du statut et public - $adh->statut = $_POST["statut"]; - if (isset($public)){ - $public=1; - }else{ - $public=0; - } - $adh->public = $public; - foreach($_POST as $key => $value){ - if (ereg("^options_",$key)){ - $adh->array_options[$key]=$_POST[$key]; - } - } - if ($adh->update($user->id) ) - { - $adh->send_an_email($email,$conf->adherent->email_edit,$conf->adherent->email_edit_subject); - //Header("Location: fiche.php?rowid=$adh->id&action=edit"); - Header("Location: priv_edit.php"); - } - } - }else{ - Header("Location: priv_edit.php"); - } - } - } - else - { - //Header("Location: fiche.php?rowid=$rowid&action=edit"); - Header("Location: priv_edit.php"); - } -} - - -llxHeaderVierge(); - -if (isset($_GET["id"])) -{ - $adh = new Adherent($db); - $result=$adh->fetch($_GET["id"]); - $adh->fetch_optionals($adh->id); - // fetch optionals attibutes - $adho->fetch_optionals(); - - $adht = new AdherentType($db); - - print_titre("Edition de la fiche adhérent de $adh->prenom $adh->nom"); - - if ($errmsg != ''){ - print ''; - - print ''; - print "\n"; - // print "$errmsg\n"; - print '
    Erreur dans le formulaire
    $errmsg
    '; - } - - // Formulaire modifications - print '
    '; - print ""; - print "id\">"; - print "statut."\">"; - print "login."\">"; - print "typeid."\">"; - print "morphy."\">"; - // print "public."\">"; - - $htmls = new Form($db); - $caneditfield=1; - - print ''; - - // Nom - print ''; - - // Photo - $rowspan=14; - $rowspan+=sizeof($adho->attribute_label); - print ''; - print ''; - - // Prenom - print ''; - print ''; - - // Login -// print ''; - print ''; - - // Password - print ''; - - // Société - print ''; - - // Adresse - print ''; - - // Cp - print ''; - - // Pays - print ''; - - // Tel - print ''; - - // Tel perso - print ''; - - // Tel mobile - print ''; - - // EMail - print ''; - - // Date naissance - print "\n"; - - // Profil public - print "\n"; - - // Attributs supplémentaires - foreach($adho->attribute_label as $key=>$value) - { - print "\n"; - } - - print ''; - - print '
    '.$langs->trans("Lastname").'*'; - if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg")) - { - print ''; - } - else - { - print ''; - } - if ($caneditfield) - { - print '

    '; - print '
    '.$langs->trans("PhotoFile").'
    '; - print ''; - print '
    '; - } - print '
    '.$langs->trans("Firstname").'*
    '.$langs->trans("Login").'*
    '.$langs->trans("Login").'*'.$adh->login.'
    '.$langs->trans("Password").'*
    '.$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("PhonePro").'
    '.$langs->trans("PhonePerso").'
    '.$langs->trans("PhoneMobile").'
    '.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
    ".$langs->trans("Birthday")."\n"; - $htmls->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update'); - print "
    ".$langs->trans("Public")."\n"; - print $htmls->selectyesno("public",$adh->public,1); - print "
    $valuearray_options["options_$key"]."\">
    '; - print ''; -// print '       '; -// print ''; - print '
    '; - - print '
    '; -} - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/public/adherents/priv_fiche.php b/htdocs/public/adherents/priv_fiche.php index 3e568a64b16..e9c1d142302 100644 --- a/htdocs/public/adherents/priv_fiche.php +++ b/htdocs/public/adherents/priv_fiche.php @@ -16,27 +16,49 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ - -require("./pre.inc.php"); + +/** + \file htdocs/lib/datepicker.php + \brief Fichier de gestion de la popup de selection de date eldy + \version $Id$ +*/ + +require("../../master.inc.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); +function llxHeaderVierge($title, $head = "") +{ + global $user, $conf, $langs; + + print "\n"; + print "\n"; + print "".$title."\n"; + if ($head) print $head."\n"; + print "\n"; + print "\n"; +} + +function llxFooter() +{ + print "\n"; + print "\n"; +} + +$rowid=$_GET["id"]; $adho = new AdherentOptions($db); -llxHeader(); -/* ************************************************************************** */ -/* */ -/* Edition de la fiche */ -/* */ -/*************************************************************************** */ +/* + * View + */ + +llxHeaderVierge("Member edit"); + // fetch optionals attributes and labels $adho->fetch_optionals(); if ($rowid > 0) diff --git a/htdocs/public/adherents/priv_liste.php b/htdocs/public/adherents/priv_liste.php index 8ea9aa1bc8b..d9d0f73a220 100644 --- a/htdocs/public/adherents/priv_liste.php +++ b/htdocs/public/adherents/priv_liste.php @@ -16,12 +16,34 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ -require("./pre.inc.php"); +/** + \file htdocs/lib/datepicker.php + \brief Fichier de gestion de la popup de selection de date eldy + \version $Id$ +*/ + +require("../../master.inc.php"); + +function llxHeaderVierge($title, $head = "") +{ + global $user, $conf, $langs; + + print "\n"; + print "\n"; + print "".$title."\n"; + if ($head) print $head."\n"; + print "\n"; + print "\n"; +} + +function llxFooter() +{ + print "\n"; + print "\n"; +} + $langs->load("members"); @@ -40,7 +62,11 @@ $pageprev = $page - 1; $pagenext = $page + 1; -llxHeaderVierge(); +/* + * View + */ + +llxHeaderVierge("List of members"); $sql = "select rowid,prenom,nom, societe, cp,ville,email,naiss,photo";