}
}
-/** Simple set based on an array of User objects
+/** Simple set based on an array of User emails
*/
-class ArraySet extends ProfileSet
+class UserArraySet extends UserSet
{
- public function __construct(array $users)
+ public function __construct(array $emails)
{
- $hruids = User::getBulkHruid($users, array('User', '_silent_user_callback'));
- if (is_null($hruids) || count($hruids) == 0) {
- $cond = new PFC_False();
- } else {
- $cond = new UFC_Hruid($hruids);
- }
- parent::__construct($cond);
+ parent::__construct(new UFC_Email($emails));
}
}
+/** Simple set based on an array of Profile emails
+ */
+class ProfileArraySet extends ProfileSet
+{
+ public function __construct(array $emails)
+ {
+ parent::__construct(new UFC_Email($emails));
+ }
+}
+
+
/** A multipage view for profiles
* Allows the display of bounds when sorting by name or promo.
*/
}
}
-class XnetFicheView extends UserView
+class GroupMemberView extends UserView
{
public function __construct(PlSet $set, array $params)
{
public function templateName()
{
- return 'include/plview.xnetuser.tpl';
+ return 'include/plview.groupmember.tpl';
+ }
+}
+
+class ListMemberView extends UserView
+{
+ public function __construct(PlSet $set, array $params)
+ {
+ $this->entriesPerPage = 100;
+ $this->addSort(new PlViewOrder('name', array(new UFO_Name(Profile::DN_SORT)), 'nom'));
+ $this->addSort(new PlViewOrder('promo', array(
+ new UFO_Promo(UserFilter::DISPLAY, true),
+ new UFO_Name(Profile::DN_SORT),
+ ), 'promotion'));
+ parent::__construct($set, $params);
+ }
+
+ public function templateName()
+ {
+ return 'include/plview.listmember.tpl';
}
}
{assign var=lostUsers value=false}
{foreach from=$set item=user}
{if $user->lost}{assign var=lostUsers value=true}{/if}
- {include file="include/plview.xnetuser.entry.tpl" user=$user}
+ {include file="include/plview.groupmember.entry.tpl" user=$user}
{/foreach}
</table>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* 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 *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+
+<table summary="abonnés à la liste" class="bicol" cellpadding="0" cellspacing="0">
+ {if $details.own || hasPerms('admin,groupadmin')}
+ <tr><td colspan="2">
+ <a href="{$platal->ns}lists/csv/{$platal->argv[1]}/{$platal->argv[1]}.csv">
+ {icon name="page_excel" title="Télécharger la liste des membres"}
+ Télécharger la liste des membres au format Excel
+ </a>
+ </td></tr>
+ {/if}
+
+ {assign var=current_key value=''}
+ {foreach from=$set item=user}
+ <tr>
+ <td class="titre" style="width: 20%">
+ {if $order eq 'promo'}
+ {assign var=user_key value=$user->promo()}
+ {elseif $order eq 'name'}
+ {assign var=user_key value=$user->lastName()|string_format:'%.1s'|upper}
+ {else}
+ {assign var=user_key value=''}
+ {/if}
+ {if $user_key neq $current_key}
+ {assign var=current_key value=$user_key}
+ {$user_key}
+ {/if}
+ </td>
+ <td>
+ {if $user->hasProfile()}
+ {if $user->lost}{assign var=lostUsers value=true}{/if}
+ {profile user=$user}
+ {else}
+ {$user->displayName()}
+ {/if}
+ </td>
+ {if t($delete)}
+ <td class="center">
+ {if t($user.uid)}
+ <a href="{$platal->ns}member/{$user.uid}">{icon name=user_edit title='Éditer'}</a>
+ {else}
+ {icon name=null}
+ {/if}
+ <a href='{$platal->pl_self(1)}?{$delete}={$user.email}&token={xsrf_token}'>{icon name=cross title='Retirer'}</a>
+ </td>
+ {/if}
+ </tr>
+ {/foreach}
+</table>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}