mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
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
This commit is contained in:
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…
Reference in New Issue
Block a user