diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index c1a6769216b..591efd295ce 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1025,7 +1025,7 @@ class Adherent extends CommonObject
$sql = "SELECT d.rowid, d.civilite, d.prenom as firstname, d.nom as lastname, d.societe, d.fk_soc, d.statut, d.public, d.adresse as address, d.cp as zip, d.ville as town, d.note,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
- $sql.= " d.photo, d.fk_adherent_type, d.morphy,";
+ $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
$sql.= " d.tms as datem,";
$sql.= " d.datefin as datefin,";
@@ -1057,63 +1057,66 @@ class Adherent extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $this->ref = $obj->rowid;
- $this->id = $obj->rowid;
- $this->civilite_id = $obj->civilite;
- $this->prenom = $obj->firstname; // deprecated
- $this->firstname = $obj->firstname;
- $this->nom = $obj->lastname; // deprecated
- $this->lastname = $obj->lastname;
- $this->login = $obj->login;
- $this->pass = $obj->pass;
- $this->societe = $obj->societe;
- $this->fk_soc = $obj->fk_soc;
- $this->adresse = $obj->address; // deprecated
- $this->address = $obj->address;
- $this->cp = $obj->zip; // deprecated
- $this->zip = $obj->zip;
- $this->ville = $obj->town; // deprecated
- $this->town = $obj->town;
+ $this->entity = $obj->entity;
+ $this->ref = $obj->rowid;
+ $this->id = $obj->rowid;
+ $this->civilite_id = $obj->civilite;
+ $this->prenom = $obj->firstname; // deprecated
+ $this->firstname = $obj->firstname;
+ $this->nom = $obj->lastname; // deprecated
+ $this->lastname = $obj->lastname;
+ $this->login = $obj->login;
+ $this->pass = $obj->pass;
+ $this->societe = $obj->societe;
+ $this->fk_soc = $obj->fk_soc;
+ $this->adresse = $obj->address; // deprecated
+ $this->address = $obj->address;
+ $this->cp = $obj->zip; // deprecated
+ $this->zip = $obj->zip;
+ $this->ville = $obj->town; // deprecated
+ $this->town = $obj->town;
- $this->state_id = $obj->fk_departement;
- $this->state_code = $obj->fk_departement?$obj->state_code:'';
- $this->state = $obj->fk_departement?$obj->state:'';
- $this->fk_departement = $obj->fk_departement; // deprecated
- $this->departement_code = $obj->fk_departement?$obj->state_code:''; // deprecated
- $this->departement = $obj->fk_departement?$obj->state:''; // deprecated
+ $this->state_id = $obj->fk_departement;
+ $this->state_code = $obj->fk_departement?$obj->state_code:'';
+ $this->state = $obj->fk_departement?$obj->state:'';
+ $this->fk_departement = $obj->fk_departement; // deprecated
+ $this->departement_code = $obj->fk_departement?$obj->state_code:''; // deprecated
+ $this->departement = $obj->fk_departement?$obj->state:''; // deprecated
- $this->country_id = $obj->country_id;
- $this->country_code = $obj->country_code;
- if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
- else $this->country=$obj->country;
- $this->pays_id = $obj->country_id; // deprecated
- $this->pays_code = $obj->country_code; // deprecated
- $this->pays = $this->country; // deprecated
+ $this->country_id = $obj->country_id;
+ $this->country_code = $obj->country_code;
+ if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code)
+ $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
+ else
+ $this->country=$obj->country;
+ $this->pays_id = $obj->country_id; // deprecated
+ $this->pays_code = $obj->country_code; // deprecated
+ $this->pays = $this->country; // deprecated
- $this->phone = $obj->phone;
- $this->phone_perso = $obj->phone_perso;
- $this->phone_mobile = $obj->phone_mobile;
- $this->email = $obj->email;
+ $this->phone = $obj->phone;
+ $this->phone_perso = $obj->phone_perso;
+ $this->phone_mobile = $obj->phone_mobile;
+ $this->email = $obj->email;
- $this->photo = $obj->photo;
- $this->statut = $obj->statut;
- $this->public = $obj->public;
+ $this->photo = $obj->photo;
+ $this->statut = $obj->statut;
+ $this->public = $obj->public;
- $this->datec = $this->db->jdate($obj->datec);
- $this->datem = $this->db->jdate($obj->datem);
- $this->datefin = $this->db->jdate($obj->datefin);
- $this->datevalid = $this->db->jdate($obj->datev);
- $this->naiss = $this->db->jdate($obj->datenaiss);
+ $this->datec = $this->db->jdate($obj->datec);
+ $this->datem = $this->db->jdate($obj->datem);
+ $this->datefin = $this->db->jdate($obj->datefin);
+ $this->datevalid = $this->db->jdate($obj->datev);
+ $this->naiss = $this->db->jdate($obj->datenaiss);
- $this->note = $obj->note;
- $this->morphy = $obj->morphy;
+ $this->note = $obj->note;
+ $this->morphy = $obj->morphy;
- $this->typeid = $obj->fk_adherent_type;
- $this->type = $obj->type;
+ $this->typeid = $obj->fk_adherent_type;
+ $this->type = $obj->type;
$this->need_subscription = ($obj->cotisation=='yes'?1:0);
- $this->user_id = $obj->user_id;
- $this->user_login = $obj->user_login;
+ $this->user_id = $obj->user_id;
+ $this->user_login = $obj->user_login;
// Load other properties
$result=$this->fetch_subscriptions();
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 9d71b10a20b..32fd57ec3c5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3908,26 +3908,29 @@ class Form
{
global $conf;
+ $entity = (! empty($object->entity) ? $object->entity : $conf->entity);
+ $id = (! empty($object->id) ? $object->id : $object->rowid);
+
$ret='';$dir='';$file='';$altfile='';$email='';
if ($modulepart=='societe')
{
- $dir=$conf->societe->multidir_output[$object->entity];
+ $dir=$conf->societe->multidir_output[$entity];
$smallfile=$object->logo;
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
- if ($object->logo) $file=$object->id.'/logos/thumbs/'.$smallfile;
+ if ($object->logo) $file=$id.'/logos/thumbs/'.$smallfile;
}
else if ($modulepart=='userphoto')
{
$dir=$conf->user->dir_output;
- if ($object->photo) $file=get_exdir($object->id,2).$object->photo;
+ if ($object->photo) $file=get_exdir($id, 2).$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}
else if ($modulepart=='memberphoto')
{
$dir=$conf->adherent->dir_output;
- if ($object->photo) $file=get_exdir($object->id,2).'photos/'.$object->photo;
+ if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}
@@ -3938,14 +3941,14 @@ class Form
if ($file && file_exists($dir."/".$file))
{
// TODO Link to large image
- $ret.='';
- $ret.='
';
+ $ret.='';
+ $ret.='
';
$ret.='';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
- $ret.='';
- $ret.='
';
+ $ret.='';
+ $ret.='
';
$ret.='';
}
else
diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php
index d9b6c1c58d3..14f7d06db12 100644
--- a/htdocs/public/members/public_card.php
+++ b/htdocs/public/members/public_card.php
@@ -72,7 +72,7 @@ llxHeaderVierge($langs->trans("MemberCard"));
$extralabels=$extrafields->fetch_name_optionals_label('member');
if ($id > 0)
{
- $res=$object->fetch($id,$ref);
+ $res=$object->fetch($id);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
@@ -87,27 +87,22 @@ if ($id > 0)
print '
';
print '| '.$langs->trans("Type").' | '.$object->type." |
\n";
-
print '| '.$langs->trans("Person").' | '.$object->morphy.' |
';
-
print '| '.$langs->trans("Firstname").' | '.$object->firstname.' |
';
-
print '| '.$langs->trans("Lastname").' | '.$object->lastname.' |
';
-
print '| '.$langs->trans("Company").' | '.$object->societe.' |
';
-
print '| '.$langs->trans("Address").' | '.nl2br($object->address).' |
';
-
print '| '.$langs->trans("Zip").' '.$langs->trans("Town").' | '.$object->zip.' '.$object->town.' |
';
-
print '| '.$langs->trans("Country").' | '.$object->pays.' |
';
-
print '| '.$langs->trans("EMail").' | '.$object->email.' |
';
-
print '| '.$langs->trans("Birthday").' | '.$object->naiss.' |
';
- if (isset($object->photo) && $object->photo !=''){
- print '| URL Photo | '."photo\"> photo\">".' |
';
+ if (isset($object->photo) && $object->photo !='')
+ {
+ $form = new Form($db);
+ print '| URL Photo | ';
+ print $form->showphoto('memberphoto', $object, 64);
+ print ' |
'."\n";
}
// foreach($objecto->attribute_label as $key=>$value){
// print "| $value | ".$object->array_options["options_$key"]." |
\n";
diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php
index 7cfe37c5067..0cef6387de8 100644
--- a/htdocs/public/members/public_list.php
+++ b/htdocs/public/members/public_list.php
@@ -67,10 +67,10 @@ function llxHeaderVierge($title, $head = "")
}
/**
-* Show footer for member list
-*
-* @return void
-*/
+ * Show footer for member list
+ *
+ * @return void
+ */
function llxFooterVierge()
{
printCommonFooter('public');
@@ -88,8 +88,8 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-$filter=$_GET["filter"];
-$statut=isset($_GET["statut"])?$_GET["statut"]:'';
+$filter=GETPOST('filter');
+$statut=GETPOST('statut');
if (! $sortorder) { $sortorder="ASC"; }
if (! $sortfield) { $sortfield="nom"; }
@@ -101,8 +101,7 @@ if (! $sortfield) { $sortfield="nom"; }
llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"));
-
-$sql = "SELECT rowid, prenom, nom, societe, cp, ville, email, naiss, photo";
+$sql = "SELECT rowid, prenom, nom, societe, cp as zip, ville as town, email, naiss, photo";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent";
$sql.= " WHERE entity = ".$entity;
$sql.= " AND statut = 1";
@@ -122,12 +121,14 @@ if ($result)
$param="&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
print_barre_liste($langs->trans("ListOfValidatedPublicMembers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, 0, '');
- print "";
+ print '';
print '';
- print "| ".$langs->trans("Firstname")." ".$langs->trans("Lastname")." / ".$langs->trans("Company")." | \n";
- print_liste_field_titre($langs->trans("DateToBirth"),"public_list.php","naiss","",$param,$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("EMail"),"public_list.php","email","",$param,$sortfield,$sortorder);
+ print ''.$langs->trans("Firstname").'';
+ print ' '.$langs->trans("Lastname").'';
+ print ' / '.$langs->trans("Company").' | '."\n";
+ //print_liste_field_titre($langs->trans("DateToBirth"),"public_list.php","naiss",'',$param,$sortfield,$sortorder); // est-ce nécessaire ??
+ print_liste_field_titre($langs->trans("EMail"),"public_list.php","email",'',$param,$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Zip"),"public_list.php","cp","",$param,$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Town"),"public_list.php","ville","",$param,$sortfield,$sortorder);
print "".$langs->trans("Photo")." | \n";
@@ -139,14 +140,17 @@ if ($result)
$objp = $db->fetch_object($result);
$var=!$var;
print "
";
- print "| rowid\">".$objp->prenom." ".$objp->nom.($objp->societe?" / ".$objp->societe:"")." | \n";
- print "$objp->naiss | \n";
- print "$objp->email | \n";
- print "$objp->cp | \n";
- print "$objp->ville | \n";
- if (isset($objp->photo) && $objp->photo!= '')
+ print ''.$objp->prenom.' '.$objp->nom.($objp->societe?' / '.$objp->societe:'').' | '."\n";
+ //print "$objp->naiss | \n"; // est-ce nécessaire ??
+ print ''.$objp->email.' | '."\n";
+ print ''.$objp->zip.' | '."\n";
+ print ''.$objp->town.' | '."\n";
+ if (isset($objp->photo) && $objp->photo != '')
{
- print "photo\"> photo\" height=\"64\" width=\"64\"> | \n";
+ $form = new Form($db);
+ print '';
+ print $form->showphoto('memberphoto', $objp, 64);
+ print ' | '."\n";
}
else
{