mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-18 11:38:53 +00:00
Monotone-Parent: cc054885aad697b7949d4593db97e45d30d2e276
Monotone-Revision: 7abad0bacab329e28e1ff4cdfbdc624f171b7132 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-18T20:37:18 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
2007-08-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailActions.m ([UIxMailActions -deleteAction]):
|
||||
new category method to reponds to the "delete" web command on
|
||||
drafts.
|
||||
([UIxMailActions -deleteAttachmentAction]): new category method to
|
||||
reponds to the "deleteAttachment" web command on drafts, taking
|
||||
the "filename" url parameter into account.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject
|
||||
-contentForEditing]): new method that retrieve the editable mail
|
||||
content.
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <SoObjects/Mailer/SOGoDraftObject.h>
|
||||
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
|
||||
#import <SoObjects/Mailer/SOGoMailAccount.h>
|
||||
@@ -104,4 +107,46 @@
|
||||
return [self redirectToLocation: newLocation];
|
||||
}
|
||||
|
||||
/* SOGoDraftObject */
|
||||
- (id) deleteAction
|
||||
{
|
||||
SOGoDraftObject *draft;
|
||||
NSException *error;
|
||||
id response;
|
||||
|
||||
draft = [self clientObject];
|
||||
error = [draft delete];
|
||||
if (error)
|
||||
response = error;
|
||||
else
|
||||
{
|
||||
response = [context response];
|
||||
[response setStatus: 204];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
- (WOResponse *) deleteAttachmentAction
|
||||
{
|
||||
WOResponse *response;
|
||||
NSString *filename;
|
||||
|
||||
response = [context response];
|
||||
|
||||
filename = [[context request] formValueForKey: @"filename"];
|
||||
if ([filename length] > 0)
|
||||
{
|
||||
[[self clientObject] deleteAttachmentWithName: filename];
|
||||
[response setStatus: 204];
|
||||
}
|
||||
else
|
||||
{
|
||||
[response setStatus: 500];
|
||||
[response appendContentString: @"How did you end up here?"];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -342,6 +342,16 @@ categories = {
|
||||
pageName = "UIxMailEditor";
|
||||
actionName = "send";
|
||||
};
|
||||
delete = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "delete";
|
||||
};
|
||||
deleteAttachment = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "deleteAttachment";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user