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:
Wolfgang Sourdeau
2007-08-18 20:37:18 +00:00
parent 95566592e5
commit 4292a8bf50
3 changed files with 62 additions and 0 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -342,6 +342,16 @@ categories = {
pageName = "UIxMailEditor";
actionName = "send";
};
delete = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "delete";
};
deleteAttachment = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "deleteAttachment";
};
};
};