From: wolfgang Date: Fri, 1 Feb 2008 22:32:24 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1348 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf4173fbdc9c581a8febc7c031384ed698462f96;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1348 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index b492fefd..f9f799d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-01 Wolfgang Sourdeau + + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame + -quotaSupport]): new json string that lists the quota support + among the user's mail accounts. + + * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount + -supportsQuotas]): new method that returns whether the current + account server has support for quotas. + 2008-01-29 Wolfgang Sourdeau * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder diff --git a/SoObjects/Mailer/SOGoMailAccount.h b/SoObjects/Mailer/SOGoMailAccount.h index 8c720e1f..e907d8cd 100644 --- a/SoObjects/Mailer/SOGoMailAccount.h +++ b/SoObjects/Mailer/SOGoMailAccount.h @@ -48,6 +48,8 @@ SOGoTrashFolder *trashFolder; } +- (BOOL) supportsQuotas; + /* folder pathes */ - (NSArray *) allFolderPaths; diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index 4f2f5911..8b355986 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -31,6 +31,8 @@ #import #import #import +#import +#import #import #import @@ -170,6 +172,15 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default return folders; } +- (BOOL) supportsQuotas +{ + NGImap4Client *imapClient; + + imapClient = [[self imap4Connection] client]; + + return [[imapClient context] canQuota]; +} + /* hierarchy */ - (SOGoMailAccount *) mailAccountFolder diff --git a/SoObjects/Mailer/SOGoMailAccounts.h b/SoObjects/Mailer/SOGoMailAccounts.h index 623ffcb2..afd7404c 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.h +++ b/SoObjects/Mailer/SOGoMailAccounts.h @@ -41,6 +41,8 @@ @interface SOGoMailAccounts : SOGoFolder +- (NSArray *) toManyRelationshipKeys; + @end #endif /* __Mailer_SOGoMailAccounts_H__ */ diff --git a/SoObjects/Mailer/SOGoMailAccounts.m b/SoObjects/Mailer/SOGoMailAccounts.m index 515c6652..3188052c 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.m +++ b/SoObjects/Mailer/SOGoMailAccounts.m @@ -76,6 +76,7 @@ static NSString *AgenorShareLoginMarker = @".-."; } ct = [[ctClass alloc] initWithName:_key inContainer:self]; + return [ct autorelease]; } diff --git a/UI/MailerUI/UIxMailMainFrame.h b/UI/MailerUI/UIxMailMainFrame.h index 1e4ecd55..2147d5f1 100644 --- a/UI/MailerUI/UIxMailMainFrame.h +++ b/UI/MailerUI/UIxMailMainFrame.h @@ -30,6 +30,13 @@ NSUserDefaults *ud; NSMutableDictionary *moduleSettings; } + +- (WOResponse *) getDragHandlesStateAction; +- (WOResponse *) getFoldersStateAction; + +- (WOResponse *) saveDragHandlesStateAction; +- (WOResponse *) saveFoldersStateAction; + @end #endif /* UIXMAILMAINFRAME_H */ diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index e45d9d30..83f24614 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -20,6 +20,7 @@ */ #import +#import #import #import @@ -28,6 +29,7 @@ #import #import +#import #import #import #import @@ -71,6 +73,29 @@ return [accountNames jsonRepresentation]; } +- (NSString *) quotaSupport +{ + NSEnumerator *accountNames; + NSMutableArray *quotas; + NSString *currentAccount; + SOGoMailAccounts *co; + BOOL supportsQuota; + + co = [self clientObject]; + accountNames = [[co toManyRelationshipKeys] objectEnumerator]; + + quotas = [NSMutableArray array]; + while ((currentAccount = [accountNames nextObject])) + { + supportsQuota = [[co lookupName: currentAccount + inContext: context + acquire: NO] supportsQuotas]; + [quotas addObject: [NSNumber numberWithInt: supportsQuota]]; + } + + return [quotas jsonRepresentation]; +} + - (NSString *) pageFormURL { NSString *u; @@ -127,7 +152,9 @@ accounts = [[context activeUser] mailAccounts]; firstAccount = [[accounts objectsForKey: @"name"] objectAtIndex: 0]; formValues = [[context request] formValues]; - parameters = [formValues count] > 0 ? [formValues asURLParameters] : @"?mailto="; + parameters = ([formValues count] > 0 + ? [formValues asURLParameters] + : @"?mailto="); newLocation = [NSString stringWithFormat: @"%@/%@/compose%@", [co baseURLInContext: context], firstAccount, @@ -136,6 +163,16 @@ return [self redirectToLocation: newLocation]; } +- (WOResponse *) getDragHandlesStateAction +{ + NSString *dragHandles; + + [self _setupContext]; + dragHandles = [moduleSettings objectForKey: @"DragHandles"]; + + return [self responseWithStatus: 200 andString: dragHandles]; +} + - (WOResponse *) getFoldersStateAction { NSString *expandedFolders; @@ -146,6 +183,23 @@ return [self responseWithStatus: 200 andString: expandedFolders]; } +- (WOResponse *) saveDragHandlesStateAction +{ + WORequest *request; + NSString *dragHandles; + + [self _setupContext]; + request = [context request]; + dragHandles = [request formValueForKey: @"dragHandles"]; + + [moduleSettings setObject: dragHandles + forKey: @"DragHandles"]; + + [ud synchronize]; + + return [self responseWithStatus: 204]; +} + - (WOResponse *) saveFoldersStateAction { WORequest *request; diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 61714cd2..e15dd206 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -330,11 +330,21 @@ pageName = "UIxMailMainFrame"; actionName = "compose"; }; + dragHandlesState = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + actionName = "getDragHandlesState"; + }; foldersState = { protectedBy = "View"; pageName = "UIxMailMainFrame"; actionName = "getFoldersState"; }; + saveDragHandlesState = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + actionName = "saveDragHandlesState"; + }; saveFoldersState = { protectedBy = "View"; pageName = "UIxMailMainFrame"; diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 355c8999..cd847feb 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -10,6 +10,7 @@ const:jsFiles="dtree.js,MailerUI+dTree.js">