diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index cfe8f9f4d1e..b867fe6c166 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -1408,6 +1408,31 @@ class Adherent return ''; } + + /** + * \brief Renvoie nom clicable (avec eventuellement le picto) + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + + $lien = ''; + $lienfin=''; + + $picto='user'; + $label=$langs->trans("ShowMember"); + + if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + $result.=$lien.$this->ref.$lienfin; + return $result; + } + + /** * \brief Retourne le libellé du statut d'un adhérent (brouillon, validé, résilié) * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto @@ -1419,11 +1444,13 @@ class Adherent } /** - * \brief Renvoi le libellé d'un statut donné - * \param statut id statut - * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto - * \return string Libellé - */ + * \brief Renvoi le libellé d'un statut donné + * \param statut Id statut + * \param need_subscription 1 si type adherent avec cotisation, 0 sinon + * \param date_end_subscription Date fin adhésion + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto + * \return string Libellé + */ function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0) { global $langs; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index aa645eba162..ba19d69ca72 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 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 @@ -183,6 +183,55 @@ print ""; print ''; +/* + * Dernières adherent + */ +$max=5; + +$sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,"; +$sql.= " ".$db->pdate("a.tms")." as datem, ".$db->pdate("datefin")." as date_end_subscription,"; +$sql.= " ta.cotisation"; +$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; +$sql.= " WHERE a.fk_adherent_type = ta.rowid"; +$sql.= " ORDER BY a.tms DESC"; +$sql.= $db->plimit($max, 0); + +$resql=$db->query($sql); +if ($resql) +{ + print ''; + print ''; + print ''; + + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ""; + $staticmember->id=$obj->rowid; + $staticmember->ref=trim($obj->prenom.' '.$obj->nom); + print ''; + print ''; + print ''; + print ''; + $i++; + } + } + print "
'.$langs->trans("LastMembers",$max).'
'.$staticmember->getNomUrl(1).''.dolibarr_print_date($obj->datem,'dayhour').''.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$obj->date_end_subscription,5).'

"; +} +else +{ + dolibarr_print_error($db); +} + + + +// Tableau résumé par an $Total=array(); $Number=array(); $tot=0; @@ -235,6 +284,11 @@ print "
\n"; print ''; print ''; + + + + + $db->close(); llxFooter('$Date$ - $Revision$'); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 382899a7428..573a7fdf836 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -90,4 +90,5 @@ FollowingLinksArePublic=Following links ares opened pages not protected by any D PublicMemberList=Public member list BlankSubscriptionForm=Subscription form MemberPublicLinks=Public links/pages -ExportDataset_member_1=Members and properties \ No newline at end of file +ExportDataset_member_1=Members and properties +LastMembers=Last %s members \ No newline at end of file diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 370599c963e..cb9e2b04579 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -91,3 +91,4 @@ PublicMemberList=Liste des membres publiques BlankSubscriptionForm=Formulaire inscription MemberPublicLinks=Liens/pages publiques ExportDataset_member_1=Adhérentes et attributs +LastMembers=Les %s derniers adhérents