2013-04-19 07:00:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of SubstituteUser view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2013-04-19 07:00:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for SubstituteUser view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style {
|
2013-04-19 07:00:34 +00:00
|
|
|
|
2016-01-27 16:33:40 +00:00
|
|
|
function js() { /* {{{ */
|
2021-03-10 14:58:22 +00:00
|
|
|
header('Content-Type: application/javascript; charset=UTF-8');
|
2019-02-22 16:26:32 +00:00
|
|
|
?>
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#myInput").on("keyup", function() {
|
|
|
|
var value = $(this).val().toLowerCase();
|
|
|
|
$("#myTable tbody tr").filter(function() {
|
|
|
|
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
<?php
|
2016-01-27 16:33:40 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
2013-04-19 07:00:34 +00:00
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$allUsers = $this->params['allusers'];
|
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("substitute_user"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
|
|
|
|
|
|
|
$this->contentHeading(getMLText("substitute_user"));
|
|
|
|
?>
|
2019-02-22 16:26:32 +00:00
|
|
|
<input type="text" id="myInput">
|
2021-05-06 13:18:01 +00:00
|
|
|
<table id="myTable" class="table table-condensed table-sm">
|
2016-05-18 07:20:05 +00:00
|
|
|
<thead>
|
2021-05-06 18:51:13 +00:00
|
|
|
<tr><th><?php printMLText('name'); ?></th><th><?php printMLText('role'); ?>/<?php printMLText('groups'); ?></th><th></th></tr>
|
2016-05-18 07:20:05 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2013-04-19 07:00:34 +00:00
|
|
|
<?php
|
|
|
|
foreach ($allUsers as $currUser) {
|
2017-07-20 13:07:52 +00:00
|
|
|
echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
|
2013-04-19 07:00:34 +00:00
|
|
|
echo "<td>";
|
2021-05-06 18:51:13 +00:00
|
|
|
$hasemail = $currUser->getEmail() && (preg_match("/.+@.+/", $currUser->getEmail()) == 1);
|
|
|
|
if($hasemail)
|
|
|
|
echo "<a href=\"mailto:".$currUser->getEmail()."\">";
|
|
|
|
echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")";
|
|
|
|
if($hasemail)
|
|
|
|
echo "</a>";
|
|
|
|
echo "<br />";
|
|
|
|
if($hasemail)
|
|
|
|
echo "<small>".htmlspecialchars($currUser->getEmail())."</small><br />";
|
2016-01-27 05:48:39 +00:00
|
|
|
echo "<small>".htmlspecialchars($currUser->getComment())."</small>";
|
2013-04-19 07:00:34 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
2021-05-06 18:51:13 +00:00
|
|
|
echo getMLText('role').": ";
|
2017-05-02 15:17:52 +00:00
|
|
|
switch($currUser->getRole()) {
|
|
|
|
case SeedDMS_Core_User::role_user:
|
|
|
|
printMLText("role_user");
|
|
|
|
break;
|
|
|
|
case SeedDMS_Core_User::role_admin:
|
|
|
|
printMLText("role_admin");
|
|
|
|
break;
|
|
|
|
case SeedDMS_Core_User::role_guest:
|
|
|
|
printMLText("role_guest");
|
|
|
|
break;
|
|
|
|
}
|
2021-05-06 18:51:13 +00:00
|
|
|
echo "<br />";
|
|
|
|
$groups = $currUser->getGroups();
|
|
|
|
if (count($groups) != 0) {
|
|
|
|
for ($j = 0; $j < count($groups); $j++) {
|
|
|
|
print htmlspecialchars($groups[$j]->getName());
|
|
|
|
if ($j +1 < count($groups))
|
|
|
|
print ", ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
2017-05-02 15:17:52 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
2013-04-19 07:00:34 +00:00
|
|
|
if($currUser->getID() != $user->getID()) {
|
2021-05-06 18:51:13 +00:00
|
|
|
echo "<a class=\"btn btn-primary btn-mini btn-sm text-nowrap\" href=\"../op/op.SubstituteUser.php?userid=".((int) $currUser->getID())."&formtoken=".createFormKey('substituteuser')."\"><i class=\"fa fa-exchange\"></i><span class=\"d-none d-md-inline\"> ".getMLText('substitute_user')."</span></a> ";
|
2013-04-19 07:00:34 +00:00
|
|
|
}
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
2016-05-18 07:20:05 +00:00
|
|
|
echo "</tbody>";
|
2013-04-19 07:00:34 +00:00
|
|
|
echo "</table>";
|
|
|
|
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2013-04-19 07:00:34 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|