diff --git a/htdocs/adherents/edit.php b/htdocs/adherents/edit.php deleted file mode 100644 index 75562ad6236..00000000000 --- a/htdocs/adherents/edit.php +++ /dev/null @@ -1,206 +0,0 @@ - - * Copyright (C) 2002 Jean-Louis Bergamo - * Copyright (C) 2004-2005 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/adherents/edit.php - \ingroup adherent - \brief Page d'edition d'un adherent - \version $Revision$ -*/ - -require("./pre.inc.php"); -require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); -require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); -require(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); - -$langs->load("members"); - - -$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; -$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; - -/* - * Enregistrer les modifs - */ - -if ($action == 'update') -{ - - if ($_POST["bouton"] == $langs->trans("Save")) - { - - $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 = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); - $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) ) - { - Header("Location: fiche.php?rowid=$adh->id&action=edit"); - } - else - { - Header("Location: edit.php?rowid=$adh->id"); - } - - } - else - { - Header("Location: fiche.php?rowid=$rowid&action=edit"); - } -} - - -llxHeader(); - - -if ($rowid) -{ - - $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(); - - $sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber"; - $sql .= " FROM societe as s, ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp"; - $sql .= " AND f.rowid = $facid"; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - if ($num) { - $obj = $db->fetch_object($result); - - $total = $obj->total; - } - } - - $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 ""; - - print ''; - - print ''; - - print ''; - - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - // $myattr=$adho->fetch_name_optionals(); - foreach($adho->attribute_label as $key=>$value){ - // foreach($myattr as $key){ - 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_id?$adh->pays_id:MAIN_INFO_SOCIETE_PAYS,'pays'); - print '
'.$langs->trans("EMail").'
'.$langs->trans("Login").'
'.$langs->trans("Password").'
'.$langs->trans("Birthday").' ('.$langs->trans("DateFormatYYYYMMDD").')
URL photo
$valuearray_options["options_$key"]."\">
'; - print ' '; - print ''; - print '
'; - print '
'; - - print ''; -} - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 4d9e89bafca..2413fc7b147 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -87,11 +87,12 @@ if ($result) $i = 0; $titre=$langs->trans("MembersList"); - if (isset($_GET["statut"])) { + if (isset($_GET["statut"])) + { if ($statut == '-1,1') { $titre=$langs->trans("MembersListQualified"); } - if ($statut == '-1') { $titre=$langs->trans("MembersListToValid"); } - if ($statut == '1') { $titre=$langs->trans("MembersListValid"); } - if ($statut == '0') { $titre=$langs->trans("MembersListResiliated"); } + if ($statut == '-1') { $titre=$langs->trans("MembersListToValid"); } + if ($statut == '1') { $titre=$langs->trans("MembersListValid"); } + if ($statut == '0') { $titre=$langs->trans("MembersListResiliated"); } } elseif ($_POST["action"] == 'search') { $titre=$langs->trans("MembersListQualified"); @@ -106,13 +107,14 @@ if ($result) print ""; + $param="&page=$page".(isset($_GET["statut"])?"&statut=$statut":""); print ''; - print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","t.cotisation","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut","&page=$page&statut=$statut","","",$sortfield); + print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","t.cotisation",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut",$param,"","",$sortfield); print "\n"; print "\n"; @@ -129,9 +131,9 @@ if ($result) $var=!$var; print ""; if ($objp->societe != ''){ - print "\n"; + print "\n"; }else{ - print "\n"; + print "\n"; } print "
".$langs->trans("Action")."
rowid&action=edit\">".img_object($langs->trans("ShowAdherent"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid\">".img_object($langs->trans("ShowAdherent"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid&action=edit\">".img_object($langs->trans("ShowAdherent"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)."rowid\">".img_object($langs->trans("ShowAdherent"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom).""; if ($objp->cotisation == 'yes')