mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-15 05:14:53 +00:00
Monotone-Parent: 463195ab0268a4a769eab22f23b6aecf0c87ad79
Monotone-Revision: 9abbb51cbabcad645190865841814453369fa85f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-18T10:16:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -11,16 +11,12 @@ CommonUI_LANGUAGES = English French German
|
||||
CommonUI_OBJC_FILES += \
|
||||
CommonUIProduct.m \
|
||||
UIxPageFrame.m \
|
||||
UIxPrintPageFrame.m \
|
||||
UIxAppNavView.m \
|
||||
\
|
||||
UIxAclEditor.m \
|
||||
UIxObjectActions.m \
|
||||
UIxFolderActions.m \
|
||||
UIxParentFolderActions.m \
|
||||
UIxElemBuilder.m \
|
||||
UIxTabView.m \
|
||||
UIxTabItem.m \
|
||||
UIxUserRightsEditor.m \
|
||||
\
|
||||
UIxToolbar.m \
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
NSString *toolbar;
|
||||
id item;
|
||||
BOOL isPopup;
|
||||
NSMutableArray *additionalCSSFiles;
|
||||
NSMutableArray *additionalJSFiles;
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,29 @@
|
||||
return ([[self productJavaScriptURL] length] > 0);
|
||||
}
|
||||
|
||||
- (void) setCssFiles: (NSString *) newCSSFiles
|
||||
{
|
||||
NSEnumerator *cssFiles;
|
||||
NSString *currentFile, *filename;
|
||||
|
||||
[additionalCSSFiles release];
|
||||
additionalCSSFiles = [NSMutableArray new];
|
||||
|
||||
cssFiles
|
||||
= [[newCSSFiles componentsSeparatedByString: @","] objectEnumerator];
|
||||
while ((currentFile = [cssFiles nextObject]))
|
||||
{
|
||||
filename = [self urlForResourceFilename:
|
||||
[currentFile stringByTrimmingSpaces]];
|
||||
[additionalCSSFiles addObject: filename];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *) additionalCSSFiles
|
||||
{
|
||||
return additionalCSSFiles;
|
||||
}
|
||||
|
||||
- (void) setJsFiles: (NSString *) newJSFiles
|
||||
{
|
||||
NSEnumerator *jsFiles;
|
||||
|
||||
@@ -19,6 +19,7 @@ Attendees = "Attendees";
|
||||
request_info = "invites you to participate in a meeting.";
|
||||
"Add to calendar" = "Add to calendar";
|
||||
"Delete from calendar" = "Delete from calendar";
|
||||
"Update status" = "Update status";
|
||||
Accept = "Accept";
|
||||
Decline = "Decline";
|
||||
Tentative = "Tentative";
|
||||
|
||||
@@ -19,6 +19,7 @@ Attendees = "Invités";
|
||||
request_info = "vous invite à une réunion.";
|
||||
"Add to calendar" = "Ajouter à l'agenda";
|
||||
"Delete from calendar" = "Effacer de l'agenda";
|
||||
"Update status" = "Intégrer les modifications";
|
||||
Accept = "Accepter";
|
||||
Decline = "Decliner";
|
||||
Tentative = "Tentative";
|
||||
|
||||
@@ -19,6 +19,7 @@ Attendees = "Attendees";
|
||||
request_info = "invites you to participate in a meeting.";
|
||||
"Add to calendar" = "Add to calendar";
|
||||
"Delete from calendar" = "Delete from calendar";
|
||||
"Update status" = "Update status";
|
||||
Accept = "Accept";
|
||||
Decline = "Decline";
|
||||
Tentative = "Tentative";
|
||||
|
||||
@@ -26,12 +26,17 @@
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <NGCards/iCalCalendar.h>
|
||||
#import <NGCards/iCalEvent.h>
|
||||
#import <NGCards/iCalPerson.h>
|
||||
|
||||
#import <UI/Common/WODirectAction+SOGo.h>
|
||||
|
||||
#import <NGImap4/NGImap4EnvelopeAddress.h>
|
||||
|
||||
#import <SoObjects/Appointments/iCalPerson+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Mailer/SOGoMailObject.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/iCalEntityObject+Utilities.h>
|
||||
#import <SoObjects/Mailer/SOGoMailBodyPart.h>
|
||||
@@ -58,12 +63,12 @@
|
||||
}
|
||||
|
||||
- (SOGoAppointmentObject *) _eventObjectWithUID: (NSString *) uid
|
||||
forUser: (SOGoUser *) user
|
||||
{
|
||||
SOGoAppointmentFolder *personalFolder;
|
||||
SOGoAppointmentObject *eventObject;
|
||||
|
||||
personalFolder
|
||||
= [[context activeUser] personalCalendarFolderInContext: context];
|
||||
personalFolder = [user personalCalendarFolderInContext: context];
|
||||
eventObject = [personalFolder lookupName: uid
|
||||
inContext: context acquire: NO];
|
||||
if (![eventObject isKindOfClass: [SOGoAppointmentObject class]])
|
||||
@@ -73,6 +78,11 @@
|
||||
return eventObject;
|
||||
}
|
||||
|
||||
- (SOGoAppointmentObject *) _eventObjectWithUID: (NSString *) uid
|
||||
{
|
||||
return [self _eventObjectWithUID: uid forUser: [context activeUser]];
|
||||
}
|
||||
|
||||
- (iCalEvent *)
|
||||
_setupChosenEventAndEventObject: (SOGoAppointmentObject **) eventObject
|
||||
{
|
||||
@@ -86,7 +96,7 @@
|
||||
chosenEvent = emailEvent;
|
||||
else
|
||||
{
|
||||
calendarEvent = (iCalEvent *) [*eventObject component: NO];
|
||||
calendarEvent = (iCalEvent *) [*eventObject component: NO secure: NO];
|
||||
if ([calendarEvent compare: emailEvent] == NSOrderedAscending)
|
||||
chosenEvent = emailEvent;
|
||||
else
|
||||
@@ -99,14 +109,42 @@
|
||||
return chosenEvent;
|
||||
}
|
||||
|
||||
#warning this is code copied from SOGoAppointmentObject...
|
||||
- (void) _updateAttendee: (iCalPerson *) attendee
|
||||
withSequence: (NSNumber *) sequence
|
||||
andCalUID: (NSString *) calUID
|
||||
forUID: (NSString *) uid
|
||||
{
|
||||
SOGoAppointmentObject *eventObject;
|
||||
iCalEvent *event;
|
||||
iCalPerson *otherAttendee;
|
||||
NSString *iCalString;
|
||||
|
||||
eventObject = [self _eventObjectWithUID: calUID
|
||||
forUser: [SOGoUser userWithLogin: uid roles: nil]];
|
||||
if (![eventObject isNew])
|
||||
{
|
||||
event = [eventObject component: NO secure: NO];
|
||||
if ([[event sequence] compare: sequence]
|
||||
== NSOrderedSame)
|
||||
{
|
||||
otherAttendee
|
||||
= [event findParticipantWithEmail: [attendee rfc822Email]];
|
||||
[otherAttendee setPartStat: [attendee partStat]];
|
||||
iCalString = [[event parent] versitString];
|
||||
[eventObject saveContentString: iCalString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (WOResponse *) _changePartStatusAction: (NSString *) newStatus
|
||||
{
|
||||
WOResponse *response;
|
||||
SOGoAppointmentObject *eventObject;
|
||||
iCalEvent *chosenEvent;
|
||||
iCalPerson *user;
|
||||
iCalCalendar *calendar;
|
||||
NSString *rsvp, *method;
|
||||
iCalCalendar *emailCalendar, *calendar;
|
||||
NSString *rsvp, *method, *organizerUID;
|
||||
|
||||
chosenEvent = [self _setupChosenEventAndEventObject: &eventObject];
|
||||
if (chosenEvent)
|
||||
@@ -114,7 +152,8 @@
|
||||
user = [chosenEvent findParticipant: [context activeUser]];
|
||||
[user setPartStat: newStatus];
|
||||
calendar = [chosenEvent parent];
|
||||
method = [[calendar method] lowercaseString];
|
||||
emailCalendar = [[self _emailEvent] parent];
|
||||
method = [[emailCalendar method] lowercaseString];
|
||||
if ([method isEqualToString: @"request"])
|
||||
{
|
||||
[calendar setMethod: @""];
|
||||
@@ -123,8 +162,12 @@
|
||||
else
|
||||
rsvp = nil;
|
||||
[eventObject saveContentString: [calendar versitString]];
|
||||
if (rsvp && [rsvp isEqualToString: @"true"])
|
||||
if ([rsvp isEqualToString: @"true"])
|
||||
[eventObject sendResponseToOrganizer];
|
||||
organizerUID = [[chosenEvent organizer] uid];
|
||||
if (organizerUID)
|
||||
[self _updateAttendee: user withSequence: [chosenEvent sequence]
|
||||
andCalUID: [chosenEvent uid] forUID: organizerUID];
|
||||
response = [self responseWith204];
|
||||
}
|
||||
else
|
||||
@@ -146,6 +189,97 @@
|
||||
return [self _changePartStatusAction: @"DECLINED"];
|
||||
}
|
||||
|
||||
- (WOResponse *) deleteFromCalendarAction
|
||||
{
|
||||
iCalEvent *emailEvent;
|
||||
SOGoAppointmentObject *eventObject;
|
||||
WOResponse *response;
|
||||
|
||||
emailEvent = [self _emailEvent];
|
||||
if (emailEvent)
|
||||
{
|
||||
eventObject = [self _eventObjectWithUID: [emailEvent uid]];
|
||||
response = [self responseWith204];
|
||||
}
|
||||
else
|
||||
{
|
||||
response = [context response];
|
||||
[response setStatus: 409];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
- (iCalPerson *) _emailParticipantWithEvent: (iCalEvent *) event
|
||||
{
|
||||
NSString *emailFrom;
|
||||
SOGoMailObject *mailObject;
|
||||
NGImap4EnvelopeAddress *address;
|
||||
|
||||
mailObject = [[self clientObject] mailObject];
|
||||
address = [[mailObject fromEnvelopeAddresses] objectAtIndex: 0];
|
||||
emailFrom = [address baseEMail];
|
||||
|
||||
return [event findParticipantWithEmail: emailFrom];
|
||||
}
|
||||
|
||||
- (BOOL) _updateParticipantStatusInEvent: (iCalEvent *) calendarEvent
|
||||
fromEvent: (iCalEvent *) emailEvent
|
||||
inObject: (SOGoAppointmentObject *) eventObject
|
||||
{
|
||||
iCalPerson *calendarParticipant, *mailParticipant;
|
||||
NSString *partStat;
|
||||
BOOL result;
|
||||
|
||||
calendarParticipant = [self _emailParticipantWithEvent: calendarEvent];
|
||||
mailParticipant = [self _emailParticipantWithEvent: emailEvent];
|
||||
if (calendarParticipant && mailParticipant)
|
||||
{
|
||||
result = YES;
|
||||
partStat = [mailParticipant partStat];
|
||||
if ([partStat caseInsensitiveCompare: [calendarParticipant partStat]]
|
||||
!= NSOrderedSame)
|
||||
{
|
||||
[calendarParticipant setPartStat: [partStat uppercaseString]];
|
||||
[eventObject saveComponent: calendarEvent];
|
||||
}
|
||||
}
|
||||
else
|
||||
result = NO;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (WOResponse *) updateUserStatusAction
|
||||
{
|
||||
iCalEvent *emailEvent, *calendarEvent;
|
||||
SOGoAppointmentObject *eventObject;
|
||||
WOResponse *response;
|
||||
|
||||
response = nil;
|
||||
|
||||
emailEvent = [self _emailEvent];
|
||||
if (emailEvent)
|
||||
{
|
||||
eventObject = [self _eventObjectWithUID: [emailEvent uid]];
|
||||
calendarEvent = [eventObject component: NO secure: NO];
|
||||
if (([[emailEvent sequence] compare: [calendarEvent sequence]]
|
||||
!= NSOrderedDescending)
|
||||
&& ([self _updateParticipantStatusInEvent: calendarEvent
|
||||
fromEvent: emailEvent
|
||||
inObject: eventObject]))
|
||||
response = [self responseWith204];
|
||||
}
|
||||
|
||||
if (!response)
|
||||
{
|
||||
response = [context response];
|
||||
[response setStatus: 409];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
// - (WOResponse *) markTentativeAction
|
||||
// {
|
||||
// return [self _changePartStatusAction: @"TENTATIVE"];
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
|
||||
#import "UIxMailPartViewer.h"
|
||||
|
||||
@class SOGoDateFormatter;
|
||||
@class iCalEvent;
|
||||
@class iCalCalendar;
|
||||
|
||||
@class SOGoAppointmentObject;
|
||||
@class SOGoDateFormatter;
|
||||
|
||||
@interface UIxMailPartICalViewer : UIxMailPartViewer
|
||||
{
|
||||
iCalCalendar *inCalendar;
|
||||
@@ -35,7 +37,7 @@
|
||||
id attendee;
|
||||
SOGoDateFormatter *dateFormatter;
|
||||
id item;
|
||||
id storedEventObject;
|
||||
SOGoAppointmentObject *storedEventObject;
|
||||
iCalEvent *storedEvent;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <NGImap4/NGImap4EnvelopeAddress.h>
|
||||
@@ -40,9 +39,11 @@
|
||||
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/Appointments/iCalEntityObject+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Mailer/SOGoMailObject.h>
|
||||
#import <SoObjects/Mailer/SOGoMailBodyPart.h>
|
||||
|
||||
#import "UIxMailPartICalViewer.h"
|
||||
|
||||
@@ -109,35 +110,32 @@
|
||||
|
||||
- (BOOL) couldParseCalendar
|
||||
{
|
||||
return [[self inCalendar] isNotNull];
|
||||
return (([self inCalendar]));
|
||||
}
|
||||
|
||||
- (iCalEvent *) inEvent
|
||||
{
|
||||
NSArray *events;
|
||||
|
||||
if (inEvent)
|
||||
return [inEvent isNotNull] ? inEvent : nil;
|
||||
|
||||
events = [[self inCalendar] events];
|
||||
if ([events count] > 0) {
|
||||
inEvent = [[events objectAtIndex:0] retain];
|
||||
return inEvent;
|
||||
}
|
||||
else {
|
||||
inEvent = [[NSNull null] retain];
|
||||
return nil;
|
||||
}
|
||||
if (!inEvent)
|
||||
{
|
||||
events = [[self inCalendar] events];
|
||||
if ([events count] > 0)
|
||||
inEvent = [[events objectAtIndex:0] retain];
|
||||
}
|
||||
|
||||
return inEvent;
|
||||
}
|
||||
|
||||
/* formatters */
|
||||
|
||||
- (SOGoDateFormatter *) dateFormatter
|
||||
{
|
||||
if (dateFormatter == nil) {
|
||||
dateFormatter = [[context activeUser] dateFormatterInContext: context];
|
||||
[dateFormatter retain];
|
||||
}
|
||||
if (!dateFormatter)
|
||||
{
|
||||
dateFormatter = [[context activeUser] dateFormatterInContext: context];
|
||||
[dateFormatter retain];
|
||||
}
|
||||
|
||||
return dateFormatter;
|
||||
}
|
||||
@@ -146,7 +144,7 @@
|
||||
|
||||
- (void) setAttendee: (id) _attendee
|
||||
{
|
||||
ASSIGN(attendee, _attendee);
|
||||
ASSIGN (attendee, _attendee);
|
||||
}
|
||||
|
||||
- (id) attendee
|
||||
@@ -220,7 +218,7 @@
|
||||
|
||||
/* calendar folder support */
|
||||
|
||||
- (id) calendarFolder
|
||||
- (SOGoAppointmentFolder *) calendarFolder
|
||||
{
|
||||
/* return scheduling calendar of currently logged-in user */
|
||||
SOGoUser *user;
|
||||
@@ -234,49 +232,50 @@
|
||||
return [folder lookupName: @"personal" inContext: context acquire: NO];
|
||||
}
|
||||
|
||||
- (id) storedEventObject
|
||||
- (SOGoAppointmentObject *) storedEventObject
|
||||
{
|
||||
/* lookup object in the users Calendar */
|
||||
id calendar;
|
||||
SOGoAppointmentFolder *calendar;
|
||||
NSString *filename;
|
||||
|
||||
if (storedEventObject)
|
||||
return [storedEventObject isNotNull] ? storedEventObject : nil;
|
||||
|
||||
calendar = [self calendarFolder];
|
||||
if ([calendar isKindOfClass:[NSException class]]) {
|
||||
[self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
|
||||
}
|
||||
else {
|
||||
NSString *filename;
|
||||
|
||||
filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
|
||||
if (filename) {
|
||||
// TODO: When we get an exception, this might be an auth issue meaning
|
||||
// that the UID indeed exists but that the user has no access to
|
||||
// the object.
|
||||
// Of course this is quite unusual for the private calendar though.
|
||||
id tmp;
|
||||
|
||||
tmp = [calendar lookupName:filename inContext:[self context] acquire:NO];
|
||||
if ([tmp isNotNull] && ![tmp isKindOfClass:[NSException class]])
|
||||
storedEventObject = [tmp retain];
|
||||
if (!storedEventObject)
|
||||
{
|
||||
calendar = [self calendarFolder];
|
||||
if ([calendar isKindOfClass: [NSException class]])
|
||||
[self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
|
||||
else
|
||||
{
|
||||
filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
|
||||
if (filename)
|
||||
{
|
||||
storedEventObject = [calendar lookupName: filename
|
||||
inContext: [self context]
|
||||
acquire: NO];
|
||||
if ([storedEventObject isKindOfClass: [NSException class]])
|
||||
storedEventObject = nil;
|
||||
else
|
||||
[storedEventObject retain];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (storedEventObject == nil)
|
||||
storedEventObject = [[NSNull null] retain];
|
||||
|
||||
return storedEventObject;
|
||||
}
|
||||
|
||||
- (BOOL) isEventStoredInCalendar
|
||||
{
|
||||
return [[self storedEventObject] isNotNull];
|
||||
return (([self storedEventObject]));
|
||||
}
|
||||
|
||||
- (iCalEvent *) storedEvent
|
||||
{
|
||||
return (iCalEvent *) [(SOGoAppointmentObject *)[self storedEventObject] component: NO];
|
||||
if (!storedEvent)
|
||||
{
|
||||
storedEvent = [[self storedEventObject] component: NO secure: NO];
|
||||
[storedEvent retain];
|
||||
}
|
||||
|
||||
return storedEvent;
|
||||
}
|
||||
|
||||
/* organizer tracking */
|
||||
@@ -294,34 +293,24 @@
|
||||
{
|
||||
iCalEvent *authorativeEvent;
|
||||
|
||||
if ([[self storedEvent] compare: [self inEvent]]
|
||||
== NSOrderedAscending)
|
||||
[self storedEvent];
|
||||
if (!storedEvent
|
||||
|| ([storedEvent compare: [self inEvent]] == NSOrderedAscending))
|
||||
authorativeEvent = inEvent;
|
||||
else
|
||||
authorativeEvent = storedEventObject;
|
||||
authorativeEvent = [self storedEvent];
|
||||
|
||||
return authorativeEvent;
|
||||
}
|
||||
|
||||
- (BOOL) isLoggedInUserTheOrganizer
|
||||
{
|
||||
iCalPerson *organizer;
|
||||
|
||||
organizer = [[self authorativeEvent] organizer];
|
||||
|
||||
return [[context activeUser] hasEmail: [organizer rfc822Email]];
|
||||
return [[self authorativeEvent] userIsOrganizer: [context activeUser]];
|
||||
}
|
||||
|
||||
- (BOOL) isLoggedInUserAnAttendee
|
||||
{
|
||||
NSString *loginEMail;
|
||||
|
||||
if ((loginEMail = [self loggedInUserEMail]) == nil) {
|
||||
[self warnWithFormat:@"Could not determine email of logged in user?"];
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [[self authorativeEvent] isParticipant:loginEMail];
|
||||
return [[self authorativeEvent] userIsParticipant: [context activeUser]];
|
||||
}
|
||||
|
||||
/* derived fields */
|
||||
@@ -405,7 +394,34 @@
|
||||
|
||||
- (BOOL) isReplySenderAnAttendee
|
||||
{
|
||||
return [[self storedReplyAttendee] isNotNull];
|
||||
return (([self storedReplyAttendee]));
|
||||
}
|
||||
|
||||
- (iCalPerson *) _emailParticipantWithEvent: (iCalEvent *) event
|
||||
{
|
||||
NSString *emailFrom;
|
||||
SOGoMailObject *mailObject;
|
||||
NGImap4EnvelopeAddress *address;
|
||||
|
||||
mailObject = [[self clientObject] mailObject];
|
||||
address = [[mailObject fromEnvelopeAddresses] objectAtIndex: 0];
|
||||
emailFrom = [address baseEMail];
|
||||
|
||||
return [event findParticipantWithEmail: emailFrom];
|
||||
}
|
||||
|
||||
- (BOOL) hasSenderStatusChanged
|
||||
{
|
||||
iCalPerson *emailParticipant, *calendarParticipant;
|
||||
|
||||
[self inEvent];
|
||||
[self storedEvent];
|
||||
emailParticipant = [self _emailParticipantWithEvent: inEvent];
|
||||
calendarParticipant = [self _emailParticipantWithEvent: storedEvent];
|
||||
|
||||
return ([[emailParticipant partStat]
|
||||
caseInsensitiveCompare: [calendarParticipant partStat]]
|
||||
!= NSOrderedSame);
|
||||
}
|
||||
|
||||
@end /* UIxMailPartICalViewer */
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
actionClass = "UIxMailPartICalActions";
|
||||
actionName = "decline";
|
||||
};
|
||||
updateUserStatus = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailPartICalActions";
|
||||
actionName = "updateUserStatus";
|
||||
};
|
||||
/* tentative = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailPartICalAction";
|
||||
@@ -29,12 +34,12 @@
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailPartICalAction";
|
||||
actionName = "addToCalendar";
|
||||
};
|
||||
}; */
|
||||
deleteFromCalendar = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailPartICalAction";
|
||||
actionName = "deleteFromCalendar";
|
||||
}; */
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
unsigned int minutes;
|
||||
iCalRecurrenceRule *rule;
|
||||
|
||||
event = (iCalEvent *) [[self clientObject] component: NO];
|
||||
event = (iCalEvent *) [[self clientObject] component: NO secure: YES];
|
||||
if (event)
|
||||
{
|
||||
startDate = [event startDate];
|
||||
@@ -352,16 +352,7 @@
|
||||
|
||||
- (id <WOActionResults>) saveAction
|
||||
{
|
||||
SOGoAppointmentObject *clientObject;
|
||||
NSString *iCalString;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
NSLog(@"saveAction, clientObject = %@", clientObject);
|
||||
|
||||
iCalString = [[clientObject calendar: NO] versitString];
|
||||
|
||||
NSLog(@"saveAction, iCalString = %@", iCalString);
|
||||
[clientObject saveContentString: iCalString];
|
||||
[[self clientObject] saveComponent: event];
|
||||
|
||||
return [self jsCloseWithRefreshMethod: @"refreshEventsAndDisplay()"];
|
||||
}
|
||||
@@ -385,7 +376,7 @@
|
||||
iCalRecurrenceRule *rule;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
event = (iCalEvent *) [clientObject component: YES];
|
||||
event = (iCalEvent *) [clientObject component: YES secure: NO];
|
||||
|
||||
[super takeValuesFromRequest: _rq inContext: _ctx];
|
||||
|
||||
@@ -443,23 +434,18 @@
|
||||
|
||||
// TODO: add tentatively
|
||||
|
||||
- (id) acceptOrDeclineAction: (BOOL) accept
|
||||
- (id) acceptAction
|
||||
{
|
||||
[[self clientObject] changeParticipationStatus: (accept
|
||||
? @"ACCEPTED"
|
||||
: @"DECLINED")];
|
||||
[[self clientObject] changeParticipationStatus: @"ACCEPTED"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) acceptAction
|
||||
{
|
||||
return [self acceptOrDeclineAction: YES];
|
||||
}
|
||||
|
||||
- (id) declineAction
|
||||
{
|
||||
return [self acceptOrDeclineAction: NO];
|
||||
[[self clientObject] changeParticipationStatus: @"DECLINED"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSString+misc.h>
|
||||
|
||||
#import <SoObjects/Appointments/iCalPerson+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
@@ -245,6 +246,16 @@
|
||||
return url;
|
||||
}
|
||||
|
||||
- (BOOL) hasOrganizer
|
||||
{
|
||||
return (![organizer isVoid]);
|
||||
}
|
||||
|
||||
- (NSString *) organizerName
|
||||
{
|
||||
return [organizer mailAddress];
|
||||
}
|
||||
|
||||
- (void) setAttendeesNames: (NSString *) newAttendeesNames
|
||||
{
|
||||
ASSIGN (attendeesNames, newAttendeesNames);
|
||||
@@ -694,29 +705,8 @@
|
||||
respondsToSelector: @selector(saveContentString:)];
|
||||
}
|
||||
|
||||
- (BOOL) containsConflict: (id) _component
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
/* access */
|
||||
|
||||
#if 0
|
||||
- (iCalPerson *) getOrganizer
|
||||
{
|
||||
iCalPerson *p;
|
||||
NSString *emailProp;
|
||||
|
||||
emailProp = [@"MAILTO:" stringByAppendingString:[self emailForUser]];
|
||||
p = [[[iCalPerson alloc] init] autorelease];
|
||||
[p setEmail:emailProp];
|
||||
[p setCn:[self cnForUser]];
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
- (BOOL) isMyComponent
|
||||
{
|
||||
return ([[context activeUser] hasEmail: [organizer rfc822Email]]);
|
||||
@@ -845,6 +835,7 @@
|
||||
[currentAttendee setCn: [names objectAtIndex: count]];
|
||||
[currentAttendee setEmail: currentEmail];
|
||||
[currentAttendee setRole: @"REQ-PARTICIPANT"];
|
||||
[currentAttendee setRsvp: @"TRUE"];
|
||||
[currentAttendee
|
||||
setParticipationStatus: iCalPersonPartStatNeedsAction];
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
NSString *duration;
|
||||
unsigned int minutes;
|
||||
|
||||
todo = (iCalToDo *) [[self clientObject] component: NO];
|
||||
todo = (iCalToDo *) [[self clientObject] component: NO secure: YES];
|
||||
if (todo)
|
||||
{
|
||||
startDate = [todo startDate];
|
||||
@@ -345,16 +345,23 @@
|
||||
|
||||
- (id <WOActionResults>) saveAction
|
||||
{
|
||||
SOGoTaskObject *clientObject;
|
||||
NSString *iCalString;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
iCalString = [[clientObject calendar: NO] versitString];
|
||||
[clientObject saveContentString: iCalString];
|
||||
[[self clientObject] saveComponent: todo];
|
||||
|
||||
return [self jsCloseWithRefreshMethod: @"refreshTasks()"];
|
||||
}
|
||||
|
||||
// - (id <WOActionResults>) saveAction
|
||||
// {
|
||||
// SOGoTaskObject *clientObject;
|
||||
// NSString *iCalString;
|
||||
|
||||
// clientObject = [self clientObject];
|
||||
// iCalString = [[clientObject calendar: NO secure: NO] versitString];
|
||||
// [clientObject saveContentString: iCalString];
|
||||
|
||||
// return [self jsCloseWithRefreshMethod: @"refreshTasks()"];
|
||||
// }
|
||||
|
||||
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request
|
||||
inContext: (WOContext*) context
|
||||
{
|
||||
@@ -372,7 +379,7 @@
|
||||
SOGoTaskObject *clientObject;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
todo = (iCalToDo *) [clientObject component: YES];
|
||||
todo = (iCalToDo *) [clientObject component: YES secure: NO];
|
||||
|
||||
[super takeValuesFromRequest: _rq inContext: _ctx];
|
||||
|
||||
@@ -428,7 +435,7 @@
|
||||
NSString *newStatus, *iCalString;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
todo = (iCalToDo *) [clientObject component: NO];
|
||||
todo = (iCalToDo *) [clientObject component: NO secure: NO];
|
||||
if (todo)
|
||||
{
|
||||
newStatus = [self queryParameterForKey: @"status"];
|
||||
@@ -441,7 +448,7 @@
|
||||
[todo setStatus: @"IN-PROCESS"];
|
||||
}
|
||||
|
||||
iCalString = [[clientObject calendar: NO] versitString];
|
||||
iCalString = [[clientObject calendar: NO secure: NO] versitString];
|
||||
[clientObject saveContentString: iCalString];
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
>
|
||||
<!-- TODO: add iMIP actions -->
|
||||
|
||||
<input id="iCalendarAttachment" type="hidden"
|
||||
var:value="pathToAttachmentObject"/>
|
||||
|
||||
<var:if condition="couldParseCalendar" const:negate="1">
|
||||
<fieldset>
|
||||
<legend>Parsing Error</legend>
|
||||
@@ -33,23 +36,24 @@
|
||||
</var:if>
|
||||
</legend>
|
||||
|
||||
<var:if condition="inCalendar.method" const:value="REQUEST">
|
||||
<var:if condition="inCalendar.method.uppercaseString" const:value="REQUEST">
|
||||
<!-- sent to attendees to propose or update a meeting -->
|
||||
<var:if condition="isLoggedInUserAnAttendee">
|
||||
<p class="uix_ical_toolbar" id="iCalendarToolbar">
|
||||
<input id="iCalendarAttachment" type="hidden"
|
||||
var:value="pathToAttachmentObject"/>
|
||||
<input id="iCalendarAccept" class="button"
|
||||
type="button" label:value="Accept"/>
|
||||
<input id="iCalendarDecline" class="button"
|
||||
type="button" label:value="Decline"/>
|
||||
<input id="iCalendarTentative" class="button"
|
||||
type="button" label:value="Tentative"/>
|
||||
<var:if condition="isEventStoredInCalendar" const:negate="YES">
|
||||
| <input id="iCalendarAddToCalendar" class="button"
|
||||
type="button" label:value="Add to calendar"/>
|
||||
</var:if>
|
||||
</p>
|
||||
<var:if condition="$storedReplyAttendee.partStatWithDefault"
|
||||
const:value="NEEDS-ACTION" const:negate="YES">
|
||||
<p class="uix_ical_toolbar" id="iCalendarToolbar">
|
||||
<input id="iCalendarAccept" class="button"
|
||||
type="button" label:value="Accept"/>
|
||||
<input id="iCalendarDecline" class="button"
|
||||
type="button" label:value="Decline"/>
|
||||
<!-- <input id="iCalendarTentative" class="button"
|
||||
type="button" label:value="Tentative"/> -->
|
||||
<var:if condition="isEventStoredInCalendar" const:negate="YES">
|
||||
| <input id="iCalendarAddToCalendar" class="button"
|
||||
type="button" label:value="Add to calendar"/>
|
||||
</var:if>
|
||||
</p>
|
||||
</var:if>
|
||||
|
||||
<p>
|
||||
<var:string label:value="Organizer" />
|
||||
@@ -70,20 +74,20 @@
|
||||
</var:if>
|
||||
|
||||
|
||||
<var:if condition="inCalendar.method" const:value="REPLY">
|
||||
<var:if condition="inCalendar.method.uppercaseString" const:value="REPLY">
|
||||
<!-- sent to organizer to update the status of the participant -->
|
||||
<var:if condition="isReplySenderAnAttendee" const:negate="1">
|
||||
<p><var:string label:value="reply_info_no_attendee" /></p>
|
||||
</var:if>
|
||||
|
||||
<var:if condition="isReplySenderAnAttendee">
|
||||
<p class="uix_ical_toolbar">
|
||||
<a var:href="addStatusReplyLink"
|
||||
var:_newstat="$inReplyAttendee.partStatWithDefault"
|
||||
var:_sender="replySenderBaseEMail"
|
||||
label:string="do_update_status"/>
|
||||
</p>
|
||||
|
||||
<var:if condition="hasSenderStatusChanged"
|
||||
><p class="uix_ical_toolbar">
|
||||
<input id="iCalendarUpdateUserStatus" class="button"
|
||||
type="button" label:value="Update status"/>
|
||||
</p
|
||||
></var:if>
|
||||
|
||||
<!-- TODO: replies to events not in the calendar? -->
|
||||
|
||||
<p>
|
||||
@@ -96,7 +100,7 @@
|
||||
</var:if>
|
||||
</var:if>
|
||||
|
||||
<var:if condition="inCalendar.method" const:value="CANCEL">
|
||||
<var:if condition="inCalendar.method.uppercaseString" const:value="CANCEL">
|
||||
<!-- sent to attendees to notify of the attendee being removed or the
|
||||
event being deleted -->
|
||||
<var:if condition="isEventStoredInCalendar">
|
||||
@@ -113,13 +117,13 @@
|
||||
</var:if>
|
||||
|
||||
|
||||
<var:if condition="inCalendar.method" const:value="ADD">
|
||||
<var:if condition="inCalendar.method.uppercaseString" const:value="ADD">
|
||||
<!-- TODO -->
|
||||
<p><var:string label:value="add_info_text" /></p>
|
||||
</var:if>
|
||||
|
||||
|
||||
<var:if condition="inCalendar.method" const:value="PUBLISH">
|
||||
<var:if condition="inCalendar.method.uppercaseString" const:value="PUBLISH">
|
||||
<!-- none-scheduling event sent to someone for adding to the calendar -->
|
||||
<p><var:string label:value="publish_info_text" /></p>
|
||||
</var:if>
|
||||
@@ -145,7 +149,6 @@
|
||||
-->
|
||||
</var:if>
|
||||
|
||||
|
||||
<!-- the user comment is used in replies -->
|
||||
<var:if condition="inEvent.userComment.isNotEmpty">
|
||||
<div class="linked_attachment_meta" style="background-color: white;">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
const:popup="YES"
|
||||
title="name"
|
||||
var:toolbar="toolbar"
|
||||
const:cssFiles="UIxComponentEditor.css"
|
||||
const:jsFiles="skycalendar.js,UIxComponentEditor.js">
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -54,7 +55,11 @@
|
||||
label:noSelectionString="prio_0"
|
||||
string="itemPriorityText" selection="priority"/>
|
||||
</span></span>
|
||||
<label id="attendeesLabel" style="display: none;"><var:string label:value="Attendees:"
|
||||
<var:if condition="hasOrganizer"
|
||||
><label id="organizerLabel"><var:string label:value="Organizer:"
|
||||
/><span class="content"><var:string value="organizerName"/></span></label>
|
||||
</var:if>
|
||||
<label id="attendeesLabel"><var:string label:value="Attendees:"
|
||||
/><span class="content"
|
||||
><a href="#" id="attendeesHref"><!-- space --></a></span></label>
|
||||
<hr />
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
<var:if condition="hasPageSpecificCSS"
|
||||
><link type="text/css" rel="stylesheet" var:href="pageCSSURL"
|
||||
/></var:if>
|
||||
<var:foreach list="additionalCSSFiles" item="item"
|
||||
><link type="text/css" rel="stylesheet" var:href="item"
|
||||
/>
|
||||
</var:foreach>
|
||||
<var:if-ie
|
||||
><link type="text/css" rel="stylesheet" rsrc:href="iefixes.css"
|
||||
/></var:if-ie>
|
||||
|
||||
@@ -755,6 +755,7 @@ function configureiCalLinksInMessage() {
|
||||
var buttons = { "iCalendarAccept": "accept",
|
||||
"iCalendarDecline": "decline",
|
||||
"iCalendarTentative": "tentative",
|
||||
"iCalendarUpdateUserStatus": "updateUserStatus",
|
||||
"iCalendarAddToCalendar": "addToCalendar",
|
||||
"iCalendarDeleteFromCalendar": "deleteFromCalendar" };
|
||||
|
||||
@@ -772,11 +773,13 @@ function onICalendarButtonClick(event) {
|
||||
var link = $("iCalendarAttachment").value;
|
||||
if (link) {
|
||||
var urlstr = link + "/" + this.action;
|
||||
log ("click: " + urlstr);
|
||||
triggerAjaxRequest(urlstr, ICalendarButtonCallback,
|
||||
currentMailbox + "/"
|
||||
+ currentMessages[currentMailbox]);
|
||||
window.alert(urlstr);
|
||||
}
|
||||
else
|
||||
log("no link");
|
||||
}
|
||||
|
||||
function ICalendarButtonCallback(http) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#attendeesLabel
|
||||
{ display: none; }
|
||||
|
||||
Reference in New Issue
Block a user