diff --git a/interface/web/dashboard/dashlets/databasequota.php b/interface/web/dashboard/dashlets/databasequota.php index 641dfd7784e0813f8abaa109c42d261a424ada12..077a7ddbcb807dff27c5fa27fbb9ac39e78816fd 100644 --- a/interface/web/dashboard/dashlets/databasequota.php +++ b/interface/web/dashboard/dashlets/databasequota.php @@ -33,12 +33,17 @@ class dashlet_databasequota { //print_r($databases); $has_databasequota = false; + $total_used = 0; if(is_array($databases) && !empty($databases)){ + foreach ($databases as &$db) { + $total_used += $db['used_raw'] * 1000 * 1000; + } $databases = $app->functions->htmlentities($databases); $tpl->setloop('databasequota', $databases); $has_databasequota = isset($databases[0]['used']); } $tpl->setVar('has_databasequota', $has_databasequota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); return $tpl->grab(); } diff --git a/interface/web/dashboard/dashlets/mailquota.php b/interface/web/dashboard/dashlets/mailquota.php index b310cc1dcbfadb2db7729dc11660f931cd2e6587..8b328ab6f911a7ef299a35e2fa65d9662294ef0e 100644 --- a/interface/web/dashboard/dashlets/mailquota.php +++ b/interface/web/dashboard/dashlets/mailquota.php @@ -26,9 +26,11 @@ class dashlet_mailquota { //print_r($emails); $has_mailquota = false; + $total_used = 0; if(is_array($emails) && !empty($emails)){ foreach($emails as &$email) { $email['email'] = $app->functions->idn_decode($email['email']); + $total_used += $email['used_raw']; } unset($email); // email username is quoted in quota.lib already, so no htmlentities here to prevent double encoding @@ -37,6 +39,7 @@ class dashlet_mailquota { $has_mailquota = isset($emails[0]['used']); } $tpl->setVar('has_mailquota', $has_mailquota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); return $tpl->grab(); } diff --git a/interface/web/dashboard/dashlets/quota.php b/interface/web/dashboard/dashlets/quota.php index 3225bd304fff4b37bd3376a9bbd299c472005771..adedbcf5c95039767e2eb82555651c7b39a7e377 100644 --- a/interface/web/dashboard/dashlets/quota.php +++ b/interface/web/dashboard/dashlets/quota.php @@ -38,6 +38,7 @@ class dashlet_quota { foreach($sites as &$site) { $site['domain'] = $app->functions->idn_decode($site['domain']); $site['progressbar'] = $site['hd_quota']; + $total_used += $site['used_raw'] * 1000; } unset($site); @@ -46,6 +47,7 @@ class dashlet_quota { $has_quota = isset($sites[0]['used']); } $tpl->setVar('has_quota', $has_quota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); return $tpl->grab(); diff --git a/interface/web/dashboard/dashlets/templates/databasequota.htm b/interface/web/dashboard/dashlets/templates/databasequota.htm index a2ecc2e47d329ea599108fc2816cd5064fbd890e..2676b65b35e60bb8d9bef319c551e74dd8959522 100644 --- a/interface/web/dashboard/dashlets/templates/databasequota.htm +++ b/interface/web/dashboard/dashlets/templates/databasequota.htm @@ -24,5 +24,12 @@ - - + + + {tmpl_var name='total_txt'} + {tmpl_var name='total_used'} + + + + + diff --git a/interface/web/dashboard/dashlets/templates/mailquota.htm b/interface/web/dashboard/dashlets/templates/mailquota.htm index 08834fa5ab372f952927f3adfbfaf732f3e15551..b30815456dcaec4fd5d55d8d71b3baabb998b5c3 100644 --- a/interface/web/dashboard/dashlets/templates/mailquota.htm +++ b/interface/web/dashboard/dashlets/templates/mailquota.htm @@ -26,5 +26,13 @@ + + + + {tmpl_var name='total_txt'} + {tmpl_var name='total_used'} + + + - + diff --git a/interface/web/dashboard/dashlets/templates/quota.htm b/interface/web/dashboard/dashlets/templates/quota.htm index 6014467e806453728842d0b501d55d2e5f048b4a..7fab69413b9d6642177fb097217e7001c44902d3 100644 --- a/interface/web/dashboard/dashlets/templates/quota.htm +++ b/interface/web/dashboard/dashlets/templates/quota.htm @@ -29,6 +29,13 @@ {tmpl_else}{/tmpl_if} - + + + + {tmpl_var name='total_txt'} + {tmpl_var name='total_used'} + + + - \ No newline at end of file +