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/SoObjects/Contacts/SOGoContactLDAPFolder.m b/SoObjects/Contacts/SOGoContactLDAPFolder.m index 3e28d9230..b7d9cdfb9 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.m +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.m @@ -24,6 +24,7 @@ #import #import #import +#import #import #import @@ -187,8 +188,10 @@ NSEnumerator *oldRecords; NSDictionary *oldRecord; NSMutableDictionary *newRecord; - NSString *data; + NSString *data, *contactInfo; + NSUserDefaults *ud; + ud = [NSUserDefaults standardUserDefaults]; newRecords = [[NSMutableArray alloc] initWithCapacity: [records count]]; [newRecords autorelease]; @@ -237,6 +240,13 @@ data = @""; [newRecord setObject: data forKey: @"phone"]; + contactInfo = [ud stringForKey: @"SOGoLDAPContactInfoAttribute"]; + if ([contactInfo length] > 0) { + data = [oldRecord objectForKey: contactInfo]; + if ([data length] > 0) + [newRecord setObject: data forKey: @"contactInfo"]; + } + [newRecords addObject: newRecord]; oldRecord = [oldRecords nextObject]; } diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index dfc37d341..4f7ed3b6a 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -23,6 +23,7 @@ #import #import #import +#import #import #import @@ -394,8 +395,12 @@ static int sizeLimit; - (NSArray *) _searchAttributes { + NSUserDefaults *ud; + NSString *contactInfo; + if (!searchAttributes) { + ud = [NSUserDefaults standardUserDefaults]; searchAttributes = [NSMutableArray new]; if (CNField) [searchAttributes addObject: CNField]; @@ -404,6 +409,12 @@ static int sizeLimit; [searchAttributes addObjectsFromArray: mailFields]; [searchAttributes addObjectsFromArray: [self _contraintsFields]]; [searchAttributes addObjectsFromArray: commonSearchFields]; + + // Add SOGoLDAPContactInfoAttribute from user defaults + contactInfo = [ud stringForKey: @"SOGoLDAPContactInfoAttribute"]; + if ([contactInfo length] > 0 && + ![searchAttributes containsObject: contactInfo]) + [searchAttributes addObject: contactInfo]; } return searchAttributes; diff --git a/UI/MailerUI/Dutch.lproj/Localizable.strings b/UI/MailerUI/Dutch.lproj/Localizable.strings index 16d9913bb..312a2cf02 100644 --- a/UI/MailerUI/Dutch.lproj/Localizable.strings +++ b/UI/MailerUI/Dutch.lproj/Localizable.strings @@ -203,7 +203,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 7320cca1d..e7a8816b8 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -218,8 +218,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 698120403..ef5f2d51c 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -220,7 +220,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 9b9ee6586..2720198f9 100644 --- a/UI/MailerUI/German.lproj/Localizable.strings +++ b/UI/MailerUI/German.lproj/Localizable.strings @@ -203,7 +203,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 7057fb6e1..a6905f2ca 100644 --- a/UI/MailerUI/Italian.lproj/Localizable.strings +++ b/UI/MailerUI/Italian.lproj/Localizable.strings @@ -226,7 +226,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 8822a297a..40f1baeb3 100644 --- a/UI/MailerUI/Spanish.lproj/Localizable.strings +++ b/UI/MailerUI/Spanish.lproj/Localizable.strings @@ -222,7 +222,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 a4277fede..753d5b4ed 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/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 64b970e37..ba924ea1f 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -437,6 +437,12 @@ function performSearchCallback(http) { list.appendChild(node); node.uid = contact["c_uid"]; node.appendChild(document.createTextNode(completeEmail)); + log($H(contact).inspect() + ""); + if (contact["contactInfo"]) { + var info = new Element('span').update(contact['contactInfo']); + node.appendChild(info); + log ("info = " + contact['contactInfo']); + } $(node).observe("mousedown", onAddressResultClick); } 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