mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-27 04:44:18 +00:00
Monotone-Parent: 4f12ba210dcd4149e7496ee80e06c65b94793dd3
Monotone-Revision: 7db08f6967ccc793434ea22058755fb137e85d45 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-01T12:48:19 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -216,7 +216,6 @@
|
||||
"Please select only one message to print." = "Please select only one message to print.";
|
||||
|
||||
"You need to choose a non-virtual folder!" = "You need to choose a non-virtual folder!";
|
||||
"You need to choose a root subfolder!" = "You need to choose a root subfolder!";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Moving a message into its own folder is impossible!";
|
||||
|
||||
@@ -217,7 +217,6 @@
|
||||
"Please select only one message to print." = "Veuillez ne sélectionner qu'un seul message à imprimer.";
|
||||
|
||||
"You need to choose a non-virtual folder!" = "Vous devez choisir un dossier non-virtuel.";
|
||||
"You need to choose a root subfolder!" = "Vous devez choisir un sous-dossier de la racine.";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Le déplacement d'un message dans son propre dossier est impossible.";
|
||||
|
||||
@@ -200,7 +200,6 @@
|
||||
"Please select only one message to print." = "Bitte wählen Sie nur eine Nachricht zum Drucken aus.";
|
||||
|
||||
"You need to choose a non-virtual folder!" = "You need to choose a non-virtual folder!";
|
||||
"You need to choose a root subfolder!" = "You need to choose a root subfolder!";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Moving a message into its own folder is impossible!";
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
|
||||
@interface UIxMailAccountActions : WODirectAction
|
||||
{
|
||||
NSString *draftFolderName;
|
||||
NSString *inboxFolderName;
|
||||
NSString *draftsFolderName;
|
||||
NSString *sentFolderName;
|
||||
NSString *trashFolderName;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#import <SoObjects/Mailer/SOGoMailAccount.h>
|
||||
#import <SoObjects/Mailer/SOGoDraftObject.h>
|
||||
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSObject+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
|
||||
@@ -40,17 +41,56 @@
|
||||
|
||||
@implementation UIxMailAccountActions
|
||||
|
||||
- (NSString *) _folderType: (NSString *) baseName
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
inboxFolderName = nil;
|
||||
draftsFolderName = nil;
|
||||
sentFolderName = nil;
|
||||
trashFolderName = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[inboxFolderName release];
|
||||
[draftsFolderName release];
|
||||
[sentFolderName release];
|
||||
[trashFolderName release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *) _folderType: (NSString *) folderName
|
||||
{
|
||||
NSString *folderType;
|
||||
SOGoMailAccount *co;
|
||||
NSArray *specialFolders;
|
||||
|
||||
if ([baseName isEqualToString: @"INBOX"])
|
||||
if (!inboxFolderName)
|
||||
{
|
||||
co = [self clientObject];
|
||||
specialFolders = [[NSArray arrayWithObjects:
|
||||
[co inboxFolderNameInContext: context],
|
||||
[co draftsFolderNameInContext: context],
|
||||
[co sentFolderNameInContext: context],
|
||||
[co trashFolderNameInContext: context],
|
||||
nil] stringsWithFormat: @"/%@"];
|
||||
ASSIGN (inboxFolderName, [specialFolders objectAtIndex: 0]);
|
||||
ASSIGN (draftsFolderName, [specialFolders objectAtIndex: 1]);
|
||||
ASSIGN (sentFolderName, [specialFolders objectAtIndex: 2]);
|
||||
ASSIGN (trashFolderName, [specialFolders objectAtIndex: 3]);
|
||||
}
|
||||
|
||||
if ([folderName isEqualToString: inboxFolderName])
|
||||
folderType = @"inbox";
|
||||
else if ([baseName isEqualToString: draftFolderName])
|
||||
else if ([folderName isEqualToString: draftsFolderName])
|
||||
folderType = @"draft";
|
||||
else if ([baseName isEqualToString: sentFolderName])
|
||||
else if ([folderName isEqualToString: sentFolderName])
|
||||
folderType = @"sent";
|
||||
else if ([baseName isEqualToString: trashFolderName])
|
||||
else if ([folderName isEqualToString: trashFolderName])
|
||||
folderType = @"trash";
|
||||
else
|
||||
folderType = @"folder";
|
||||
@@ -58,34 +98,20 @@
|
||||
return folderType;
|
||||
}
|
||||
|
||||
- (NSDictionary *) _lineForFolder: (NSString *) folder
|
||||
{
|
||||
NSArray *parts;
|
||||
NSMutableDictionary *folderData;
|
||||
NSString *baseName;
|
||||
|
||||
folderData = [NSMutableDictionary dictionary];
|
||||
parts = [folder componentsSeparatedByString: @"/"];
|
||||
baseName = [parts lastObject];
|
||||
[folderData setObject: folder forKey: @"path"];
|
||||
[folderData setObject: [self _folderType: baseName]
|
||||
forKey: @"type"];
|
||||
|
||||
return folderData;
|
||||
}
|
||||
|
||||
- (NSArray *) _jsonFolders: (NSEnumerator *) rawFolders
|
||||
{
|
||||
NSMutableArray *folders;
|
||||
NSString *currentFolder;
|
||||
NSDictionary *folderData;
|
||||
|
||||
folders = [NSMutableArray array];
|
||||
|
||||
currentFolder = [rawFolders nextObject];
|
||||
while (currentFolder)
|
||||
while ((currentFolder = [rawFolders nextObject]))
|
||||
{
|
||||
[folders addObject: [self _lineForFolder: currentFolder]];
|
||||
currentFolder = [rawFolders nextObject];
|
||||
folderData = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
currentFolder, @"path",
|
||||
[self _folderType: currentFolder], @"type",
|
||||
nil];
|
||||
[folders addObject: folderData];
|
||||
}
|
||||
|
||||
return folders;
|
||||
@@ -94,19 +120,14 @@
|
||||
- (WOResponse *) listMailboxesAction
|
||||
{
|
||||
SOGoMailAccount *co;
|
||||
NSArray *rawFolders, *folders;
|
||||
NSEnumerator *rawFolders;
|
||||
NSArray *folders;
|
||||
WOResponse *response;
|
||||
|
||||
co = [self clientObject];
|
||||
draftFolderName = [[co draftsFolderNameInContext: context]
|
||||
substringFromIndex: 6];
|
||||
sentFolderName = [[co sentFolderNameInContext: context]
|
||||
substringFromIndex: 6];
|
||||
trashFolderName = [[co trashFolderNameInContext: context]
|
||||
substringFromIndex: 6];
|
||||
|
||||
rawFolders = [co allFolderPaths];
|
||||
folders = [self _jsonFolders: [rawFolders objectEnumerator]];
|
||||
rawFolders = [[co allFolderPaths] objectEnumerator];
|
||||
folders = [self _jsonFolders: rawFolders];
|
||||
|
||||
response = [self responseWithStatus: 200];
|
||||
[response setHeader: @"text/plain; charset=utf-8"
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
trashFolderName
|
||||
= [[co mailAccountFolder] trashFolderNameInContext: context];
|
||||
path = [NSString stringWithFormat: @"/%@/%@",
|
||||
[trashFolderName substringFromIndex: 6], folderName];
|
||||
trashFolderName, folderName];
|
||||
destURL = [[NSURL alloc] initWithScheme: [srcURL scheme]
|
||||
host: [srcURL host] path: path];
|
||||
[destURL autorelease];
|
||||
@@ -193,7 +193,7 @@
|
||||
[mailSettings autorelease];
|
||||
}
|
||||
[ud setObject: mailSettings forKey: @"Mail"];
|
||||
[mailSettings setObject: [co relativeImap4Name]
|
||||
[mailSettings setObject: [co traversalFromMailAccount]
|
||||
forKey: [NSString stringWithFormat: @"%@Folder",
|
||||
purpose]];
|
||||
[ud synchronize];
|
||||
|
||||
@@ -1393,13 +1393,8 @@ function _onMenuChangeToXXXFolder(event, folder) {
|
||||
window.alert(labels["You need to choose a non-virtual folder!"]);
|
||||
else {
|
||||
var folderID = document.menuTarget.getAttribute("dataname");
|
||||
var number = folderID.split("/").length;
|
||||
if (number > 3)
|
||||
window.alert(labels["You need to choose a root subfolder!"]);
|
||||
else {
|
||||
var urlstr = URLForFolderID(folderID) + "/setAs" + folder + "Folder";
|
||||
triggerAjaxRequest(urlstr, folderOperationCallback);
|
||||
}
|
||||
var urlstr = URLForFolderID(folderID) + "/setAs" + folder + "Folder";
|
||||
triggerAjaxRequest(urlstr, folderOperationCallback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user