show status of reception if document is owned by current user

This commit is contained in:
Uwe Steinmann 2017-01-17 18:31:44 +01:00
parent 14d2a7263b
commit 5e93bea2fd

View File

@ -2154,6 +2154,23 @@ $(document).ready( function() {
} else {
$content .= getOverallStatusText($status["status"]);
}
if($owner->getID() == $user->getID() && $receiptStatus = $latestContent->getReceiptStatus()) {
$rstat = array('-1'=>0, '0'=>0, '1'=>0, '-2'=>0);
$allcomments = array();
foreach ($receiptStatus as $r) {
$rstat[''.$r['status']]++;
if($r['comment'])
$allcomments[] = $r['comment'];
}
$totalreceipts = $rstat['-1'] + $rstat['0'] + $rstat['1'];
$content .= ";
<div class=\"progress\">
<div class=\"bar bar-success\" style=\"width: ".round($rstat['1']/$totalreceipts*100)."%;\">".($rstat['1'] ? $rstat['1']."/".$totalreceipts : '')."</div>
<div class=\"bar bar-danger\" style=\"width: ".round($rstat['-1']/$totalreceipts*100)."%;\">".($rstat['-1'] ? $rstat['-1']."/".$totalreceipts : '')."</div>
</div>";
if($allcomments)
$content .= implode('<br />', $allcomments);
}
$content .= "</small></td>";
// $content .= "<td>".$version."</td>";
$content .= "<td>";