New: Ajout liste des n derniers adhrents sur page accueil espace adhrents

This commit is contained in:
Laurent Destailleur 2006-11-19 17:52:51 +00:00
parent 99b5b6388d
commit 6067423b1f
4 changed files with 90 additions and 7 deletions

View File

@ -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 = '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$this->id.'">';
$lienfin='</a>';
$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;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "</table></form>";
print '</td><td class="notopnoleftnoright" valign="top">';
/*
* 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 '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("LastMembers",$max).'</td></tr>';
$num = $db->num_rows($resql);
if ($num)
{
$i = 0;
$var = True;
while ($i < $num)
{
$var=!$var;
$obj = $db->fetch_object($resql);
print "<tr $bc[$var]>";
$staticmember->id=$obj->rowid;
$staticmember->ref=trim($obj->prenom.' '.$obj->nom);
print '<td>'.$staticmember->getNomUrl(1).'</td>';
print '<td>'.dolibarr_print_date($obj->datem,'dayhour').'</td>';
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$obj->date_end_subscription,5).'</td>';
print '</tr>';
$i++;
}
}
print "</table><br>";
}
else
{
dolibarr_print_error($db);
}
// Tableau résumé par an
$Total=array();
$Number=array();
$tot=0;
@ -235,6 +284,11 @@ print "</table><br>\n";
print '</td></tr>';
print '</table>';
$db->close();
llxFooter('$Date$ - $Revision$');

View File

@ -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
ExportDataset_member_1=Members and properties
LastMembers=Last %s members

View File

@ -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