Skip to content
Snippets Groups Projects
Commit 7f4ceb0b authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch '6505-quota-dash-sum' into 'develop'

Sum for quota usage

Closes #6505

See merge request ispconfig/ispconfig3!1739
parents 9a1fa04b bba79384
No related branches found
Tags 3.1.5
No related merge requests found
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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();
......
......@@ -24,5 +24,12 @@
</tr>
</tmpl_loop>
</tbody>
</table>
</div>
<tfoot>
<tr>
<th>{tmpl_var name='total_txt'}</th>
<th>{tmpl_var name='total_used'}</th>
<th colspan="2"></th>
</tr>
<tfoot>
</table>
</div>
......@@ -26,5 +26,13 @@
</tr>
</tmpl_loop>
</tbody>
<tfoot>
<tr>
<th></th>
<th>{tmpl_var name='total_txt'}</th>
<th>{tmpl_var name='total_used'}</th>
<th colspan="2"></th>
</tr>
</tfoot>
</table>
</div>
</div>
......@@ -29,6 +29,13 @@
</td>{tmpl_else}<td></td>{/tmpl_if}
</tr>
</tmpl_loop>
</tbody>
</tbody>
<tfoot>
<tr>
<th>{tmpl_var name='total_txt'}</th>
<th>{tmpl_var name='total_used'}</th>
<th colspan="3"></th>
</tr>
</tfoot>
</table>
</div>
\ No newline at end of file
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment