diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index af68512ae57..11acc1914a1 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -203,7 +203,7 @@ $var=true; */ $max=5; -$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"; +$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,"; $sql.= " a.tms as datem, datefin as date_end_subscription,"; $sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; @@ -235,6 +235,7 @@ if ($resql) if (! empty($obj->fk_soc)) { $staticmember->socid = $obj->fk_soc; $staticmember->fetch_thirdparty(); + $staticmember->name=$staticmember->thirdparty->name; } else { $staticmember->name=$obj->company; } @@ -262,7 +263,7 @@ else */ $max=5; -$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"; +$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,"; $sql.= " datefin as date_end_subscription,"; $sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c"; @@ -293,9 +294,16 @@ if ($resql) $staticmember->id=$obj->rowid; $staticmember->lastname=$obj->lastname; $staticmember->firstname=$obj->firstname; + if (! empty($obj->fk_soc)) { + $staticmember->socid = $obj->fk_soc; + $staticmember->fetch_thirdparty(); + $staticmember->name=$staticmember->thirdparty->name; + } else { + $staticmember->name=$obj->company; + } $staticmember->ref=$staticmember->getFullName($langs); print ''.$subscriptionstatic->getNomUrl(1).''; - print ''.$staticmember->getNomUrl(1,24,'subscription').''; + print ''.$staticmember->getNomUrl(1,32,'subscription').''; print ''.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).''; print ''.price($obj->cotisation).''; //print ''.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; @@ -326,7 +334,7 @@ foreach ($AdherentType as $key => $adhtype) { $var=!$var; print ""; - print ''.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(32)).''; + print ''.$adhtype->getNomUrl(1, dol_size(32)).''; print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''; print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).''; print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index ca87562153a..4752a36a65a 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -84,7 +84,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe, "; +$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,"; $sql.= " d.datefin,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " t.libelle as type, t.cotisation"; @@ -238,7 +238,7 @@ if ($resql) print ''; $listetype=$membertypestatic->liste_array(); - print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 12); + print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 32); print ''; print ' '; @@ -268,6 +268,14 @@ if ($resql) $memberstatic->lastname=$objp->lastname; $memberstatic->firstname=$objp->firstname; + if (! empty($objp->fk_soc)) { + $memberstatic->socid = $objp->fk_soc; + $memberstatic->fetch_thirdparty(); + $companyname=$memberstatic->thirdparty->name; + } else { + $companyname=$objp->company; + } + $var=!$var; print ""; @@ -277,14 +285,11 @@ if ($resql) print "\n"; // Lastname - if ($objp->societe != '') - { - print "rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."\n"; - } - else - { - print "rowid\">".dol_trunc($memberstatic->getFullName($langs))."\n"; - } + print "rowid\">"; + print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); + print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); + print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); + print "\n"; // Login print "".$objp->login."\n"; @@ -293,7 +298,7 @@ if ($resql) $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print ''; - print $membertypestatic->getNomUrl(1,12); + print $membertypestatic->getNomUrl(1,32); print ''; // Moral/Physique diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 67e44abebbb..a37fdc15735 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -73,7 +73,8 @@ class box_members extends ModeleBoxes if ($user->rights->societe->lire) { - $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; + $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe, a.fk_soc,"; + $sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; $sql.= " t.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t"; $sql.= " WHERE a.entity = ".$conf->entity; @@ -97,6 +98,14 @@ class box_members extends ModeleBoxes $memberstatic->lastname=$objp->lastname; $memberstatic->firstname=$objp->firstname; + if (! empty($objp->fk_soc)) { + $memberstatic->socid = $objp->fk_soc; + $memberstatic->fetch_thirdparty(); + $memberstatic->name=$memberstatic->thirdparty->name; + } else { + $memberstatic->name=$objp->company; + } + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/adherents/fiche.php?rowid=".$objp->rowid);