New: Ajout liste des n derniers adhérents sur page accueil espace adhérents
This commit is contained in:
parent
99b5b6388d
commit
6067423b1f
@ -1408,6 +1408,31 @@ class Adherent
|
|||||||
return '';
|
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é)
|
* \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
|
* \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é
|
* \brief Renvoi le libellé d'un statut donné
|
||||||
* \param statut id statut
|
* \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
|
* \param need_subscription 1 si type adherent avec cotisation, 0 sinon
|
||||||
* \return string Libellé
|
* \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)
|
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.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
|
* 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
|
||||||
@ -183,6 +183,55 @@ print "</table></form>";
|
|||||||
|
|
||||||
print '</td><td class="notopnoleftnoright" valign="top">';
|
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();
|
$Total=array();
|
||||||
$Number=array();
|
$Number=array();
|
||||||
$tot=0;
|
$tot=0;
|
||||||
@ -235,6 +284,11 @@ print "</table><br>\n";
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|||||||
@ -90,4 +90,5 @@ FollowingLinksArePublic=Following links ares opened pages not protected by any D
|
|||||||
PublicMemberList=Public member list
|
PublicMemberList=Public member list
|
||||||
BlankSubscriptionForm=Subscription form
|
BlankSubscriptionForm=Subscription form
|
||||||
MemberPublicLinks=Public links/pages
|
MemberPublicLinks=Public links/pages
|
||||||
ExportDataset_member_1=Members and properties
|
ExportDataset_member_1=Members and properties
|
||||||
|
LastMembers=Last %s members
|
||||||
@ -91,3 +91,4 @@ PublicMemberList=Liste des membres publiques
|
|||||||
BlankSubscriptionForm=Formulaire inscription
|
BlankSubscriptionForm=Formulaire inscription
|
||||||
MemberPublicLinks=Liens/pages publiques
|
MemberPublicLinks=Liens/pages publiques
|
||||||
ExportDataset_member_1=Adhérentes et attributs
|
ExportDataset_member_1=Adhérentes et attributs
|
||||||
|
LastMembers=Les %s derniers adhérents
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user