show progress of receptions also to owner of document, show numbers

This commit is contained in:
Uwe Steinmann 2017-07-31 15:12:12 +02:00
parent 3074e2f530
commit b0dfeca98b

View File

@ -1265,16 +1265,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</table>
<?php
$this->contentContainerEnd();
if($user->isAdmin()) {
if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) {
/* Do not count entries '-2' as they are removed userѕ */
$totalreceipts = $stat['-1'] + $stat['0'] + $stat['1'];
?>
<div class="row-fluid">
<div class="span12">
<div class="progress">
<div class="bar bar-success" style="width: <?php echo round($stat['1']/$totalreceipts*100); ?>%;"></div>
<div class="bar bar-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-danger" style="width: <?php echo round($stat['-1']/$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>
</div>
</div>