From: wolfgang Date: Fri, 2 Nov 2007 19:47:44 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1225 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c105d8eb754f713f9cbe77f8e9d328e3a98e73dc;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1225 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 476804a0..6e4d62e0 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -527,22 +527,26 @@ function quotasCallback(http) { && http.status == 200) { var hasQuotas = false; + if (http.responseText.length > 0) { var quotas = http.responseText.evalJSON(true); for (var i in quotas) { hasQuotas = true; break; } - - if (hasQuotas) { - var treePath = currentMailbox.split("/"); - var mbQuotas = quotas["/" + treePath[2]]; - var used = mbQuotas["usedSpace"]; - var max = mbQuotas["maxQuota"]; - var percents = (Math.round(used * 10000 / max) / 100); - var format = labels["quotasFormat"]; - var text = format.formatted(used, max, percents); - window.status = text; - } + } + + if (hasQuotas) { + var treePath = currentMailbox.split("/"); + var quotasMB = new Array(); + for (var i = 2; i < treePath.length; i++) + quotasMB.push(treePath[i].substr(6)); + var mbQuotas = quotas["/" + quotasMB.join("/")]; + var used = mbQuotas["usedSpace"]; + var max = mbQuotas["maxQuota"]; + var percents = (Math.round(used * 10000 / max) / 100); + var format = labels["quotasFormat"]; + var text = format.formatted(used, max, percents); + window.status = text; } } }