mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-07 04:47:14 +00:00
Mantis 2040: Calendar - Creation d'un calendrier avec un nom existant
Monotone-Parent: 92b5fc52a3736b8120b0011dacbf4f2aa73c71f9 Monotone-Revision: 7f0d410fd526f1879ea158593030d6d7b46be292 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-08-20T13:02:51 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
a9af949ef6
commit
4b4a31796b
15 files changed
+70
-22
No files matched your search
@@ -42,20 +42,26 @@
|
||||
name = [[context request] formValueForKey: @"name"];
|
||||
if ([name length] > 0)
|
||||
{
|
||||
response = (WOResponse *) [[self clientObject] newFolderWithName: name
|
||||
nameInContainer: &nameInContainer];
|
||||
if (!response)
|
||||
{
|
||||
response = [self responseWithStatus: 201];
|
||||
[response setHeader: @"text/plain; charset=us-ascii"
|
||||
forKey: @"content-type"];
|
||||
[response appendContentString: nameInContainer];
|
||||
}
|
||||
if (![[self clientObject] hasLocalSubFolderNamed: name])
|
||||
{
|
||||
response = (WOResponse *) [[self clientObject] newFolderWithName: name
|
||||
nameInContainer: &nameInContainer];
|
||||
if (!response)
|
||||
{
|
||||
response = [self responseWithStatus: 201];
|
||||
[response setHeader: @"text/plain; charset=us-ascii"
|
||||
forKey: @"content-type"];
|
||||
[response appendContentString: nameInContainer];
|
||||
}
|
||||
}
|
||||
else
|
||||
response = [NSException exceptionWithHTTPStatus: 409
|
||||
reason: @"That name already exists"];
|
||||
}
|
||||
else
|
||||
response = [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"The name is missing"];
|
||||
|
||||
reason: @"The name is missing"];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user