Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2021-05-06 20:54:17 +02:00
commit faa47a9d2e

View File

@ -58,25 +58,30 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("substitute_user")); $this->contentHeading(getMLText("substitute_user"));
?> ?>
<input type="text" id="myInput" placeholder="<?= getMLText('type_to_filter'); ?>"> <input type="text" id="myInput" placeholder="<?= getMLText('type_to_filter'); ?>">
<table id="myTable" class="table table-condensed"> <table id="myTable" class="table table-condensed table-sm">
<thead> <thead>
<tr><th><?php printMLText('name'); ?></th><th><?php printMLText('email');?></th><th><?php printMLText('role'); ?></th><th><?php printMLText('groups'); ?></th><th></th></tr> <tr><th><?php printMLText('name'); ?></th><th><?php printMLText('role'); ?>/<?php printMLText('groups'); ?></th><th></th></tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach ($allUsers as $currUser) { foreach ($allUsers as $currUser) {
echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">"; echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
echo "<td>"; echo "<td>";
echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")<br />"; $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 />";
echo "<small>".htmlspecialchars($currUser->getComment())."</small>"; echo "<small>".htmlspecialchars($currUser->getComment())."</small>";
echo "</td>"; echo "</td>";
echo "<td>"; echo "<td>";
echo "<a href=\"mailto:".htmlspecialchars($currUser->getEmail())."\">".htmlspecialchars($currUser->getEmail())."</a><br />"; echo getMLText('role').": ";
echo "</td>";
echo "<td>";
echo htmlspecialchars($currUser->getRole()->getName()); echo htmlspecialchars($currUser->getRole()->getName());
echo "</td>"; echo "<br />";
echo "<td>";
$groups = $currUser->getGroups(); $groups = $currUser->getGroups();
if (count($groups) != 0) { if (count($groups) != 0) {
for ($j = 0; $j < count($groups); $j++) { for ($j = 0; $j < count($groups); $j++) {
@ -87,21 +92,9 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style {
} }
echo "</td>"; echo "</td>";
echo "<td>"; echo "<td>";
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;
}
echo "</td>";
echo "<td>"; echo "<td>";
if($currUser->getID() != $user->getID()) { if($currUser->getID() != $user->getID()) {
echo "<a class=\"btn btn-primary\" href=\"../op/op.SubstituteUser.php?userid=".((int) $currUser->getID())."&formtoken=".createFormKey('substituteuser')."\"><i class=\"fa fa-exchange\"></i> ".getMLText('substitute_user')."</a> "; 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> ";
} }
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";