2007-06-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ * SoObjects/Appointments/SOGoAppointmentObject.m: the owner of the
+ object must be present in the list of UIDs we delete the object
+ from. Otherwise Calendar objects having no organizer and no
+ attendees will remain in their owner's Calendar.
+
* SoObjects/SOGo/SOGoObject.m ([SOGoObject
-_urlPreferringParticle:expectedoverThisOne:possible]): remove the
first 3 elements of the path array if the url returned by
- send iMIP mail for all folders not found
*/
iCalEvent *apt;
- NSArray *removedUIDs;
- NSMutableArray *attendees;
+ NSMutableArray *attendees, *removedUIDs;
/* load existing content */
// // TODO
// }
- removedUIDs = [self attendeeUIDsFromAppointment:apt];
+ removedUIDs = [NSMutableArray arrayWithArray:
+ [self attendeeUIDsFromAppointment: apt]];
+ if (![removedUIDs containsObject: owner])
+ [removedUIDs addObject: owner];
if ([self sendEMailNotifications])
{
else if ([roles containsObject: SOGoRole_ObjectCreator])
[roles addObject: SOGoCalendarRole_Organizer];
}
-
- NSLog (@"all roles: %@" , roles);
// }
return roles;
if (!urlAfterEndingChars)
{
urlAfterEndingChars = [NSMutableCharacterSet new];
- [urlAfterEndingChars addCharactersInString: @"&;<\t \r\n"];
+ [urlAfterEndingChars addCharactersInString: @"()[]{}&;<\t \r\n"];
}
start = refRange.location;
@"/"]];
if ([baseURL hasPrefix: @"http"])
{
- [path removeObjectAtIndex: 2];
[path removeObjectAtIndex: 1];
[path removeObjectAtIndex: 0];
+ [path replaceObjectAtIndex: 0 withObject: @""];
}
urlMethod = [path objectAtIndex: 2];
if (![urlMethod isEqualToString: expected])
{
SOGoCalendarComponent *clientObject;
NSString *toolbarFilename;
+ iCalPerson *participant;
iCalPersonPartStat participationStatus;
SoSecurityManager *sm;
NSString *owner;
sm = [SoSecurityManager sharedSecurityManager];
clientObject = [self clientObject];
- if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
- onObject: clientObject
- inContext: context])
- {
- if ([[clientObject componentTag] isEqualToString: @"vevent"])
- toolbarFilename = @"SOGoAppointmentObject.toolbar";
- else
- toolbarFilename = @"SOGoTaskObject.toolbar";
- }
- else if (![sm validatePermission: SOGoCalendarPerm_RespondToComponent
- onObject: clientObject
- inContext: context])
+ owner = [clientObject ownerInContext: context];
+ participant = [clientObject findParticipantWithUID: owner];
+
+ if (participant
+ && ![sm validatePermission: SOGoCalendarPerm_RespondToComponent
+ onObject: clientObject
+ inContext: context])
{
+ participationStatus = [participant participationStatus];
/* Lightning does not manage participation status within tasks */
- owner = [clientObject ownerInContext: context];
- participationStatus
- = [[clientObject findParticipantWithUID: owner] participationStatus];
if (participationStatus == iCalPersonPartStatAccepted)
toolbarFilename = @"SOGoAppointmentObjectDecline.toolbar";
else if (participationStatus == iCalPersonPartStatDeclined)
else
toolbarFilename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar";
}
+ else if (![sm validatePermission: SOGoCalendarPerm_ModifyComponent
+ onObject: clientObject
+ inContext: context])
+ {
+ if ([[clientObject componentTag] isEqualToString: @"vevent"])
+ toolbarFilename = @"SOGoAppointmentObject.toolbar";
+ else
+ toolbarFilename = @"SOGoTaskObject.toolbar";
+ }
else
toolbarFilename = @"SOGoComponentClose.toolbar";
var closeDiv = document.createElement("div");
closeDiv.addClassName("javascriptPopupBackground");
var closePseudoWin = document.createElement("div");
- closePseudoWin.addClassName("javascriptMessagePseudoWindow");
+ closePseudoWin.addClassName("javascriptMessagePseudoTopWindow");
closePseudoWin.style.top = "0px;";
closePseudoWin.style.left = "0px;";
closePseudoWin.style.right = "0px;";
}
function modifyEventCallback(http) {
- if (http.readyState == 4) {
- if (http.status == 200) {
- log("closing window...?");
- if (queryParameters["mail-invitation"] == "yes")
- closeInvitationWindow();
+ if (http.readyState == 4) {
+ if (http.status == 200) {
+ if (queryParameters["mail-invitation"].toLowerCase() == "yes")
+ closeInvitationWindow();
+ else {
+ window.opener.setTimeout("refreshAppointmentsAndDisplay();", 100);
+ window.setTimeout("window.close();", 100);
+ }
+ }
else {
- window.opener.setTimeout("refreshAppointmentsAndDisplay();", 100);
- window.setTimeout("window.close();", 100);
+ log("showing alert...");
+ window.alert(labels["eventPartStatModificationError"]);
}
- }
- else {
- log("showing alert...");
- window.alert(labels["eventPartStatModificationError"]);
- }
- document.modifyEventAjaxRequest = null;
- }
+ document.modifyEventAjaxRequest = null;
+ }
}
function deleteEventCallback(http) {
bottom: 0px;
text-align: center; }
-DIV.javascriptMessagePseudoWindow
+DIV.javascriptMessagePseudoWindow,
+DIV.javascriptMessagePseudoTopWindow
{ position: absolute;
z-index: 2;
- border-top: 2px solid #fff;
- border-left: 2px solid #fff;
border-bottom: 2px solid #888;
- border-right: 2px solid #888;
- -moz-border-top-colors: #efebe7 #fff;
- -moz-border-left-colors: #efebe7 #fff;
-moz-border-bottom-colors: #000 #9c9a94 transparent;
- -moz-border-right-colors: #000 #9c9a94 transparent;
padding: 1em;
margin: 0px auto;
-moz-opacity: 1.0;
opacity: 1.0;
filter: alpha(opacity=100);
color: #000;
- background-color: #dedede; }
+ background-color: #d4d0c8; }
+
+DIV.javascriptMessagePseudoTopWindow
+{ border-top: 0px;
+ border-left: 0px;
+ border-right: 0px; }
+
+DIV.javascriptMessagePseudoWindow
+{ border-top: 2px solid #fff;
+ border-left: 2px solid #fff;
+ border-right: 2px solid #888;
+ -moz-border-top-colors: #efebe7 #fff;
+ -moz-border-left-colors: #efebe7 #fff;
+ -moz-border-right-colors: #000 #9c9a94 transparent; }
DIV.noJavascriptErrorMessage
{ top: 10em;
{ float: right;
margin: 0px auto; }
-A.button:hover
-{ color: inherit;
- background: #efebe7; }
-
INPUT.button:active,
A.button:active
{ color: -moz-buttonhovertext;
INPUT.button,
A.button,
-A[class~="_disabled"].button:hover,
A[class~="_disabled"].button:active
{ cursor: default;
padding: 1px .5em;
{ vertical-align: middle; }
A[class~="_disabled"].button,
-A[class~="_disabled"].button:hover,
A[class~="_disabled"].button:active
{ color: #999;
background: inherit; }