functions.inc.php:

- better formatting in db_quota_text() and db_quota_percent() results
  (for example, infinity sign instead of / 0 for unlimited)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1744 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 10 years ago
parent 4bc2d5f691
commit 5605561ca8

@ -1322,7 +1322,8 @@ function db_get_boolean($bool) {
*/
function db_quota_text($count, $quota, $fieldname) {
return " CASE $quota
WHEN '-1' THEN coalesce($count,0)
WHEN '-1' THEN CONCAT(coalesce($count,0), ' / -')
WHEN '0' THEN CONCAT(coalesce($count,0), ' / ', '" . escape_string(html_entity_decode('∞')) . "')
ELSE CONCAT(coalesce($count,0), ' / ', $quota)
END AS $fieldname";
}
@ -1337,6 +1338,7 @@ function db_quota_text($count, $quota, $fieldname) {
function db_quota_percent($count, $quota, $fieldname) {
return " CASE $quota
WHEN '-1' THEN -1
WHEN '0' THEN -1
ELSE round(100 * coalesce($count,0) / $quota)
END AS $fieldname";
}

Loading…
Cancel
Save