show difference in number of documents on chart page

This commit is contained in:
Uwe Steinmann 2021-01-31 13:48:25 +01:00
parent 899d89a2a9
commit 37d3577603
2 changed files with 21 additions and 3 deletions

View File

@ -10,6 +10,7 @@
mismatch
- overhaul notifications, type of receiver is now passed to notification
service which allows a more fine grained filtering
- show difference in number of documents on chart page
--------------------------------------------------------------------------------
Changes in version 5.1.21

View File

@ -227,7 +227,11 @@ $(document).ready( function() {
<?php
$this->contentContainerEnd();
echo "<table class=\"table table-condensed table-hover\">";
echo "<tr><th>".getMLText('chart_'.$type.'_title')."</th><th>".getMLText('total')."</th></tr>";
echo "<tr>";
echo "<th>".getMLText('chart_'.$type.'_title')."</th><th>".getMLText('total')."</th>";
if(in_array($type, array('docspermonth', 'docsaccumulated')))
echo "<th></th>";
echo "</tr>";
$total = 0;
switch($type) {
case 'docspermonth':
@ -235,15 +239,28 @@ $(document).ready( function() {
case 'docspermimetype':
case 'docspercategory':
case 'docsperstatus':
$oldtotal = 0;
foreach($data as $item) {
echo "<tr><td>".htmlspecialchars($item['key'])."</td><td>".$item['total']."</td></tr>";
echo "<tr>";
echo "<td>".htmlspecialchars($item['key'])."</td>";
echo "<td>".$item['total']."</td>";
if(in_array($type, array('docspermonth')))
echo "<td>".sprintf('%+d', $item['total']-$oldtotal)."</td>";
echo "</tr>";
$oldtotal = $item['total'];
$total += $item['total'];
}
echo "<tr><th></th><th>".$total."<th></tr>";
break;
case 'docsaccumulated':
$oldtotal = 0;
foreach($data as $item) {
echo "<tr><td>".date('Y-m-d', $item['key']/1000)."</td><td>".$item['total']."</td></tr>";
echo "<tr>";
echo "<td>".getReadableDate($item['key']/1000)."</td>";
echo "<td>".$item['total']."</td>";
echo "<td>".sprintf('%+d', $item['total']-$oldtotal)."</td>";
echo "</tr>";
$oldtotal = $item['total'];
$total += $item['total'];
}
break;