Monotone-Parent: 6de228594e5feb001f4208313d8363017d61a463
Monotone-Revision: b83048b6a7cb04b3bd23bb087f18cf0d7c495d49 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-12T16:42:59 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
9fa766dae5
commit
142dff8d5e
|
@ -1,5 +1,12 @@
|
||||||
2006-10-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2006-10-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -saveAction]),
|
||||||
|
UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor
|
||||||
|
-saveAction]), UI/MailerUI/UIxMailEditor.m ([UIxMailEditor
|
||||||
|
-sendAction]), UI/Contacts/UIxContactEditor.m ([UIxContactEditor
|
||||||
|
-saveAction]):
|
||||||
|
return a UIxJSClose component if everything went fine.
|
||||||
|
|
||||||
* UI/Scheduler/UIxTaskEditor.h: interface extracted from
|
* UI/Scheduler/UIxTaskEditor.h: interface extracted from
|
||||||
UIxTaskEditor.m.
|
UIxTaskEditor.m.
|
||||||
|
|
||||||
|
|
|
@ -366,11 +366,6 @@
|
||||||
return @"edit";
|
return @"edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) contactUID
|
|
||||||
{
|
|
||||||
return [[self clientObject] nameInContainer];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (CardElement *) _elementWithTag: (NSString *) tag
|
- (CardElement *) _elementWithTag: (NSString *) tag
|
||||||
ofType: (NSString *) type
|
ofType: (NSString *) type
|
||||||
{
|
{
|
||||||
|
@ -462,10 +457,11 @@
|
||||||
[self _saveEmails];
|
[self _saveEmails];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) saveAction
|
- (id <WOActionResults>) saveAction
|
||||||
{
|
{
|
||||||
id <SOGoContactObject> contact;
|
id <SOGoContactObject> contact;
|
||||||
id result;
|
id result;
|
||||||
|
NSString *jsRefreshMethod;
|
||||||
|
|
||||||
contact = [self clientObject];
|
contact = [self clientObject];
|
||||||
card = [contact vCard];
|
card = [contact vCard];
|
||||||
|
@ -474,7 +470,15 @@
|
||||||
[self _saveSnapshot];
|
[self _saveSnapshot];
|
||||||
[contact save];
|
[contact save];
|
||||||
|
|
||||||
result = [self redirectToLocation: @".."];
|
if ([[[[self context] request] formValueForKey: @"nojs"] intValue])
|
||||||
|
result = [self redirectToLocation: [self applicationPath]];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jsRefreshMethod
|
||||||
|
= [NSString stringWithFormat: @"refreshContacts(\"%@\")",
|
||||||
|
[contact nameInContainer]];
|
||||||
|
result = [self jsCloseWithRefreshMethod: jsRefreshMethod];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
|
result = [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
UIxMailEditor
|
UIxMailEditor
|
||||||
|
@ -48,16 +48,16 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#include <SoObjects/Mailer/SOGoDraftObject.h>
|
#import <SoObjects/Mailer/SOGoDraftObject.h>
|
||||||
#include <SoObjects/Mailer/SOGoMailFolder.h>
|
#import <SoObjects/Mailer/SOGoMailFolder.h>
|
||||||
#include <SoObjects/Mailer/SOGoMailAccount.h>
|
#import <SoObjects/Mailer/SOGoMailAccount.h>
|
||||||
#include <SoObjects/Mailer/SOGoMailAccounts.h>
|
#import <SoObjects/Mailer/SOGoMailAccounts.h>
|
||||||
#include <SoObjects/Mailer/SOGoMailIdentity.h>
|
#import <SoObjects/Mailer/SOGoMailIdentity.h>
|
||||||
#include <SoObjects/SOGo/WOContext+Agenor.h>
|
#import <SoObjects/SOGo/WOContext+Agenor.h>
|
||||||
#include <NGMail/NGMimeMessage.h>
|
#import <NGMail/NGMimeMessage.h>
|
||||||
#include <NGMail/NGMimeMessageGenerator.h>
|
#import <NGMail/NGMimeMessageGenerator.h>
|
||||||
#include <NGObjWeb/SoSubContext.h>
|
#import <NGObjWeb/SoSubContext.h>
|
||||||
#include "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
@implementation UIxMailEditor
|
@implementation UIxMailEditor
|
||||||
|
|
||||||
|
@ -491,11 +491,13 @@ static NSArray *infoKeys = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)sendAction {
|
- (id <WOActionResults>) sendAction
|
||||||
|
{
|
||||||
NSException *error;
|
NSException *error;
|
||||||
NSString *mailPath;
|
NSString *mailPath;
|
||||||
NSDictionary *h;
|
NSDictionary *h;
|
||||||
|
id <WOActionResults> result;
|
||||||
|
|
||||||
// TODO: need to validate whether we have a To etc
|
// TODO: need to validate whether we have a To etc
|
||||||
|
|
||||||
/* first, save form data */
|
/* first, save form data */
|
||||||
|
@ -553,8 +555,12 @@ static NSArray *infoKeys = nil;
|
||||||
if ((error = [[self clientObject] delete]) != nil)
|
if ((error = [[self clientObject] delete]) != nil)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
// if everything is ok, close the window (send a JS closing the Window)
|
if ([[[[self context] request] formValueForKey: @"nojs"] intValue])
|
||||||
return [self pageWithName:@"UIxMailWindowCloser"];
|
result = [self redirectToLocation: [self applicationPath]];
|
||||||
|
else
|
||||||
|
result = [self jsCloseWithRefreshMethod: nil];
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)deleteAction {
|
- (id)deleteAction {
|
||||||
|
|
|
@ -23,72 +23,6 @@
|
||||||
#import <NGCards/NSCalendarDate+NGCards.h>
|
#import <NGCards/NSCalendarDate+NGCards.h>
|
||||||
|
|
||||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||||
#import <SOGoUI/UIxComponent.h>
|
|
||||||
|
|
||||||
/* TODO: CLEAN UP */
|
|
||||||
|
|
||||||
@class NSString;
|
|
||||||
@class iCalPerson;
|
|
||||||
@class iCalRecurrenceRule;
|
|
||||||
|
|
||||||
@interface UIxAppointmentEditor : UIxComponent
|
|
||||||
{
|
|
||||||
NSString *iCalString;
|
|
||||||
NSString *errorText;
|
|
||||||
id item;
|
|
||||||
|
|
||||||
/* individual values */
|
|
||||||
NSCalendarDate *startDate;
|
|
||||||
NSCalendarDate *endDate;
|
|
||||||
NSCalendarDate *cycleUntilDate;
|
|
||||||
NSString *title;
|
|
||||||
NSString *location;
|
|
||||||
NSString *comment;
|
|
||||||
iCalPerson *organizer;
|
|
||||||
NSArray *participants; /* array of iCalPerson's */
|
|
||||||
NSArray *resources; /* array of iCalPerson's */
|
|
||||||
NSString *priority;
|
|
||||||
NSArray *categories;
|
|
||||||
NSString *accessClass;
|
|
||||||
BOOL isPrivate; /* default: NO */
|
|
||||||
BOOL checkForConflicts; /* default: NO */
|
|
||||||
NSDictionary *cycle;
|
|
||||||
NSString *cycleEnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)iCalStringTemplate;
|
|
||||||
- (NSString *)iCalString;
|
|
||||||
|
|
||||||
- (void)setIsPrivate:(BOOL)_yn;
|
|
||||||
- (void)setAccessClass:(NSString *)_class;
|
|
||||||
|
|
||||||
- (void)setCheckForConflicts:(BOOL)_checkForConflicts;
|
|
||||||
- (BOOL)checkForConflicts;
|
|
||||||
|
|
||||||
- (BOOL)hasCycle;
|
|
||||||
- (iCalRecurrenceRule *)rrule;
|
|
||||||
- (void)adjustCycleControlsForRRule:(iCalRecurrenceRule *)_rrule;
|
|
||||||
- (NSDictionary *)cycleMatchingRRule:(iCalRecurrenceRule *)_rrule;
|
|
||||||
|
|
||||||
- (BOOL)isCycleEndUntil;
|
|
||||||
- (void)setIsCycleEndUntil;
|
|
||||||
- (void)setIsCycleEndNever;
|
|
||||||
|
|
||||||
- (NSString *)_completeURIForMethod:(NSString *)_method;
|
|
||||||
|
|
||||||
- (NSArray *)getICalPersonsFromFormValues:(NSArray *)_values
|
|
||||||
treatAsResource:(BOOL)_isResource;
|
|
||||||
|
|
||||||
- (NSString *)iCalParticipantsAndResourcesStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalParticipantsStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalResourcesStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalStringFromQueryParameter:(NSString *)_qp
|
|
||||||
format:(NSString *)_format;
|
|
||||||
- (NSString *)iCalOrganizerString;
|
|
||||||
|
|
||||||
- (id)acceptOrDeclineAction:(BOOL)_accept;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
#import <NGCards/NGCards.h>
|
#import <NGCards/NGCards.h>
|
||||||
|
@ -99,6 +33,10 @@
|
||||||
#import <Appointments/SOGoAppointmentObject.h>
|
#import <Appointments/SOGoAppointmentObject.h>
|
||||||
#import "UIxComponent+Agenor.h"
|
#import "UIxComponent+Agenor.h"
|
||||||
|
|
||||||
|
#import "UIxAppointmentEditor.h"
|
||||||
|
|
||||||
|
/* TODO: CLEAN UP */
|
||||||
|
|
||||||
@implementation UIxAppointmentEditor
|
@implementation UIxAppointmentEditor
|
||||||
|
|
||||||
+ (int)version {
|
+ (int)version {
|
||||||
|
@ -913,8 +851,8 @@
|
||||||
to:[_apt endDate]];
|
to:[_apt endDate]];
|
||||||
[self debugWithFormat:@" process: %d events", [infos count]];
|
[self debugWithFormat:@" process: %d events", [infos count]];
|
||||||
|
|
||||||
ranges = [infos arrayByCreatingDateRangesFromObjectsWithStartDateKey:@"startDate"
|
ranges = [infos arrayByCreatingDateRangesFromObjectsWithStartDateKey: @"startDate"
|
||||||
andEndDateKey:@"endDate"];
|
andEndDateKey: @"endDate"];
|
||||||
ranges = [ranges arrayByCompactingContainedDateRanges];
|
ranges = [ranges arrayByCompactingContainedDateRanges];
|
||||||
[self debugWithFormat:@" blocked ranges: %@", ranges];
|
[self debugWithFormat:@" blocked ranges: %@", ranges];
|
||||||
|
|
||||||
|
@ -980,9 +918,11 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)saveAction {
|
- (id <WOActionResults>) saveAction
|
||||||
|
{
|
||||||
iCalEvent *apt;
|
iCalEvent *apt;
|
||||||
iCalPerson *p;
|
iCalPerson *p;
|
||||||
|
id <WOActionResults> result;
|
||||||
NSString *content;
|
NSString *content;
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
|
|
||||||
|
@ -1035,7 +975,12 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [self redirectToLocation:[self _completeURIForMethod:@".."]];
|
if ([[[[self context] request] formValueForKey: @"nojs"] intValue])
|
||||||
|
result = [self redirectToLocation: [self applicationPath]];
|
||||||
|
else
|
||||||
|
result = [self jsCloseWithRefreshMethod: @"refreshAppointments()"];
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) saveUrl
|
- (NSString *) saveUrl
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
{
|
{
|
||||||
NSString *iCalString;
|
NSString *iCalString;
|
||||||
NSString *errorText;
|
NSString *errorText;
|
||||||
NSString *action;
|
|
||||||
id item;
|
id item;
|
||||||
|
|
||||||
/* individual values */
|
/* individual values */
|
||||||
|
|
|
@ -23,73 +23,11 @@
|
||||||
#import <NGCards/NSCalendarDate+NGCards.h>
|
#import <NGCards/NSCalendarDate+NGCards.h>
|
||||||
|
|
||||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||||
#import <SOGoUI/UIxComponent.h>
|
|
||||||
|
#import "UIxTaskEditor.h"
|
||||||
|
|
||||||
/* TODO: CLEAN UP */
|
/* TODO: CLEAN UP */
|
||||||
|
|
||||||
@class NSString;
|
|
||||||
@class iCalPerson;
|
|
||||||
@class iCalRecurrenceRule;
|
|
||||||
|
|
||||||
@interface UIxTaskEditor : UIxComponent
|
|
||||||
{
|
|
||||||
NSString *iCalString;
|
|
||||||
NSString *errorText;
|
|
||||||
id item;
|
|
||||||
|
|
||||||
/* individual values */
|
|
||||||
NSCalendarDate *startDate;
|
|
||||||
NSCalendarDate *dueDate;
|
|
||||||
NSCalendarDate *cycleUntilDate;
|
|
||||||
NSString *title;
|
|
||||||
NSString *location;
|
|
||||||
NSString *comment;
|
|
||||||
iCalPerson *organizer;
|
|
||||||
NSArray *participants; /* array of iCalPerson's */
|
|
||||||
NSArray *resources; /* array of iCalPerson's */
|
|
||||||
NSString *priority;
|
|
||||||
NSArray *categories;
|
|
||||||
NSString *accessClass;
|
|
||||||
BOOL isPrivate; /* default: NO */
|
|
||||||
BOOL checkForConflicts; /* default: NO */
|
|
||||||
NSDictionary *cycle;
|
|
||||||
NSString *cycleEnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)iCalStringTemplate;
|
|
||||||
- (NSString *)iCalString;
|
|
||||||
|
|
||||||
- (void)setIsPrivate:(BOOL)_yn;
|
|
||||||
- (void)setAccessClass:(NSString *)_class;
|
|
||||||
|
|
||||||
- (void)setCheckForConflicts:(BOOL)_checkForConflicts;
|
|
||||||
- (BOOL)checkForConflicts;
|
|
||||||
|
|
||||||
- (BOOL)hasCycle;
|
|
||||||
- (iCalRecurrenceRule *)rrule;
|
|
||||||
- (void)adjustCycleControlsForRRule:(iCalRecurrenceRule *)_rrule;
|
|
||||||
- (NSDictionary *)cycleMatchingRRule:(iCalRecurrenceRule *)_rrule;
|
|
||||||
|
|
||||||
- (BOOL)isCycleEndUntil;
|
|
||||||
- (void)setIsCycleEndUntil;
|
|
||||||
- (void)setIsCycleEndNever;
|
|
||||||
|
|
||||||
- (NSString *)_completeURIForMethod:(NSString *)_method;
|
|
||||||
|
|
||||||
- (NSArray *)getICalPersonsFromFormValues:(NSArray *)_values
|
|
||||||
treatAsResource:(BOOL)_isResource;
|
|
||||||
|
|
||||||
- (NSString *)iCalParticipantsAndResourcesStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalParticipantsStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalResourcesStringFromQueryParameters;
|
|
||||||
- (NSString *)iCalStringFromQueryParameter:(NSString *)_qp
|
|
||||||
format:(NSString *)_format;
|
|
||||||
- (NSString *)iCalOrganizerString;
|
|
||||||
|
|
||||||
- (id)acceptOrDeclineAction:(BOOL)_accept;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
#import <NGCards/NGCards.h>
|
#import <NGCards/NGCards.h>
|
||||||
#import <NGExtensions/NGCalendarDateRange.h>
|
#import <NGExtensions/NGCalendarDateRange.h>
|
||||||
|
@ -145,10 +83,13 @@
|
||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (void)setItem:(id)_item {
|
- (void) setItem: (id) _item
|
||||||
|
{
|
||||||
ASSIGN(item, _item);
|
ASSIGN(item, _item);
|
||||||
}
|
}
|
||||||
- (id)item {
|
|
||||||
|
- (id) item
|
||||||
|
{
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,8 +619,8 @@
|
||||||
/* save */
|
/* save */
|
||||||
|
|
||||||
/* returned dates are in GMT */
|
/* returned dates are in GMT */
|
||||||
- (NSArray *)getICalPersonsFromFormValues:(NSArray *)_values
|
- (NSArray *) getICalPersonsFromFormValues: (NSArray *) _values
|
||||||
treatAsResource:(BOOL)_isResource
|
treatAsResource: (BOOL) _isResource
|
||||||
{
|
{
|
||||||
unsigned i, count;
|
unsigned i, count;
|
||||||
NSMutableArray *result;
|
NSMutableArray *result;
|
||||||
|
@ -905,7 +846,7 @@
|
||||||
[self debugWithFormat:@" process: %d tasks", [infos count]];
|
[self debugWithFormat:@" process: %d tasks", [infos count]];
|
||||||
|
|
||||||
ranges = [infos arrayByCreatingDateRangesFromObjectsWithStartDateKey:@"startDate"
|
ranges = [infos arrayByCreatingDateRangesFromObjectsWithStartDateKey:@"startDate"
|
||||||
andDueDateKey:@"dueDate"];
|
andEndDateKey:@"dueDate"];
|
||||||
ranges = [ranges arrayByCompactingContainedDateRanges];
|
ranges = [ranges arrayByCompactingContainedDateRanges];
|
||||||
[self debugWithFormat:@" blocked ranges: %@", ranges];
|
[self debugWithFormat:@" blocked ranges: %@", ranges];
|
||||||
|
|
||||||
|
@ -929,11 +870,14 @@
|
||||||
|
|
||||||
/* actions */
|
/* actions */
|
||||||
|
|
||||||
- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
|
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
|
||||||
|
inContext: (WOContext*) _c
|
||||||
|
{
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)testAction {
|
- (id) testAction
|
||||||
|
{
|
||||||
/* for testing only */
|
/* for testing only */
|
||||||
WORequest *req;
|
WORequest *req;
|
||||||
iCalToDo *task;
|
iCalToDo *task;
|
||||||
|
@ -950,9 +894,10 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id<WOActionResults>)defaultAction {
|
- (id <WOActionResults>) defaultAction
|
||||||
|
{
|
||||||
NSString *ical;
|
NSString *ical;
|
||||||
|
|
||||||
/* load iCalendar file */
|
/* load iCalendar file */
|
||||||
|
|
||||||
// TODO: can't we use [clientObject contentAsString]?
|
// TODO: can't we use [clientObject contentAsString]?
|
||||||
|
@ -968,31 +913,35 @@
|
||||||
/* TODO: we need proper ACLs */
|
/* TODO: we need proper ACLs */
|
||||||
return [self redirectToLocation:[self _completeURIForMethod:@"../view"]];
|
return [self redirectToLocation:[self _completeURIForMethod:@"../view"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)saveAction {
|
- (id <WOActionResults>) saveAction
|
||||||
|
{
|
||||||
iCalToDo *task;
|
iCalToDo *task;
|
||||||
iCalPerson *p;
|
iCalPerson *p;
|
||||||
|
id <WOActionResults> result;
|
||||||
NSString *content;
|
NSString *content;
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
|
|
||||||
if (![self isWriteableClientObject]) {
|
if (![self isWriteableClientObject]) {
|
||||||
/* return 400 == Bad Request */
|
/* return 400 == Bad Request */
|
||||||
return [NSException exceptionWithHTTPStatus:400
|
return [NSException exceptionWithHTTPStatus:400
|
||||||
reason:@"method cannot be invoked on "
|
reason: @"method cannot be invoked on "
|
||||||
@"the specified object"];
|
@"the specified object"];
|
||||||
}
|
}
|
||||||
|
|
||||||
task = [self taskFromString: [self iCalString]];
|
task = [self taskFromString: [self iCalString]];
|
||||||
if (task == nil) {
|
if (task == nil) {
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
||||||
s = [self labelForKey:@"Invalid iCal data!"];
|
s = [self labelForKey: @"Invalid iCal data!"];
|
||||||
[self setErrorText:s];
|
[self setErrorText: s];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self saveValuesIntoTask:task];
|
[self saveValuesIntoTask:task];
|
||||||
p = [task findParticipantWithEmail:[self emailForUser]];
|
p = [task findParticipantWithEmail:[self emailForUser]];
|
||||||
if (p) {
|
if (p) {
|
||||||
|
@ -1015,8 +964,8 @@
|
||||||
if (content == nil) {
|
if (content == nil) {
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
||||||
s = [self labelForKey:@"Could not create iCal data!"];
|
s = [self labelForKey: @"Could not create iCal data!"];
|
||||||
[self setErrorText:s];
|
[self setErrorText: s];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1025,8 +974,13 @@
|
||||||
[self setErrorText:[ex reason]];
|
[self setErrorText:[ex reason]];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [self redirectToLocation:[self _completeURIForMethod:@".."]];
|
if ([[[[self context] request] formValueForKey: @"nojs"] intValue])
|
||||||
|
result = [self redirectToLocation: [self applicationPath]];
|
||||||
|
else
|
||||||
|
result = [self jsCloseWithRefreshMethod: @"refreshTasks()"];
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) changeStatusAction
|
- (id) changeStatusAction
|
||||||
|
|
|
@ -344,8 +344,7 @@
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
label:value="Save"
|
label:value="Save"
|
||||||
name="save:method"
|
name="save:method" />
|
||||||
onclick="submitContact(this.form); return false;" />
|
|
||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
|
@ -358,11 +357,10 @@
|
||||||
label:value="PouetPouet"
|
label:value="PouetPouet"
|
||||||
name="pouet"
|
name="pouet"
|
||||||
onclick="showCoords(this); return false;" /> -->
|
onclick="showCoords(this); return false;" /> -->
|
||||||
<input type="hidden" id="jsaction" />
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
initEditorForm('<var:string value="contactUID" />');
|
initEditorForm();
|
||||||
</script>
|
</script>
|
||||||
</var:component>
|
</var:component>
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
<script type="text/javascript" rsrc:src="skycalendar.js">
|
<script type="text/javascript" rsrc:src="skycalendar.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form var:href="saveUrl" name="editform">
|
<form var:href="saveUrl" name="editform" onsubmit="return validateAptEditor();">
|
||||||
|
|
||||||
<var:if condition="hasErrorText">
|
<var:if condition="hasErrorText">
|
||||||
<p style="background-color: #AA0000;">
|
<p style="background-color: #AA0000;">
|
||||||
<var:string value="errorText" />
|
<var:string value="errorText" />
|
||||||
|
@ -113,8 +112,7 @@
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
label:value="Save"
|
label:value="Save"
|
||||||
name="submitmeeting"
|
name="submitmeeting" />
|
||||||
onclick="submitMeeting(this.form);" />
|
|
||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
<?xml version='1.0' standalone='yes'?>
|
<?xml version='1.0' standalone='yes'?>
|
||||||
<var:component
|
<var:component className="UIxPageFrame"
|
||||||
xmlns="http://www.w3.org/1999/xhtml"
|
xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:var="http://www.skyrix.com/od/binding"
|
xmlns:var="http://www.skyrix.com/od/binding"
|
||||||
xmlns:const="http://www.skyrix.com/od/constant"
|
xmlns:const="http://www.skyrix.com/od/constant"
|
||||||
xmlns:uix="OGo:uix"
|
xmlns:uix="OGo:uix"
|
||||||
xmlns:rsrc="OGo:url"
|
xmlns:rsrc="OGo:url"
|
||||||
xmlns:label="OGo:label"
|
xmlns:label="OGo:label"
|
||||||
className="UIxPageFrame"
|
|
||||||
const:popup="YES"
|
const:popup="YES"
|
||||||
title="name"
|
title="name">
|
||||||
>
|
|
||||||
<script type="text/javascript" rsrc:src="skycalendar.js">
|
<script type="text/javascript" rsrc:src="skycalendar.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form var:href="saveUrl" name="editform">
|
<form var:href="saveUrl" name="editform" onsubmit="return validateAptEditor();">
|
||||||
|
|
||||||
<var:if condition="hasErrorText">
|
<var:if condition="hasErrorText">
|
||||||
<p style="background-color: #AA0000;">
|
<p style="background-color: #AA0000;">
|
||||||
<var:string value="errorText" />
|
<var:string value="errorText" />
|
||||||
|
@ -39,20 +36,20 @@
|
||||||
/><var:string label:value="is private" /></label>
|
/><var:string label:value="is private" /></label>
|
||||||
<span class="checkBoxList"><var:string label:value="Date" />
|
<span class="checkBoxList"><var:string label:value="Date" />
|
||||||
<span class="content"><var:component className="UIxTimeDateControl"
|
<span class="content"><var:component className="UIxTimeDateControl"
|
||||||
const:controlID="startTime"
|
const:controlID="startTime"
|
||||||
date="taskStartDate"
|
date="taskStartDate"
|
||||||
const:dayStartHour="8"
|
const:dayStartHour="8"
|
||||||
const:dayEndHour="18"
|
const:dayEndHour="18"
|
||||||
/></span></span>
|
/></span></span>
|
||||||
<a class="button" href="#" onclick="return toggleDetails();" id="detailsButton"
|
<a class="button" href="#" onclick="return toggleDetails();" id="detailsButton"
|
||||||
><var:string label:value="Show Details" /></a>
|
><var:string label:value="Show Details" /></a>
|
||||||
<span class="checkBoxList"><var:string label:value="Due Time" />
|
<span class="checkBoxList"><var:string label:value="Due Time" />
|
||||||
<span class="content"><var:component className="UIxTimeDateControl"
|
<span class="content"><var:component className="UIxTimeDateControl"
|
||||||
const:controlID="endTime"
|
const:controlID="endTime"
|
||||||
date="taskDueDate"
|
date="taskDueDate"
|
||||||
const:dayStartHour="8"
|
const:dayStartHour="8"
|
||||||
const:dayEndHour="18"
|
const:dayEndHour="18"
|
||||||
/></span></span>
|
/></span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="details">
|
<div id="details">
|
||||||
|
@ -68,7 +65,7 @@
|
||||||
><var:popup list="cycles" item="item"
|
><var:popup list="cycles" item="item"
|
||||||
label:string="$cycleLabel"
|
label:string="$cycleLabel"
|
||||||
selection="cycle"
|
selection="cycle"
|
||||||
const:onChange="toggleCycleVisibility(this, 'cycleSelectionFirstLevel', 0);"
|
const:onChange="toggleCycleVisibility(this, 'cycleSelectionFirstLevel', 0);"
|
||||||
/><span id="cycleSelectionFirstLevel"
|
/><span id="cycleSelectionFirstLevel"
|
||||||
><var:popup list="cycleEnds" item="item"
|
><var:popup list="cycleEnds" item="item"
|
||||||
label:string="$item" value="item"
|
label:string="$item" value="item"
|
||||||
|
@ -101,20 +98,22 @@
|
||||||
/></span></span>
|
/></span></span>
|
||||||
|
|
||||||
<label><var:string label:value="Priority" />
|
<label><var:string label:value="Priority" />
|
||||||
<var:popup list="priorities" item="item"
|
<var:popup list="priorities" item="item"
|
||||||
string="itemPriorityText" selection="priority" /></label>
|
string="itemPriorityText" selection="priority" /></label>
|
||||||
|
|
||||||
<label><var:string label:value="Comment"
|
<label><var:string label:value="Comment"
|
||||||
/><textarea name="comment" var:value="comment" /></label>
|
/><textarea name="comment" var:value="comment" /></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="ical" var:value="iCalString" />
|
||||||
|
<noscript><input type="hidden" name="nojs" const:value="1" /></noscript>
|
||||||
|
|
||||||
<div id="buttons">
|
<div id="buttons">
|
||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
label:value="Save"
|
label:value="Save"
|
||||||
name="submittask"
|
name="submittask" />
|
||||||
onclick="submitTask(this.form);" />
|
|
||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
class="button"
|
class="button"
|
||||||
|
@ -127,8 +126,6 @@
|
||||||
value="Test" name="test:method" />
|
value="Test" name="test:method" />
|
||||||
</var:if>
|
</var:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="ical" var:value="iCalString" />
|
|
||||||
<!-- input type="hidden" id="jsaction" -->
|
<!-- input type="hidden" id="jsaction" -->
|
||||||
</form>
|
</form>
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -99,24 +99,6 @@ function validateAptEditor() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitMeeting(thisForm) {
|
|
||||||
// var action = document.getElementById('jsaction');
|
|
||||||
// action.setAttribute("name", "save:method");
|
|
||||||
// action.setAttribute("value", "save");
|
|
||||||
|
|
||||||
log ("form: " + thisForm);
|
|
||||||
log ("validating...");
|
|
||||||
if (validateAptEditor()) {
|
|
||||||
log ("submitting");
|
|
||||||
thisForm.submit();
|
|
||||||
log ("setting timeout...");
|
|
||||||
window.opener.setTimeout('refreshAppointments();', 200);
|
|
||||||
log ("we close...");
|
|
||||||
window.close();
|
|
||||||
log ("closed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleDetails() {
|
function toggleDetails() {
|
||||||
var div = $("details");
|
var div = $("details");
|
||||||
var buttons = $("buttons");
|
var buttons = $("buttons");
|
||||||
|
|
|
@ -95,19 +95,6 @@ function validateContactEditor() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitContact(thisForm) {
|
|
||||||
var action = $('jsaction');
|
|
||||||
action.setAttribute("name", "save:method");
|
|
||||||
action.setAttribute("value", "save");
|
|
||||||
|
|
||||||
if (validateContactEditor()) {
|
|
||||||
thisForm.submit();
|
|
||||||
if (window.opener.refreshContacts)
|
|
||||||
window.opener.setTimeout("refreshContacts(\""+ self.contactId +"\");", 200);
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showCoords(node) {
|
function showCoords(node) {
|
||||||
node = $("givenName");
|
node = $("givenName");
|
||||||
window.alert("x: " + node.cascadeLeftOffset()
|
window.alert("x: " + node.cascadeLeftOffset()
|
||||||
|
@ -140,8 +127,7 @@ function onFnNewValue(event) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initEditorForm(contactId) {
|
function initEditorForm() {
|
||||||
self.contactId = contactId;
|
|
||||||
displayNameChanged = ($("fn").value.length > 0);
|
displayNameChanged = ($("fn").value.length > 0);
|
||||||
$("fn").onkeydown = onFnKeyDown;
|
$("fn").onkeydown = onFnKeyDown;
|
||||||
$("sn").onkeyup = onFnNewValue;
|
$("sn").onkeyup = onFnNewValue;
|
||||||
|
|
|
@ -99,25 +99,6 @@ function validateAptEditor() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitTask(thisForm) {
|
|
||||||
// var action = document.getElementById('jsaction');
|
|
||||||
// action.setAttribute("name", "save:method");
|
|
||||||
// action.setAttribute("value", "save");
|
|
||||||
|
|
||||||
window.opener.log ("form: " + thisForm);
|
|
||||||
|
|
||||||
window.opener.log ("validating...");
|
|
||||||
if (validateAptEditor()) {
|
|
||||||
window.opener.log ("submitting");
|
|
||||||
thisForm.submit();
|
|
||||||
window.opener.log ("setting timeout...");
|
|
||||||
window.opener.setTimeout('refreshTasks();', 200);
|
|
||||||
window.opener.log ("we close...");
|
|
||||||
window.close();
|
|
||||||
window.opener.log ("closed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleDetails() {
|
function toggleDetails() {
|
||||||
var div = $("details");
|
var div = $("details");
|
||||||
var buttons = $("buttons");
|
var buttons = $("buttons");
|
||||||
|
|
Loading…
Reference in New Issue