Monotone-Parent: a23a8f2b57305fececc0699f4dbc0d1ae1aaac63
Monotone-Revision: b76970a2508695482a2184b33fcd48d53793fd10 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-03-07T22:09:33 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
50603c67e6
commit
f68812e90f
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2008-03-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Contacts/UIxContactEditor.m ([UIxContactEditor -saveURL]):
|
||||
new accessor that returns the url + "saveAsContact".
|
||||
([UIxContactEditor
|
||||
-shouldTakeValuesFromRequest:requestinContext:context]): changed
|
||||
method to match the one from the event and todo editor module.
|
||||
([UIxContactEditor -editActionName]): changed to "editAsContact".
|
||||
([UIxContactEditor -newAction]): changed method to match the one
|
||||
from the event and todo editor module.
|
||||
|
||||
* UI/Contacts/UIxListView.m: new view module for the VLIST format
|
||||
components.
|
||||
|
||||
* UI/Contacts/UIxListEditor.m: new edition module for the VLIST
|
||||
format components.
|
||||
|
||||
* SoObjects/Contacts/SOGoContactGCSList.m: new controller module
|
||||
for the VLIST format.
|
||||
|
||||
2008-03-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoObject.m ([SOGoObject -isFolderish]): new
|
||||
|
|
|
@ -17,6 +17,8 @@ ContactsUI_OBJC_FILES = \
|
|||
UIxContactsFilterPanel.m \
|
||||
UIxContactView.m \
|
||||
UIxContactEditor.m \
|
||||
UIxListView.m \
|
||||
UIxListEditor.m \
|
||||
UIxContactsListView.m \
|
||||
UIxContactsListViewContainer.m \
|
||||
UIxContactFoldersView.m \
|
||||
|
|
|
@ -25,13 +25,15 @@
|
|||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/SoObject.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
|
||||
#import <NGCards/NGVCard.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
|
||||
#import <Contacts/SOGoContactObject.h>
|
||||
#import <Contacts/SOGoContactFolder.h>
|
||||
#import <Contacts/SOGoContactGCSEntry.h>
|
||||
#import <Contacts/SOGoContactGCSFolder.h>
|
||||
|
||||
#import "UIxContactEditor.h"
|
||||
|
||||
|
@ -57,6 +59,12 @@
|
|||
|
||||
/* accessors */
|
||||
|
||||
- (NSString *) saveURL
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@/saveAsContact",
|
||||
[[self clientObject] baseURL]];
|
||||
}
|
||||
|
||||
- (NSArray *) htmlMailFormatList
|
||||
{
|
||||
static NSArray *htmlMailFormatItems = nil;
|
||||
|
@ -136,10 +144,15 @@
|
|||
|
||||
/* actions */
|
||||
|
||||
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
|
||||
inContext: (WOContext*) _c
|
||||
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request
|
||||
inContext: (WOContext*) context
|
||||
{
|
||||
return YES;
|
||||
NSString *actionName;
|
||||
|
||||
actionName = [[request requestHandlerPath] lastPathComponent];
|
||||
|
||||
return ([[self clientObject] isKindOfClass: [SOGoContactGCSEntry class]]
|
||||
&& [actionName hasPrefix: @"save"]);
|
||||
}
|
||||
|
||||
- (void) _setSnapshotValue: (NSString *) key
|
||||
|
@ -375,7 +388,7 @@
|
|||
- (NSString *) editActionName
|
||||
{
|
||||
/* this is overridden in the mail based contacts UI to redirect to tb.edit */
|
||||
return @"edit";
|
||||
return @"editAsContact";
|
||||
}
|
||||
|
||||
- (CardElement *) _elementWithTag: (NSString *) tag
|
||||
|
@ -492,7 +505,7 @@
|
|||
|
||||
- (id <WOActionResults>) saveAction
|
||||
{
|
||||
id <SOGoContactObject> contact;
|
||||
SOGoContactGCSEntry *contact;
|
||||
id result;
|
||||
NSString *jsRefreshMethod;
|
||||
|
||||
|
@ -552,35 +565,27 @@
|
|||
return [self redirectToLocation: url];
|
||||
}
|
||||
|
||||
#warning Could this be part of a common parent with UIxAppointment/UIxTaskEditor/UIxListEditor ?
|
||||
- (id) newAction
|
||||
{
|
||||
// TODO: this is almost a DUP of UIxAppointmentEditor
|
||||
/*
|
||||
This method creates a unique ID and redirects to the "edit" method on the
|
||||
new ID.
|
||||
It is actually a folder method and should be defined on the folder.
|
||||
|
||||
Note: 'clientObject' is the SOGoAppointmentFolder!
|
||||
Update: remember that there are group folders as well.
|
||||
*/
|
||||
NSString *uri, *objectId, *nextMethod;
|
||||
SOGoObject <SOGoContactFolder> *co;
|
||||
NSString *objectId, *method, *uri;
|
||||
id <WOActionResults> result;
|
||||
SOGoContactGCSFolder *co;
|
||||
|
||||
co = [self clientObject];
|
||||
if ([co respondsToSelector: @selector (globallyUniqueObjectId)])
|
||||
objectId = [co globallyUniqueObjectId];
|
||||
objectId = [co globallyUniqueObjectId];
|
||||
if ([objectId length] > 0)
|
||||
{
|
||||
method = [NSString stringWithFormat:@"%@/%@.vcf/editAsContact",
|
||||
[co soURL], objectId];
|
||||
uri = [self completeHrefForMethod: method];
|
||||
result = [self redirectToLocation: uri];
|
||||
}
|
||||
else
|
||||
objectId = nil;
|
||||
result = [NSException exceptionWithHTTPStatus: 500 /* Internal Error */
|
||||
reason: @"could not create a unique ID"];
|
||||
|
||||
if ([objectId length] == 0)
|
||||
return [NSException exceptionWithHTTPStatus: 500 /* Internal Error */
|
||||
reason: @"could not create a unique ID"];
|
||||
|
||||
nextMethod = [NSString stringWithFormat: @"../%@.vcf/%@",
|
||||
objectId, [self editActionName]];
|
||||
uri = [self _completeURIForMethod: nextMethod];
|
||||
|
||||
return [self redirectToLocation: uri];
|
||||
return result;
|
||||
}
|
||||
|
||||
@end /* UIxContactEditor */
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/* UIxListEditor.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXLISTEDITOR_H
|
||||
#define UIXLISTEDITOR_H
|
||||
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
@interface UIxListEditor : UIxComponent
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXLISTEDITOR_H */
|
|
@ -0,0 +1,61 @@
|
|||
/* UIxListEditor.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <Contacts/SOGoContactGCSFolder.h>
|
||||
|
||||
#import "UIxListEditor.h"
|
||||
|
||||
@implementation UIxListEditor
|
||||
|
||||
- (NSString *) saveURL
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@/saveAsList",
|
||||
[[self clientObject] baseURL]];
|
||||
}
|
||||
|
||||
#warning Could this be part of a common parent with UIxAppointment/UIxTaskEditor/UIxListEditor ?
|
||||
- (id) newAction
|
||||
{
|
||||
NSString *objectId, *method, *uri;
|
||||
id <WOActionResults> result;
|
||||
SOGoContactGCSFolder *co;
|
||||
|
||||
co = [self clientObject];
|
||||
objectId = [co globallyUniqueObjectId];
|
||||
if ([objectId length] > 0)
|
||||
{
|
||||
method = [NSString stringWithFormat:@"%@/%@.vls/editAsList",
|
||||
[co soURL], objectId];
|
||||
uri = [self completeHrefForMethod: method];
|
||||
result = [self redirectToLocation: uri];
|
||||
}
|
||||
else
|
||||
result = [NSException exceptionWithHTTPStatus: 500 /* Internal Error */
|
||||
reason: @"could not create a unique ID"];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,32 @@
|
|||
/* UIxListView.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXLISTVIEW_H
|
||||
#define UIXLISTVIEW_H
|
||||
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
@interface UIxListView : UIxComponent
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXLISTVIEW_H */
|
|
@ -0,0 +1,27 @@
|
|||
/* UIxListView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UIxListView.h"
|
||||
|
||||
@implementation UIxListView
|
||||
|
||||
@end
|
|
@ -77,11 +77,16 @@
|
|||
protectedBy = "View";
|
||||
pageName = "UIxContactsListView";
|
||||
};
|
||||
new = {
|
||||
newcontact = {
|
||||
protectedBy = "Add Documents, Images, and Files";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "new";
|
||||
};
|
||||
newlist = {
|
||||
protectedBy = "Add Documents, Images, and Files";
|
||||
pageName = "UIxListEditor";
|
||||
actionName = "new";
|
||||
};
|
||||
mailer-contacts = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactsListView";
|
||||
|
@ -144,11 +149,20 @@
|
|||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxContactEditor";
|
||||
};
|
||||
editAsContact = {
|
||||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxContactEditor";
|
||||
};
|
||||
save = {
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "save";
|
||||
};
|
||||
saveAsContact = {
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "save";
|
||||
};
|
||||
write = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactEditor";
|
||||
|
@ -157,6 +171,38 @@
|
|||
};
|
||||
};
|
||||
|
||||
SOGoContactGCSList = {
|
||||
methods = {
|
||||
view = {
|
||||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxListView";
|
||||
};
|
||||
delete = {
|
||||
protectedBy = "Delete Objects";
|
||||
pageName = "UIxListView";
|
||||
actionName = "delete";
|
||||
};
|
||||
edit = {
|
||||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxListEditor";
|
||||
};
|
||||
editAsList = {
|
||||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxListEditor";
|
||||
};
|
||||
save = {
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxListEditor";
|
||||
actionName = "save";
|
||||
};
|
||||
saveAsList = {
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxListEditor";
|
||||
actionName = "save";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
SOGoContactLDIFEntry = {
|
||||
methods = {
|
||||
view = {
|
||||
|
@ -176,4 +222,3 @@
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
title="name"
|
||||
const:popup="YES"
|
||||
>
|
||||
<form var:href="clientObject.baseURL" name="editform"
|
||||
<form var:href="saveURL" name="editform"
|
||||
onsubmit="return validateContactEditor()">
|
||||
|
||||
<div class="tabsContainer" id="editorTabs">
|
||||
|
@ -336,17 +336,17 @@
|
|||
</div>
|
||||
<div id="buttons">
|
||||
<input
|
||||
type="submit"
|
||||
id="cancelButton"
|
||||
type="button"
|
||||
class="button"
|
||||
label:value="Cancel"
|
||||
name="cancel"
|
||||
onclick="window.close(); return false;" />
|
||||
name="cancel"/>
|
||||
<var:if condition="canCreateOrModify"
|
||||
><input
|
||||
type="submit"
|
||||
class="button"
|
||||
label:value="Save"
|
||||
name="save:method" /></var:if>
|
||||
name="submit" /></var:if>
|
||||
</div>
|
||||
</form>
|
||||
</var:component>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' standalone='yes'?>
|
||||
<var:component
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
xmlns:uix="OGo:uix"
|
||||
className="UIxPageFrame"
|
||||
title="name"
|
||||
const:popup="YES"
|
||||
>Unimplemented</var:component>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' standalone='yes'?>
|
||||
<var:component
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
xmlns:uix="OGo:uix"
|
||||
className="UIxPageFrame"
|
||||
title="name"
|
||||
const:popup="YES"
|
||||
>Unimplemented</var:component>
|
Loading…
Reference in New Issue