From d9a2ea5303e8c83e90c82a77ec216c2e45c7d965 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 18 Feb 2025 13:27:20 +0100 Subject: [PATCH] show quota on chart page when listing total document size per user --- CHANGELOG | 1 + out/out.Charts.php | 1 + views/bootstrap/class.Charts.php | 24 ++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 94e0df855..b001e24c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- Changes in version 5.1.39 -------------------------------------------------------------------------------- +- show quota on chart page when listing total document size per user -------------------------------------------------------------------------------- Changes in version 5.1.38 diff --git a/out/out.Charts.php b/out/out.Charts.php index 6988c4fab..2aa0a7fe9 100644 --- a/out/out.Charts.php +++ b/out/out.Charts.php @@ -53,6 +53,7 @@ if ($view) { $view->setParam('type', $type); $view->setParam('data', $data); $view->setParam('accessobject', $accessop); + $view->setParam('quota', $settings->_quota); $view($_GET); exit; } diff --git a/views/bootstrap/class.Charts.php b/views/bootstrap/class.Charts.php index e9f7f6749..549c94c23 100644 --- a/views/bootstrap/class.Charts.php +++ b/views/bootstrap/class.Charts.php @@ -249,6 +249,7 @@ $(document).ready( function() { $user = $this->params['user']; $data = $this->params['data']; $type = $this->params['type']; + $quota = $this->params['quota']; $this->htmlAddHeader( ''."\n". @@ -285,8 +286,12 @@ $(document).ready( function() { $this->contentContainerEnd(); echo ""; echo ""; - echo ""; - if(in_array($type, array('docspermonth', 'docsaccumulated'))) + echo ""; + echo ""; + $types = array('docspermonth', 'docsaccumulated'); + if($quota) + $types[] = 'sizeperuser'; + if(in_array($type, $types)) echo ""; echo ""; $total = 0; @@ -323,6 +328,21 @@ $(document).ready( function() { } break; case 'sizeperuser': + foreach($data as $item) { + $currUser = $dms->getUser($item['res']); + echo ""; + echo ""; + if($quota) { + echo ""; + } + echo ""; + $total += $item['total']; + } + echo ""; + break; case 'sizepermonth': foreach($data as $item) { echo "";
".getMLText('chart_'.$type.'_title')."".getMLText('total')."".getMLText('chart_'.$type.'_title')."".getMLText('total')."
".htmlspecialchars($item['key'])."".SeedDMS_Core_File::format_filesize((int) $item['total']).""; + $qt = $currUser->getQuota() ? $currUser->getQuota() : $quota; + echo $this->getProgressBar($currUser->getUsedDiskSpace(), $qt); + echo "
".SeedDMS_Core_File::format_filesize($total)."
".htmlspecialchars($item['key'])."".SeedDMS_Core_File::format_filesize((int) $item['total'])."