diff --git a/ChangeLog b/ChangeLog index c85b8bc70..c86e7a592 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-09-10 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject + -trashInContext:_ctx]): no longer expunge the mailbox after + marking a message deleted. + ([SOGoMailObject -moveToFolderNamed:folderNameinContext:]): same + as above. + + * UI/MailerUI/UIxMailView.m ([-deleteAction]): removed method. + ([-trashAction]): moved method into UIxMailActions. + ([-moveAction]): moved method into UIxMailActions. + 2007-09-07 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartHTMLViewer.m diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 0f152a4fc..c0b4929ff 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -883,10 +883,6 @@ static BOOL debugSoParts = NO; error = [[self imap4Connection] markURLDeleted: [self imap4URL]]; if (error != nil) return error; - /* c) expunge */ - - error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]]; - if (error != nil) return error; // TODO: unflag as deleted? [self flushMailCaches]; return nil; @@ -895,15 +891,6 @@ static BOOL debugSoParts = NO; - (NSException *) moveToFolderNamed: (NSString *) folderName inContext: (id)_ctx { - /* - Trashing is three actions: - a) copy to trash folder - b) mark mail as deleted - c) expunge folder - - In case b) or c) fails, we can't do anything because IMAP4 doesn't tell us - the ID used in the trash folder. - */ SOGoMailAccounts *destFolder; NSEnumerator *folders; NSString *currentFolderName, *reason; @@ -947,11 +934,7 @@ static BOOL debugSoParts = NO; error = [[self imap4Connection] markURLDeleted: [self imap4URL]]; if (error != nil) return error; - - /* c) expunge */ - error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]]; - if (error != nil) return error; // TODO: unflag as deleted? [self flushMailCaches]; return nil; diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m index b8ca9cf9f..42b5fa0e3 100644 --- a/UI/MailerUI/UIxMailActions.m +++ b/UI/MailerUI/UIxMailActions.m @@ -25,6 +25,8 @@ #import #import #import +#import + #import #import #import @@ -36,27 +38,6 @@ @implementation UIxMailActions -- (WOResponse *) editAction -{ - SOGoMailAccount *account; - SOGoMailObject *co; - SOGoDraftsFolder *folder; - SOGoDraftObject *newMail; - NSString *newLocation; - - co = [self clientObject]; - account = [co mailAccountFolder]; - folder = [account draftsFolderInContext: context]; - newMail = [folder newDraft]; - [newMail fetchMailForEditing: co]; - [newMail storeInfo]; - - newLocation = [NSString stringWithFormat: @"%@/edit", - [newMail baseURLInContext: context]]; - - return [self redirectToLocation: newLocation]; -} - - (WOResponse *) replyToAll: (BOOL) toAll { SOGoMailAccount *account; @@ -107,7 +88,65 @@ return [self redirectToLocation: newLocation]; } +- (id) trashAction +{ + id response; + + response = [[self clientObject] trashInContext: context]; + if (!response) + { + response = [context response]; + [response setStatus: 204]; + } + + return response; +} + +- (id) moveAction +{ + NSString *destinationFolder; + id response; + + destinationFolder = [[context request] formValueForKey: @"tofolder"]; + if ([destinationFolder length] > 0) + { + response = [[self clientObject] moveToFolderNamed: destinationFolder + inContext: context]; + if (!response) + { + response = [context response]; + [response setStatus: 204]; + } + } + else + response = [NSException exceptionWithHTTPStatus: 500 /* Server Error */ + reason: @"No destination folder given"]; + + return response; +} + /* SOGoDraftObject */ +- (WOResponse *) editAction +{ + SOGoMailAccount *account; + SOGoMailObject *co; + SOGoDraftsFolder *folder; + SOGoDraftObject *newMail; + NSString *newLocation; + + co = [self clientObject]; + account = [co mailAccountFolder]; + folder = [account draftsFolderInContext: context]; + newMail = [folder newDraft]; + [newMail fetchMailForEditing: co]; + [newMail storeInfo]; + + newLocation = [NSString stringWithFormat: @"%@/edit", + [newMail baseURLInContext: context]]; + + return [self redirectToLocation: newLocation]; +} + - (id) deleteAction { SOGoDraftObject *draft; diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index 1eb40bc79..107e9c2ad 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -201,119 +201,6 @@ static NSString *mailETag = nil; return [self redirectToLocation: url]; } -- (id) deleteAction -{ - NSException *ex; - - if (![self isDeletableClientObject]) { - return [NSException exceptionWithHTTPStatus:400 /* Bad Request */ - reason:@"method cannot be invoked on " - @"the specified object"]; - } - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - if ((ex = [[self clientObject] delete]) != nil) { - id url; - - url = [[ex reason] stringByEscapingURL]; - url = [@"view?error=" stringByAppendingString:url]; - return [self redirectToLocation:url]; - //return ex; - } - - if (![self isInlineViewer]) { - // if everything is ok, close the window (send a JS closing the Window) - id page; - - page = [self pageWithName:@"UIxMailWindowCloser"]; - [page takeValue:@"YES" forKey:@"refreshOpener"]; - return page; - } - - return [self redirectToParentFolder]; -} - -- (id) trashAction -{ - NSException *ex; - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - if ((ex = [[self clientObject] trashInContext:context]) != nil) { - id url; - - if ([[[context request] formValueForKey:@"jsonly"] boolValue]) - /* called using XMLHttpRequest */ - return ex; - - url = [[ex reason] stringByEscapingURL]; - url = [@"view?error=" stringByAppendingString:url]; - return [self redirectToLocation:url]; - } - - if ([[[context request] formValueForKey:@"jsonly"] boolValue]) { - /* called using XMLHttpRequest */ - [[context response] setStatus:200 /* OK */]; - return [context response]; - } - - if (![self isInlineViewer]) { - // if everything is ok, close the window (send a JS closing the Window) - id page; - - page = [self pageWithName:@"UIxMailWindowCloser"]; - [page takeValue:@"YES" forKey:@"refreshOpener"]; - return page; - } - - return [self redirectToParentFolder]; -} - -- (id ) moveAction -{ - id result; - NSString *destinationFolder; - id url; - - if ([self isInvokedBySafeMethod]) { - // TODO: fix UI to use POST for unsafe actions - [self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"]; - } - - destinationFolder = [self queryParameterForKey: @"tofolder"]; - if ([destinationFolder length] > 0) - { - result = [[self clientObject] moveToFolderNamed: destinationFolder - inContext: context]; - if (result) - { - if (![[[context request] formValueForKey:@"jsonly"] boolValue]) - { - url = [NSString stringWithFormat: @"view?error=%@", - [[result reason] stringByEscapingURL]]; - result = [self redirectToLocation: url]; - } - } - else - { - result = [context response]; - [result setStatus: 200]; - } - } - else - result = [NSException exceptionWithHTTPStatus:500 /* Server Error */ - reason: @"No destination folder given"]; - - return result; -} - /* generating response */ - (void) appendToResponse: (WOResponse *) _response diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 214330cc8..d6806567c 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -1,435 +1,429 @@ -{ /* -*-javascript-*- */ -requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */ +{ /* -*-java-*- */ + requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */ - publicResources = ( - "uix.css", - "mailer.css", - "mailer.js", - "generic.js", - "searchfield.js", - "UIxAppointmentEditor.js", - "UIxContactEditor.js", - "UIxMailToSelection.js", + publicResources = ("uix.css", + "mailer.css", + "mailer.js", + "generic.js", + "searchfield.js", + "UIxAppointmentEditor.js", + "UIxContactEditor.js", + "UIxMailToSelection.js", - "lori_32x32.png", + "lori_32x32.png", - "tbtv_account_17x17.gif", - "tbtv_drafts_17x17.gif", - "tbtv_inbox_17x17.gif", - "tbtv_junction2_17x17.gif", - "tbtv_junction_17x17.gif", - "tbtv_leaf_corner_17x17.gif", - "tbtv_line_17x17.gif", - "tbtv_minus_17x17.gif", - "tbtv_plus_17x17.gif", - "tbtv_corner_17x17.gif", - "tbtv_corner_minus_17x17.gif", - "tbtv_corner_plus_17x17.gif", - "tbtv_sent_17x17.gif", - "tbtv_trash_17x17.gif", + "tbtv_account_17x17.gif", + "tbtv_drafts_17x17.gif", + "tbtv_inbox_17x17.gif", + "tbtv_junction2_17x17.gif", + "tbtv_junction_17x17.gif", + "tbtv_leaf_corner_17x17.gif", + "tbtv_line_17x17.gif", + "tbtv_minus_17x17.gif", + "tbtv_plus_17x17.gif", + "tbtv_corner_17x17.gif", + "tbtv_corner_minus_17x17.gif", + "tbtv_corner_plus_17x17.gif", + "tbtv_sent_17x17.gif", + "tbtv_trash_17x17.gif", - "tbtb_addressbook.png", - "tbtb_compose.png", - "tbtb_delete.png", - "tbtb_deletedoc.png", - "tbtb_filetofolder.png", - "tbtb_forward.png", - "tbtb_getmail.png", - "tbtb_next.png", - "tbtb_previous.png", - "tbtb_print.png", - "tbtb_reply.png", - "tbtb_replyall.png", - "tbtb_search.png", - "tbtb_trash.png", + "tbtb_addressbook.png", + "tbtb_compose.png", + "tbtb_delete.png", + "tbtb_deletedoc.png", + "tbtb_filetofolder.png", + "tbtb_forward.png", + "tbtb_getmail.png", + "tbtb_next.png", + "tbtb_previous.png", + "tbtb_print.png", + "tbtb_reply.png", + "tbtb_replyall.png", + "tbtb_search.png", + "tbtb_trash.png", - "tbtb_compose_addressbook_30x30.png", - "tbtb_compose_attach_30x30.png", - "tbtb_compose_clip_30x30.png", - "tbtb_compose_cut_30x30.png", - "tbtb_compose_dup_30x30.png", - "tbtb_compose_file_30x30.png", - "tbtb_compose_lock_30x30.png", - "tbtb_compose_quote_30x30.png", - "tbtb_compose_send_30x30.png", - "tbtb_compose_spell_30x30.png", + "tbtb_compose_addressbook_30x30.png", + "tbtb_compose_attach_30x30.png", + "tbtb_compose_clip_30x30.png", + "tbtb_compose_cut_30x30.png", + "tbtb_compose_dup_30x30.png", + "tbtb_compose_file_30x30.png", + "tbtb_compose_lock_30x30.png", + "tbtb_compose_quote_30x30.png", + "tbtb_compose_send_30x30.png", + "tbtb_compose_spell_30x30.png", - "message-mail.png", - "message-mail-read.png", + "message-mail.png", + "message-mail-read.png", - "icon_mark_flagged.gif", - "icon_mark_read.gif", - "icon_mark_unflagged.gif", - "icon_mark_unread.gif", - "icon_read.gif", - "icon_unread.gif", + "icon_mark_flagged.gif", + "icon_mark_read.gif", + "icon_mark_unflagged.gif", + "icon_mark_unread.gif", + "icon_read.gif", + "icon_unread.gif", - "title_attachment_14x14.png", - "title_config.png", - "title_junk.png", - "title_read_14x14.png", - "title_thread.png", - "title_sortdown_12x12.png", - "title_sortup_12x12.png", - ); + "title_attachment_14x14.png", + "title_config.png", + "title_junk.png", + "title_read_14x14.png", + "title_thread.png", + "title_sortdown_12x12.png", + "title_sortup_12x12.png", + ); -factories = { -}; + factories = { + }; -categories = { - SOGoMailFolder = { + categories = { + SOGoMailFolder = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - subscribe = { - protectedBy = ""; - actionClass = "UIxMailFolderActions"; - actionName = "subscribe"; - }; - unsubscribe = { - protectedBy = ""; - actionClass = "UIxMailFolderActions"; - actionName = "unsubscribe"; - }; - quotas = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "quotas"; - }; - view = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - ajax = { - protectedBy = "View"; - pageName = "UIxMailAjaxRequest"; - }; - index = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - GET = { /* hack to make it work as the default method */ - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - markMessageUnread = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "markMessageUnread"; - }; - markMessageRead = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "markMessageRead"; - }; - getMail = { - protectedBy = "View"; - pageName = "UIxMailListView"; - actionName = "getMail"; - }; - expunge = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "emptyTrash"; - }; - createFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "createFolder"; - }; - renameFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "renameFolder"; - }; - deleteFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "deleteFolder"; - }; - userRights = { - protectedBy = "ReadAcls"; - pageName = "UIxMailUserRightsEditor"; - }; - saveUserRights = { - protectedBy = "SaveAcls"; - pageName = "UIxMailUserRightsEditor"; - actionName = "saveUserRights"; - }; + subscribe = { + protectedBy = ""; + actionClass = "UIxMailFolderActions"; + actionName = "subscribe"; + }; + unsubscribe = { + protectedBy = ""; + actionClass = "UIxMailFolderActions"; + actionName = "unsubscribe"; + }; + quotas = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "quotas"; + }; + view = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + ajax = { + protectedBy = "View"; + pageName = "UIxMailAjaxRequest"; + }; + index = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + GET = { /* hack to make it work as the default method */ + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + markMessageUnread = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "markMessageUnread"; + }; + markMessageRead = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "markMessageRead"; + }; + getMail = { + protectedBy = "View"; + pageName = "UIxMailListView"; + actionName = "getMail"; + }; + expunge = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "emptyTrash"; + }; + createFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "createFolder"; + }; + renameFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "renameFolder"; + }; + deleteFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "deleteFolder"; + }; + userRights = { + protectedBy = "ReadAcls"; + pageName = "UIxMailUserRightsEditor"; + }; + saveUserRights = { + protectedBy = "SaveAcls"; + pageName = "UIxMailUserRightsEditor"; + actionName = "saveUserRights"; + }; }; - }; + }; - SOGoTrashFolder = { + SOGoTrashFolder = { /* just a new toolbar, other things come from SOGoMailFolder */ slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - emptyTrash = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "emptyTrash"; - }; + emptyTrash = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "emptyTrash"; + }; }; - }; + }; - SOGoMailObject = { + SOGoMailObject = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailView"; - }; - viewsource = { - protectedBy = "View"; - actionClass = "UIxMailSourceView"; - actionName = "viewSource"; - }; - popupview = { - protectedBy = "View"; - pageName = "UIxMailPopupView"; - }; - move = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "move"; - }; - delete = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "delete"; - }; - trash = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "trash"; - }; - junk = { - protectedBy = "View"; - pageName = "UIxMailView"; - actionName = "junk"; - }; - edit = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "edit"; - }; - reply = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "reply"; - }; - replyall = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "replyToAll"; - }; - forward = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "forward"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailView"; + }; + viewsource = { + protectedBy = "View"; + actionClass = "UIxMailSourceView"; + actionName = "viewSource"; + }; + popupview = { + protectedBy = "View"; + pageName = "UIxMailPopupView"; + }; + move = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "move"; + }; + trash = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "trash"; + }; + junk = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "junk"; + }; + edit = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "edit"; + }; + reply = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "reply"; + }; + replyall = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "replyToAll"; + }; + forward = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "forward"; + }; }; - }; + }; - SOGoMailAccounts = { + SOGoMailAccounts = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailMainFrame"; - }; - compose = { - protectedBy = "View"; - pageName = "UIxMailMainFrame"; - actionName = "compose"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + }; + compose = { + protectedBy = "View"; + pageName = "UIxMailMainFrame"; + actionName = "compose"; + }; }; - }; + }; - SOGoMailAccount = { + SOGoMailAccount = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoMailObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoMailObject.toolbar"; + }; }; methods = { - compose = { - protectedBy = "View"; - actionClass = "UIxMailAccountActions"; - actionName = "compose"; - }; - mailboxes = { - protectedBy = "View"; - actionClass = "UIxMailAccountActions"; - actionName = "listMailboxes"; - }; - createFolder = { - protectedBy = "View"; - actionClass = "UIxMailFolderActions"; - actionName = "createFolder"; - }; + compose = { + protectedBy = "View"; + actionClass = "UIxMailAccountActions"; + actionName = "compose"; + }; + mailboxes = { + protectedBy = "View"; + actionClass = "UIxMailAccountActions"; + actionName = "listMailboxes"; + }; + createFolder = { + protectedBy = "View"; + actionClass = "UIxMailFolderActions"; + actionName = "createFolder"; + }; }; - }; + }; - SOGoDraftsFolder = { + SOGoDraftsFolder = { slots = { - toolbar = { - protectedBy = "View"; - value = ( /* the toolbar groups */ - ( /* first group */ - { link = "getMail"; - image = "tb-mail-getmail-flat-24x24.png"; - cssClass = "tbicon_getmail"; label = "Get Mail"; }, - { - link = "#"; // "compose"; // target = "_blank"; - isSafe = NO; - onclick = "return openMessageWindow(null, 'compose');"; - image = "tb-mail-write-flat-24x24.png"; - cssClass = "tbicon_compose"; label = "Write"; }, - ) - ); - }; + toolbar = { + protectedBy = "View"; + value = ( /* the toolbar groups */ + ( /* first group */ + { link = "getMail"; + image = "tb-mail-getmail-flat-24x24.png"; + cssClass = "tbicon_getmail"; label = "Get Mail"; }, + { + link = "#"; // "compose"; // target = "_blank"; + isSafe = NO; + onclick = "return openMessageWindow(null, 'compose');"; + image = "tb-mail-write-flat-24x24.png"; + cssClass = "tbicon_compose"; label = "Write"; }, + ) + ); + }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; - getMail = { - protectedBy = "View"; - pageName = "UIxMailListView"; - }; + view = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; + getMail = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; }; - }; + }; - SOGoDraftObject = { + SOGoDraftObject = { slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoDraftObject.toolbar"; - }; + toolbar = { + protectedBy = "View"; + value = "SOGoDraftObject.toolbar"; + }; }; methods = { - edit = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - }; - save = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - actionName = "save"; - }; - send = { - protectedBy = "View"; - pageName = "UIxMailEditor"; - actionName = "send"; - }; - delete = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "delete"; - }; - deleteAttachment = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "deleteAttachment"; - }; + edit = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + }; + save = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + actionName = "save"; + }; + send = { + protectedBy = "View"; + pageName = "UIxMailEditor"; + actionName = "send"; + }; + delete = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "delete"; + }; + deleteAttachment = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "deleteAttachment"; + }; }; - }; + }; - /* Sieve */ + /* Sieve */ - /* SOGoSieveScriptsFolder = { - slots = { - toolbar = { - protectedBy = "View"; - value = ( - ( - { - link = "getMail"; - image = "tb-mail-getmail-flat-24x24.png"; - cssClass = "tbicon_getmail"; label = "Get Mail"; - }, - { - link = "#"; // "compose"; // target = "_blank"; - onclick = "clickedNewFilter(this); return false"; - image = "tb-mail-write-flat-24x24.png"; - cssClass = "tbicon_compose"; label = "New Filter"; - }, - ), - ( - { link = "#"; - cssClass = "tbicon_delete"; label = "Delete"; }, - ), - ); - }; - }; - methods = { - view = { - protectedBy = "View"; - pageName = "UIxFilterList"; - }; - create = { - protectedBy = "View"; - pageName = "UIxFilterList"; - actionName = "create"; - }; - }; - }; +// SOGoSieveScriptsFolder = { +// slots = { +// toolbar = { +// protectedBy = "View"; +// value = ( +// ( +// { +// link = "getMail"; +// image = "tb-mail-getmail-flat-24x24.png"; +// cssClass = "tbicon_getmail"; label = "Get Mail"; +// }, +// { +// link = "#"; // "compose"; // target = "_blank"; +// onclick = "clickedNewFilter(this); return false"; +// image = "tb-mail-write-flat-24x24.png"; +// cssClass = "tbicon_compose"; label = "New Filter"; +// }, +// ), +// ( +// { link = "#"; +// cssClass = "tbicon_delete"; label = "Delete"; }, +// ), +// ); +// }; +// }; +// methods = { +// view = { +// protectedBy = "View"; +// pageName = "UIxFilterList"; +// }; +// create = { +// protectedBy = "View"; +// pageName = "UIxFilterList"; +// actionName = "create"; +// }; +// }; +// }; - SOGoSieveScriptObject = { - slots = { - toolbar = { - protectedBy = "View"; - value = ( - ( { link = "#"; - onclick = "clickedEditorSave(this);return false;"; - image = "tb-mail-file-flat-24x24.png"; - cssClass = "tbicon_save"; label = "Save"; }, - { link = "#"; - onclick = "clickedEditorDelete(this);return false;"; - image = "tb-mail-delete-flat-24x24.png"; - cssClass = "tbicon_delete"; label = "Delete"; }, - ) - ); - }; - }; - methods = { - edit = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "edit"; - }; - save = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "save"; - }; - delete = { - protectedBy = "View"; - pageName = "UIxSieveEditor"; - actionName = "delete"; - }; - }; - }; */ -}; +// SOGoSieveScriptObject = { +// slots = { +// toolbar = { +// protectedBy = "View"; +// value = ( +// ( { link = "#"; +// onclick = "clickedEditorSave(this);return false;"; +// image = "tb-mail-file-flat-24x24.png"; +// cssClass = "tbicon_save"; label = "Save"; }, +// { link = "#"; +// onclick = "clickedEditorDelete(this);return false;"; +// image = "tb-mail-delete-flat-24x24.png"; +// cssClass = "tbicon_delete"; label = "Delete"; }, +// ) +// ); +// }; +// }; +// methods = { +// edit = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "edit"; +// }; +// save = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "save"; +// }; +// delete = { +// protectedBy = "View"; +// pageName = "UIxSieveEditor"; +// actionName = "delete"; +// }; +// } + }; } + diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 2fbcdaad1..0e257123c 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -153,7 +153,7 @@ function mailListMarkMessage(event) { if (http) { // TODO: add parameter to signal that we are only interested in OK - http.open("POST", url + "&jsonly=1", false /* not async */); + http.open("POST", url, false /* not async */); http.send(""); if (http.status != 200) { // TODO: refresh page? @@ -229,11 +229,11 @@ function uixDeleteSelectedMessages(sender) { /* send AJAX request (synchronously) */ var messageId = currentMailbox + "/" + rowId; - url = ApplicationBaseURL + messageId + "/trash?jsonly=1"; + url = ApplicationBaseURL + messageId + "/trash"; http = createHTTPClient(); http.open("POST", url, false /* not async */); http.send(""); - if (http.status != 200) { /* request failed */ + if (!isHttpStatus204(http.status)) { /* request failed */ failCount++; http = null; continue; @@ -270,7 +270,7 @@ function moveMessages(rowIds, folder) { var messageId = currentMailbox + "/" + rowIds[i]; url = (ApplicationBaseURL + messageId - + "/move?jsonly=1&tofolder=" + folder); + + "/move?tofolder=" + folder); http = createHTTPClient(); http.open("GET", url, false /* not async */); http.send("");