show comments of reception seperated by decline/aknowledge

This commit is contained in:
Uwe Steinmann 2017-01-18 08:45:27 +01:00
parent f3b5af1c43
commit e6e14fb37a

View File

@ -2156,20 +2156,18 @@ $(document).ready( function() {
}
if($owner->getID() == $user->getID() && $receiptStatus = $latestContent->getReceiptStatus()) {
$rstat = array('-1'=>0, '0'=>0, '1'=>0, '-2'=>0);
$allcomments = array();
$allcomments = array('-1'=>array(), '1'=>array());
foreach ($receiptStatus as $r) {
$rstat[''.$r['status']]++;
if($r['comment'])
$allcomments[] = $r['comment'];
$allcomments[''.$r['status']][] = htmlspecialchars($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 class=\"bar bar-success\" style=\"width: ".round($rstat['1']/$totalreceipts*100)."%;\">".($rstat['1'] ? $rstat['1']."/".$totalreceipts : '').($allcomments['1'] ? " ".$this->printPopupBox('<i class="icon-comment"></i>', implode('<br />', $allcomments['1']), true) : "")."</div>
<div class=\"bar bar-danger\" style=\"width: ".round($rstat['-1']/$totalreceipts*100)."%;\">".($rstat['-1'] ? $rstat['-1']."/".$totalreceipts : '').($allcomments['-1'] ? " ".$this->printPopupBox('<i class="icon-comment"></i>', implode('<br />', $allcomments['-1']), true) : "")."</div>
</div>";
if($allcomments)
$content .= $this->printPopupBox(getMLText('comments'), implode('<br />', $allcomments), true);
}
$content .= "</small></td>";
// $content .= "<td>".$version."</td>";