fix layout of recipient list, add field to filter table rows

This commit is contained in:
Uwe Steinmann 2021-04-30 09:25:11 +02:00
parent fb44b524fd
commit 4d471ed592

View File

@ -168,6 +168,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
header('Content-Type: application/javascript; charset=UTF-8'); header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder')); parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
?>
$(document).ready(function(){
$("#filterRecipientsInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#filterRecipientsTable tbody tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
<?php
if($user->isAdmin()) { if($user->isAdmin()) {
$latestContent = $this->callHook('documentLatestContent', $document); $latestContent = $this->callHook('documentLatestContent', $document);
if($latestContent === null) if($latestContent === null)
@ -1307,15 +1317,22 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
if(is_string($txt)) if(is_string($txt))
echo $txt; echo $txt;
print "<table class=\"table table-condensed\">\n"; if(count($receiptStatus) > 8) {
echo '<input type="text" id="filterRecipientsInput" placeholder="'.getMLText('type_to_filter').'">';
}
print "<table id=\"filterRecipientsTable\" class=\"table table-condensed table-sm\">\n";
print "<thead>\n";
print "<tr>\n"; print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n"; print "<th width='20%'>".(($count($receiptStatus) > 5) ? '<input type="text" id="filterRecipientsInput" placeholder="'.getMLText('type_to_filter').'">' : getMLText('name'))."</th>\n";
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n"; print "<th width='20%'>".getMLText("last_update")."</th>\n";
print "<td width='25%'><b>".getMLText("comment")."</b></td>"; print "<th width='25%'>".getMLText("comment")."</th>";
print "<td width='15%'><b>".getMLText("status")."</b></td>\n"; print "<th width='15%'>".getMLText("status")."</th>\n";
print "<td width='20%'></td>\n"; print "<th width='20%'></th>\n";
print "</tr>\n"; print "</tr>\n";
print "</thead>\n";
print "<tbody>\n";
$stat = array('-1'=>0, '0'=>0, '1'=>0, '-2'=>0); $stat = array('-1'=>0, '0'=>0, '1'=>0, '-2'=>0);
foreach ($receiptStatus as $r) { foreach ($receiptStatus as $r) {
@ -1372,11 +1389,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
} }
print "<tr>\n"; print "<tr>\n";
print "<td>".$reqName."</td>\n"; print "<td>".$reqName."</td>\n";
print "<td><ul class=\"actions unstyled\"><li>".getLongReadableDate($r["date"])."</li>"; print "<td>".getLongReadableDate($r["date"])."<br />";
/* $updateUser is the user who has done the receipt */ /* $updateUser is the user who has done the receipt */
$updateUser = $dms->getUser($r["userID"]); $updateUser = $dms->getUser($r["userID"]);
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$r["userID"]."'")."</li>"; print (is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$r["userID"]."'");
print "</ul></td>"; print "</td>";
print "<td>".htmlspecialchars($r["comment"])."</td>\n"; print "<td>".htmlspecialchars($r["comment"])."</td>\n";
print "<td>"; print "<td>";
if($class) if($class)
@ -1400,6 +1417,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
} }
} }
?> ?>
<tbody>
</table> </table>
<?php <?php
// $this->contentContainerEnd(); // $this->contentContainerEnd();
@ -1410,9 +1428,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<div class="progress"> <div class="progress">
<div class="bar bar-success" style="width: <?php echo round($stat['1']/$totalreceipts*100); ?>%;"><?php echo ($stat['1'] ? $stat['1']."/".$totalreceipts : ''); ?></div> <div class="progress-bar bar bar-success bg-success" style="width: <?php echo round($stat['1']/$totalreceipts*100); ?>%;"><?php echo ($stat['1'] ? $stat['1']."/".$totalreceipts : ''); ?></div>
<!-- div class="bar bar-warning" style="width: <?php echo round($stat['0']/$totalreceipts*100); ?>%;"></div --> <!-- div class="bar bar-warning" style="width: <?php echo round($stat['0']/$totalreceipts*100); ?>%;"></div -->
<div class="bar bar-danger" style="width: <?php echo round($stat['-1']/$totalreceipts*100); ?>%;"><?php echo ($stat['-1'] ? $stat['-1']."/".$totalreceipts : ''); ?></div> <div class="progress-bar bar bar-danger bg-danger" style="width: <?php echo round($stat['-1']/$totalreceipts*100); ?>%;"><?php echo ($stat['-1'] ? $stat['-1']."/".$totalreceipts : ''); ?></div>
</div> </div>
</div> </div>
</div> </div>
@ -1449,7 +1467,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
<?php <?php
} */ } */
// $this->contentContainerStart(); // $this->contentContainerStart();
print "<table class=\"table table-condensed\">\n"; print "<table class=\"table table-condensed table-sm\">\n";
print "<tr>\n"; print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n"; print "<td width='20%'><b>".getMLText("name")."</b></td>\n";