summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9073646)
raw | patch | inline | side by side (parent: 9073646)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Dec 2008 13:13:34 +0000 (13:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Dec 2008 13:13:34 +0000 (13:13 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13243 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
index 695bae8d87942257a9f214e17055df6dcc4e97b6..b4c01024dba3cb84de6b35744fd218f7cafa7b70 100644 (file)
var $gosaMailForwardingAddress = array(); // Forwarding also empty
var $gosaMailServer = ""; // Selected mailserver
var $gosaMailQuota = ""; // Defined Quota
- var $quotaUsage = 0; // Currently used quota
var $gosaVacationMessage = ""; // Vocation message
var $gosaSpamSortLevel = "";
var $gosaSpamMailbox = "";
var $gosaMailMaxSize = ""; //
var $FolderType = array("CAT" => '', "SUB_CAT" => '');
+ var $quotaUsage = -1; // -1 Means undefined
+
/* Internal */
var $AclTypes = array();
var $members = array(); // Group members
/* Read quota */
$this->gosaMailQuota = $this->mailMethod->getQuota($this->gosaMailQuota);
+ $this->quotaUsage = $this->mailMethod->getQuotaUsage($this->quotaUsage);
if($this->mailMethod->is_error()){
msg_dialog::display(_("Mail error"), sprintf(_("Cannot read quota settings: %s"),
$this->mailMethod->get_error()), ERROR_DIALOG);
$smarty->assign("AclTypes" , $this->AclTypes);
$smarty->assign("quotaEnabled", $this->mailMethod->quotaEnabled());
- $smarty->assign("gosaMailQuota",$this->gosaMailQuota);
- if($this->mailMethod->is_connected()){
- $smarty->assign("quotaUsage", $this->mailMethod->getQuotaUsage());
- }else{
- $smarty->assign("quotaUsage", _("Unknown"));
+ if($this->mailMethod->quotaEnabled()){
+ $smarty->assign("gosaMailQuota",$this->gosaMailQuota);
+ $smarty->assign("quotaUsage", mailMethod::quota_to_image($this->quotaUsage,$this->gosaMailQuota));
}
$smarty->assign("MailDomains", $this->mailDomainParts);
diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc
index 9f1cbf7cf12d2a47bd010130011d4f0f3b6c6433..d2d76936dd510e98f98424b5f01747d2ff18d77a 100644 (file)
return("");
}
+
+ static function quota_to_image($use,$quota)
+ {
+ if($use == -1 ){
+ return(_("Unknown"));
+ }elseif($quota == 0){
+ return(progressbar(100,100,15,true));
+ }else{
+ return(progressbar(round(($use * 100)/ $quota),100,15,true));
+ }
+ }
}
diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc
index d346f242aa82923661de7e7e04f65501cc461e34..295ab5747b801bd6eb374b0fabd985551664e8f1 100644 (file)
var $gosaSpamMailbox = "";
/* The methods defaults */
+ var $quotaUsage = -1; // Means unknown
+
var $mailMethod = NULL;
var $MailDomain = "";
var $sieveManagementUsed = FALSE;
/* Read quota */
$this->gosaMailQuota = $this->mailMethod->getQuota($this->gosaMailQuota);
+ $this->quotaUsage = $this->mailMethod->getQuotaUsage($this->quotaUsage);
if($this->mailMethod->is_error()){
msg_dialog::display(_("Mail error"), sprintf(_("Cannot read quota settings: %s"),
$this->mailMethod->get_error()), ERROR_DIALOG);
$smarty->assign($attr,$this->$attr);
}
$smarty->assign("quotaEnabled", $this->mailMethod->quotaEnabled());
- if($this->mailMethod->is_connected()){
- $smarty->assign("quotaUsage", $this->mailMethod->getQuotaUsage());
- }else{
- $smarty->assign("quotaUsage", _("Unknown"));
+ if($this->mailMethod->quotaEnabled()){
+ $smarty->assign("quotaUsage", mailMethod::quota_to_image($this->quotaUsage,$this->gosaMailQuota));
+ $smarty->assign("gosaMailQuota",$this->gosaMailQuota);
}
- $smarty->assign("gosaMailQuota",$this->gosaMailQuota);
$smarty->assign("domainSelectionEnabled", $this->mailMethod->domainSelectionEnabled());
$smarty->assign("MailDomains", $this->mailDomainParts);
$smarty->assign("MailDomain" , $this->mailDomainPart);