Correction de la fiche publique d'edition fiche adherent

This commit is contained in:
Laurent Destailleur 2007-09-15 02:28:29 +00:00
parent a18a2d4844
commit 71ec3fb04e
6 changed files with 227 additions and 202 deletions

View File

@ -599,10 +599,10 @@ if ($action == 'edit')
print "<input type=\"hidden\" name=\"rowid\" value=\"$rowid\">"; print "<input type=\"hidden\" name=\"rowid\" value=\"$rowid\">";
print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">"; print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">";
print '<table class="border" width="100%">';
$htmls = new Form($db); $htmls = new Form($db);
print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$adh->id.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$adh->id.'&nbsp;</td></tr>';
@ -636,10 +636,10 @@ if ($action == 'edit')
print '</tr>'; print '</tr>';
// Login // Login
print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>'; print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="login" size="30" value="'.$adh->login.'"></td></tr>';
// Password // Password
print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="pass" size="40" value="'.$adh->pass.'"></td></tr>'; print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="pass" size="30" value="'.$adh->pass.'"></td></tr>';
// Type // Type
print '<tr><td>'.$langs->trans("Type").'*</td><td>'; print '<tr><td>'.$langs->trans("Type").'*</td><td>';
@ -703,6 +703,7 @@ if ($action == 'edit')
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
print '</div>'; print '</div>';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -28,9 +29,9 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
$adho = new AdherentOptions($db); $adho = new AdherentOptions($db);
$errmsg=''; $errmsg='';

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,18 +21,32 @@
* $Source$ * $Source$
*/ */
/**
\file htdocs/public/adherents/priv_edit.php
\ingroup adherent
\brief Page edition de sa fiche adherent
\version $Revision$
*/
require("./pre.inc.php"); require("./pre.inc.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
$adho = new AdherentOptions($db); $adho = new AdherentOptions($db);
$langs->load("companies");
$langs->load("main");
$langs->load("other");
$langs->load("users");
$errmsg=''; $errmsg='';
$num=0; $num=0;
$error=0; $error=0;
/* /*
* Enregistrer les modifs * Actions
*/ */
if ($action == 'update') if ($action == 'update')
@ -131,12 +146,10 @@ if ($action == 'update')
llxHeaderVierge(); llxHeaderVierge();
if (isset($user->login)) if (isset($_GET["id"]))
{ {
$adh = new Adherent($db); $adh = new Adherent($db);
$adh->login = $user->login; $result=$adh->fetch($_GET["id"]);
$adh->fetch_login($user->login);
$adh->fetch_optionals($adh->id); $adh->fetch_optionals($adh->id);
// fetch optionals attibutes // fetch optionals attibutes
$adho->fetch_optionals(); $adho->fetch_optionals();
@ -154,100 +167,109 @@ if (isset($user->login))
print '</table>'; print '</table>';
} }
print '<table class="border" width="100%">'; // Formulaire modifications
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adh->type.'</td>';
print '<td valign="top" width="50%">'.$langs->trans("Comments").'</td></tr>';
print '<tr><td>Personne</td><td class="valeur">'.$adh->morphy.'&nbsp;</td>';
print '<td rowspan="15" valign="top" width="50%">';
print nl2br($adh->commentaire).'&nbsp;</td></tr>';
print '<tr><td width="15%">Prénom</td><td class="valeur" width="35%">'.$adh->prenom.'&nbsp;</td></tr>';
print '<tr><td>Nom</td><td class="valeur">'.$adh->nom.'&nbsp;</td></tr>';
print '<tr><td>Société</td><td class="valeur">'.$adh->societe.'&nbsp;</td></tr>';
print '<tr><td>Adresse</td><td class="valeur">'.nl2br($adh->adresse).'&nbsp;</td></tr>';
print '<tr><td>CP Ville</td><td class="valeur">'.$adh->cp.' '.$adh->ville.'&nbsp;</td></tr>';
print '<tr><td>Pays</td><td class="valeur">'.$adh->pays.'&nbsp;</td></tr>';
print '<tr><td>Email</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>';
print '<tr><td>Login</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
print '<tr><td>Password</td><td class="valeur">'.$adh->pass.'&nbsp;</td></tr>';
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>';
print '<tr><td>URL Photo</td><td class="valeur">'.$adh->photo.'&nbsp;</td></tr>';
if ($adh->public==1){
print '<tr><td>Profil public ?</td><td> Oui </td></tr>';
}else{
print '<tr><td>Profil public ?</td><td> Non </td></tr>';
}
foreach($adho->attribute_label as $key=>$value){
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]."&nbsp;</td></tr>\n";
}
print "</table>\n";
print "<hr>";
print "<form action=\"priv_edit.php\" method=\"post\">";
print '<table class="border" width="100%">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">"; print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<input type=\"hidden\" name=\"rowid\" value=\"$adh->id\">"; print "<input type=\"hidden\" name=\"rowid\" value=\"$adh->id\">";
print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">"; print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">";
print "<input type=\"hidden\" name=\"login\" value=\"".$adh->login."\">"; print "<input type=\"hidden\" name=\"login\" value=\"".$adh->login."\">";
print "<input type=\"hidden\" name=\"type\" value=\"".$adh->typeid."\">";
print "<input type=\"hidden\" name=\"morphy\" value=\"".$adh->morphy."\">";
// print "<input type=\"hidden\" name=\"public\" value=\"".$adh->public."\">"; // print "<input type=\"hidden\" name=\"public\" value=\"".$adh->public."\">";
$htmls = new Form($db); $htmls = new Form($db);
$caneditfield=1;
print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Type").'</td><td>'; // Nom
$htmls->select_array("type", $adht->liste_array(), $adh->typeid); print '<tr><td>'.$langs->trans("Lastname").'*</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td>';
print "</td>";
print '<td valign="top" width="50%">'.$langs->trans("Comments").'</td></tr>'; // Photo
$rowspan=14;
$morphys["phy"] = "Physique"; $rowspan+=sizeof($adho->attribute_label);
$morphys["mor"] = "Morale"; print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg"))
print "<tr><td>Personne</td><td>"; {
$htmls->select_array("morphy", $morphys, $adh->morphy); print '<img width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=memberphoto&file='.$adh->id.'.jpg">';
print "</td>";
print '<td rowspan="15" valign="top">';
print '<textarea name="comment" wrap="soft" cols="40" rows="15">'.$adh->commentaire.'</textarea></td></tr>';
print '<tr><td width="15%">Prénom</td><td width="35%"><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td></tr>';
print '<tr><td>Nom</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td></tr>';
print '<tr><td>Societe</td><td><input type="text" name="societe" size="40" value="'.$adh->societe.'"></td></tr>';
print '<tr><td>Adresse</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$adh->adresse.'</textarea></td></tr>';
print '<tr><td>CP Ville</td><td><input type="text" name="cp" size="6" value="'.$adh->cp.'"> <input type="text" name="ville" size="20" value="'.$adh->ville.'"></td></tr>';
print '<tr><td>Pays</td><td><input type="text" name="pays" size="40" value="'.$adh->pays.'"></td></tr>';
print '<tr><td>Email</td><td><input type="text" name="email" size="40" value="'.$adh->email.'"></td></tr>';
print '<tr><td>Login</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
// print '<tr><td>Login</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>';
print '<tr><td>Password</td><td><input type="text" name="pass" size="40" value="'.$adh->pass.'"></td></tr>';
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="40" value="'.$adh->naiss.'"></td></tr>';
print '<tr><td>URL photo</td><td><input type="text" name="photo" size="40" value="'.$adh->photo.'"></td></tr>';
if ($adh->public==1){
print '<tr><td>Profil public ?</td><td><input type="checkbox" name="public" checked></td></tr>';
}else{
print '<tr><td>Profil public ?</td><td><input type="checkbox" name="public"></td></tr>';
} }
foreach($adho->attribute_label as $key=>$value){ else
{
print '<img src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
}
if ($caneditfield)
{
print '<br><br><table class="noborder"><tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
print '<tr><td>';
print '<input type="file" class="flat" name="photo">';
print '</td></tr></table>';
}
print '</td>';
print '</tr>';
// Prenom
print '<tr><td width="20%">'.$langs->trans("Firstname").'*</td><td width="35%"><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td>';
print '</tr>';
// Login
// print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="login" size="30" value="'.$adh->login.'"></td></tr>';
print '<tr><td>'.$langs->trans("Login").'*</td><td>'.$adh->login.'</td></tr>';
// Password
print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="pass" size="30" value="'.$adh->pass.'"></td></tr>';
// Société
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$adh->societe.'"></td></tr>';
// Adresse
print '<tr><td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="2">'.$adh->adresse.'</textarea></td></tr>';
// Cp
print '<tr><td>'.$langs->trans("Zip").'/'.$langs->trans("Town").'</td><td><input type="text" name="cp" size="6" value="'.$adh->cp.'"> <input type="text" name="ville" size="32" value="'.$adh->ville.'"></td></tr>';
// Pays
print '<tr><td>'.$langs->trans("Country").'</td><td>';
$htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays');
print '</td></tr>';
// Tel
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.$adh->phone.'"></td></tr>';
// Tel perso
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.$adh->phone_perso.'"></td></tr>';
// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.$adh->phone_mobile.'"></td></tr>';
// EMail
print '<tr><td>'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'</td><td><input type="text" name="email" size="40" value="'.$adh->email.'"></td></tr>';
// Date naissance
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$htmls->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update');
print "</td></tr>\n";
// Profil public
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
print $htmls->selectyesno("public",$adh->public,1);
print "</td></tr>\n";
// Attributs supplémentaires
foreach($adho->attribute_label as $key=>$value)
{
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n"; print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
} }
print '<tr><td colspan="2" align="center">';
print '<input type="submit" name="bouton" value="'.$langs->trans("Save").'">&nbsp;'; print '<tr><td colspan="3" align="center">';
print '<input type="submit" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
// print ' &nbsp; &nbsp; &nbsp; ';
// print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>'; print '</td></tr>';
print '</form>';
print '</table>'; print '</table>';
print '</form>';
} }
$db->close(); $db->close();

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,14 +19,14 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
require(DOL_DOCUMENT_ROOT."/paiement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
$adho = new AdherentOptions($db); $adho = new AdherentOptions($db);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by