export users of a group as csv file

This commit is contained in:
Uwe Steinmann 2020-09-23 11:39:19 +02:00
parent ad9afab6e0
commit df313d316c
4 changed files with 14 additions and 1 deletions

View File

@ -11,6 +11,7 @@
- new hooks SeedDMS_View_Document::[startRightColumn|extraVersionsViews|prePreviousVersionsTab|preLatestVersionTab]
- add expiration of documents in 3 years
- fix setting quota when importing users
- export csv file of users of a group
--------------------------------------------------------------------------------
Changes in version 5.1.19

View File

@ -26,8 +26,13 @@ class SeedDMS_Controller_UserListCsv extends SeedDMS_Controller_Common {
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
$group = $this->params['group'];
if($group) {
$allUsers = $group->getUsers();
} else {
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
}
$m = 0;
foreach($allUsers as $u) {
$m = max($m, count($u->getGroups()));

View File

@ -34,9 +34,15 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if(!empty($_GET['groupid'])) {
$group = $dms->getGroup((int) $_GET['groupid']);
} else {
$group = null;
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user));
$controller->setParam('group', $group);
if(!$controller->run()) {
if ($controller->getErrorMsg() != '')
$errormsg = $controller->getErrorMsg();

View File

@ -164,6 +164,7 @@ $(document).ready( function() {
<ul class="dropdown-menu">
<?php
echo '<li><a href="../out/out.RemoveGroup.php?groupid='.$selgroup->getID().'"><i class="fa fa-remove"></i> '.getMLText("rm_group").'</a><li>';
echo '<li><a href="../op/op.UserListCsv.php?groupid='.$selgroup->getID().'"><i class="fa fa-download"></i> '.getMLText("export_user_list_csv").'</a><li>';
?>
</ul>
</div>