diff --git a/NEWS b/NEWS index 9cb7d59c9..27425c856 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +1.0-2008XXYY (1.0) +------------------ +- added quota indicator in web mail module +- improved drag handles behavior + 1.0-20080826 (1.0 rc8) ---------------------- - fixed a bug that would prevent deleted event and tasks from being removed from the events and tasks list diff --git a/UI/MailerUI/Dutch.lproj/Localizable.strings b/UI/MailerUI/Dutch.lproj/Localizable.strings index 99523d1f2..5f5fa7321 100644 --- a/UI/MailerUI/Dutch.lproj/Localizable.strings +++ b/UI/MailerUI/Dutch.lproj/Localizable.strings @@ -209,7 +209,7 @@ "Operation failed" = "Operatie mislukt."; "Quota" = "Quota"; -"quotasFormat" = "%{0} van %{1} KB gebruikt (%{2}%)"; +"quotasFormat" = "%{0}% van %{1} MB gebruikt"; "Please select a message." = "Selecteer een bericht."; "Please select a message to print." = "Selecteer een bericht om af te drukken."; diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 3c9524724..f14b4ffe4 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -223,8 +223,8 @@ = "Do you really want to move this folder into the trash ?"; "Operation failed" = "Operation failed"; -"Quota" = "Quota"; -"quotasFormat" = "%{0} used on %{1} Kb (%{2}%)"; +"Quota" = "Quota:"; +"quotasFormat" = "%{0}% used on %{1} MB"; "Please select a message." = "Please select a message."; "Please select a message to print." = "Please select a message to print."; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 6c703ebae..ab6509f37 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -226,7 +226,7 @@ "Operation failed" = "L'opération a échoué."; "Quota" = "Quota"; -"quotasFormat" = "%{0} Ko utilisés sur %{1} (%{2}%)"; +"quotasFormat" = "%{0}% utilisé sur %{1} MO"; "Please select a message." = "Veuillez sélectionner un message."; "Please select a message to print." = "Veuillez sélectionner un message à imprimer."; diff --git a/UI/MailerUI/German.lproj/Localizable.strings b/UI/MailerUI/German.lproj/Localizable.strings index 0a8e7c831..2a3a80758 100644 --- a/UI/MailerUI/German.lproj/Localizable.strings +++ b/UI/MailerUI/German.lproj/Localizable.strings @@ -209,7 +209,7 @@ "Operation failed" = "L'opération a échoué."; "Quota" = "Quota"; -"quotasFormat" = "%{0} von %{1} KB verwendet (%{2}%)"; +"quotasFormat" = "%{0}% von %{1} MB verwendet"; "Please select a message." = "Sie müssen eine Nachricht auswählen."; "Please select a message to print." = "Sie müssen eine Nachricht zum Drucken auswählen."; diff --git a/UI/MailerUI/Italian.lproj/Localizable.strings b/UI/MailerUI/Italian.lproj/Localizable.strings index ed874dd86..42429d1ca 100644 --- a/UI/MailerUI/Italian.lproj/Localizable.strings +++ b/UI/MailerUI/Italian.lproj/Localizable.strings @@ -232,7 +232,7 @@ "Operation failed" = "Operazione non riuscita"; "Quota" = "Spazio usato"; -"quotasFormat" = "%{0} su %{1} Kb (%{2}%)"; +"quotasFormat" = "%{0}% usato su %{1} MB"; "Please select a message." = "Per favore seleziona un messaggio."; "Please select a message to print." = "Per favore seleziona un messaggio da stampare."; diff --git a/UI/MailerUI/Spanish.lproj/Localizable.strings b/UI/MailerUI/Spanish.lproj/Localizable.strings index b772b231a..5d93b8658 100644 --- a/UI/MailerUI/Spanish.lproj/Localizable.strings +++ b/UI/MailerUI/Spanish.lproj/Localizable.strings @@ -228,7 +228,7 @@ "Operation failed" = "Operación fallida"; "Quota" = "Quotas"; -"quotasFormat" = "%{0} de %{1} Kb usados (%{2}%)"; +"quotasFormat" = "%{0}% de %{1} MB usados"; "Please select a message." = "Seleccione un mensaje primero."; "Please select a message to print." = "Seleccione el mensaje que desea imprimir."; diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index ffbd1a6b8..2b56ba1c5 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -134,7 +134,7 @@ NSString *inboxName; NSUserDefaults *ud; WOResponse *response; - int quota; + float quota; ud = [NSUserDefaults standardUserDefaults]; co = [self clientObject]; @@ -143,18 +143,21 @@ folders = [self _jsonFolders: rawFolders]; // Retrieve INBOX quota - quota = [ud integerForKey: @"SOGoSoftQuota"]; + quota = [ud floatForKey: @"SOGoSoftQuotaRatio"]; inbox = [co inboxFolderInContext: context]; inboxName = [NSString stringWithFormat: @"/%@", [inbox relativeImap4Name]]; client = [[inbox imap4Connection] client]; infos = [[client getQuotaRoot: [inbox relativeImap4Name]] objectForKey: @"quotas"]; inboxQuota = [infos objectForKey: inboxName]; - if (quota > 0 && inboxQuota != nil) - // A soft quota is imposed for all users - inboxQuota = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt: quota], @"maxQuota", - [inboxQuota objectForKey: @"usedSpace"], @"usedSpace", - nil]; + if (quota != 0 && inboxQuota != nil) + { + // A soft quota ration is imposed for all users + quota = quota * [(NSNumber*)[inboxQuota objectForKey: @"maxQuota"] intValue]; + inboxQuota = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithFloat: (long)(quota+0.5)], @"maxQuota", + [inboxQuota objectForKey: @"usedSpace"], @"usedSpace", + nil]; + } data = [NSDictionary dictionaryWithObjectsAndKeys: folders, @"mailboxes", inboxQuota, @"quotas", nil]; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index b0956fdf9..65ad37976 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -20,7 +20,6 @@ */ #import -#import #import #import @@ -150,8 +149,8 @@ - (id ) composeAction { id contact; - NSArray *accounts, *contactsId; - NSString *firstAccount, *newLocation, *parameters, *folderId, *uid, *email, *n; + NSArray *accounts, *contactsId, *n; + NSString *firstAccount, *newLocation, *parameters, *folderId, *uid, *email; NSMutableString *fn; NSEnumerator *uids; NSMutableArray *addresses; diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 96dc58464..fafe9f69f 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -191,13 +191,6 @@ - -
diff --git a/UI/WebServerResources/MailerUI.css b/UI/WebServerResources/MailerUI.css index 0e8713c9b..0a098da8f 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -650,7 +650,7 @@ DIV.quota DIV.level background-position: 25% 0; border-left: 1px solid #999; border-right: 1px solid #999; - height: 20px; } + /*height: 20px;*/ } DIV.quota DIV.marks DIV { float: left; margin: 0; @@ -658,11 +658,11 @@ DIV.quota DIV.marks DIV width: 25%; border: 0; border-right: 1px solid #999; - height: 5px; } + height: 3px; } DIV.quota DIV.level DIV.value { background-repeat: repeat-x; border-left: 1px solid transparent; - height: 15px; + height: 9px; margin: 0; position: relative; } DIV.quota DIV.level DIV.value.ok @@ -670,7 +670,15 @@ DIV.quota DIV.level DIV.value.ok DIV.quota DIV.level DIV.value.warn { background-image: url(quota-level-warn.png); } DIV.quota DIV.level DIV.value.alert -{ background-image: url(quota-level-alert.png); } +{ background-image: url(quota-level-alert.png); } +DIV.quota DIV.level P +{ margin: 0; + padding: 0; + clear: both; + color: #555; + font-size: 1em; + text-align: center; +} DIV#quotaDialog { background-image: url("dialog-left.png"); background-repeat: no-repeat; diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index c0d4cce51..ee396fffe 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -1373,39 +1373,29 @@ function updateMailboxTreeInPage() { } } if (Mailer.quotas) { - // Build quota indicator + // Build quota indicator, show values in MB var percents = (Math.round(Mailer.quotas.usedSpace * 10000 / Mailer.quotas.maxQuota) / 100); var level = (percents > 85)? "alert" : (percents > 70)? "warn" : "ok"; var format = labels["quotasFormat"]; - var text = format.formatted(Mailer.quotas.usedSpace, Mailer.quotas.maxQuota, percents); + var text = format.formatted(percents, + Math.round(Mailer.quotas.maxQuota/10.24)/100); var quotaDiv = new Element('div', { 'class': 'quota', 'info': text }); var levelDiv = new Element('div', { 'class': 'level' }); var valueDiv = new Element('div', { 'class': 'value ' + level, 'style': 'width: ' + ((percents > 100)?100:percents) + '%' }); var marksDiv = new Element('div', { 'class': 'marks' }); + var textP = new Element('p').update(text); marksDiv.appendChild(new Element('div')); marksDiv.appendChild(new Element('div')); marksDiv.appendChild(new Element('div')); levelDiv.appendChild(valueDiv); levelDiv.appendChild(marksDiv); + levelDiv.appendChild(textP); quotaDiv.appendChild(levelDiv); treeContent.insertBefore(quotaDiv, tree); - quotaDiv.observe("mouseover", onViewQuota); - quotaDiv.observe("mouseout", function(event) { $("quotaDialog").hide(); }); } } -function onViewQuota(event) { - var div = $("quotaDialog"); - if (div.visible()) return; - var position = this.cumulativeOffset(); - position[0] += this.getWidth(); - div.down("p").update(this.readAttribute("info")); - div.setStyle({ left: position[0] + "px", - top: position[1] + "px" }); - div.show(); -} - function mailboxMenuNode(type, name) { var newNode = document.createElement("li"); var icon = MailerUIdTreeExtension.folderIcons[type]; diff --git a/UI/WebServerResources/quota-level-alert.png b/UI/WebServerResources/quota-level-alert.png index 4383a2844..5ac2167b7 100644 Binary files a/UI/WebServerResources/quota-level-alert.png and b/UI/WebServerResources/quota-level-alert.png differ diff --git a/UI/WebServerResources/quota-level-ok.png b/UI/WebServerResources/quota-level-ok.png index 8e538c906..b9ae3ae38 100644 Binary files a/UI/WebServerResources/quota-level-ok.png and b/UI/WebServerResources/quota-level-ok.png differ diff --git a/UI/WebServerResources/quota-level-warn.png b/UI/WebServerResources/quota-level-warn.png index 2b0712fc2..793091a8b 100644 Binary files a/UI/WebServerResources/quota-level-warn.png and b/UI/WebServerResources/quota-level-warn.png differ diff --git a/UI/WebServerResources/quota-level.png b/UI/WebServerResources/quota-level.png index 77b723774..c242fbb8e 100644 Binary files a/UI/WebServerResources/quota-level.png and b/UI/WebServerResources/quota-level.png differ