diff --git a/ChangeLog b/ChangeLog index a45b11cbc..fd29a2e69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-02 Francis Lachapelle + + * SoObjects/Appointments/SOGoAppointmentObject.m + ([SOGoAppointmentObject -postCalDAVEventRequestTo:from:]): remove + alarms from invitation and set organizer of master event when + dealing with a recurrent event. + 2009-06-02 Wolfgang Sourdeau * Tools/sogo-contacts-removedoubles.m: new maintenance utility @@ -10,6 +17,9 @@ * SoObjects/Appointments/SOGoAppointmentFolder.m (_enforceTimeLimitOnFilter): Rewrote algorithm, fixed cyclic events issue. + * UI/WebServerResources/UIxAttendeesEditor.js: Fixed update bug on "enter" + * UI/Templates/SchedulerUI/UIxAttendeesEditor.wox: Removed next/prev hour + and zoom buttons 2009-06-02 Ludovic Marcotte diff --git a/Scripts/sogo-init.d-debian b/Scripts/sogo-init.d-debian index 57748d52e..24bf28d34 100755 --- a/Scripts/sogo-init.d-debian +++ b/Scripts/sogo-init.d-debian @@ -44,18 +44,18 @@ if [ ! -x $DAEMON ]; then exit 1 fi -if [ `/usr/bin/stat /var/run/sogo -c %U` != "sogo" ]; then - echo "/var/run/sogo is not owned by the sogo user." +if [ `/usr/bin/stat /var/run/sogo -c %U` != $USER ]; then + echo "/var/run/sogo is not owned by the ${USER}." exit 1 fi -if [ `/usr/bin/stat /var/spool/sogo -c %U` != "sogo" ]; then - echo "/var/spool/sogo is not owned by the sogo user." +if [ `/usr/bin/stat /var/spool/sogo -c %U` != $USER ]; then + echo "/var/spool/sogo is not owned by the ${USER}." exit 1 fi -if [ `/usr/bin/stat /var/log/sogo -c %U` != "sogo" ]; then - echo "/var/log/sogo is not owned by the sogo user." +if [ `/usr/bin/stat /var/log/sogo -c %U` != $USER ]; then + echo "/var/log/sogo is not owned by the ${USER}." exit 1 fi diff --git a/Scripts/sogod-wrapper b/Scripts/sogod-wrapper index f834e7f98..bb2eeb5be 100755 --- a/Scripts/sogod-wrapper +++ b/Scripts/sogod-wrapper @@ -40,7 +40,9 @@ else exit 1 fi -if [ -x $GNUSTEP_LOCAL_ADMIN_TOOLS/sogod ]; then +if [ -x $HOME/$GNUSTEP_USER_DIR_ADMIN_TOOLS/sogod ]; then + sogod="$HOME/$GNUSTEP_USER_DIR_ADMIN_TOOLS/sogod" +elif [ -x $GNUSTEP_LOCAL_ADMIN_TOOLS/sogod ]; then sogod="$GNUSTEP_LOCAL_ADMIN_TOOLS/sogod" elif [ -x $GNUSTEP_SYSTEM_ADMIN_TOOLS/sogod ]; then sogod="$GNUSTEP_SYSTEM_ADMIN_TOOLS/sogod" diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 6de6bfb73..20008507f 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -219,23 +219,28 @@ { if (![theUID isEqualToString: theOwner]) { - SOGoAppointmentObject *object; + SOGoAppointmentObject *attendeeObject; NSString *iCalString; - object = [self _lookupEvent: [theEvent uid] forUID: theUID]; + attendeeObject = [self _lookupEvent: [theEvent uid] forUID: theUID]; // We must add an occurence to a non-existing event. We have // to handle this with care, as in the postCalDAVEventRequestTo:from: - if ([object isNew] && [theEvent recurrenceId]) + if ([attendeeObject isNew] && [theEvent recurrenceId]) { - SOGoAppointmentObject *ownerEventObject; + SOGoAppointmentObject *ownerObject; NSArray *attendees; + iCalEvent *ownerEvent; iCalPerson *person; SOGoUser *user; BOOL found; int i; - user = [SOGoUser userWithLogin: theUID roles: nil]; + // We check if the attendee that was added to a single occurence is + // present in the master component. If not, we add it with a participation + // status set to "DECLINED". + + user = [SOGoUser userWithLogin: theUID roles: nil]; person = [iCalPerson elementWithTag: @"attendee"]; [person setCn: [user cn]]; [person setEmail: [[user allEmails] objectAtIndex: 0]]; @@ -243,14 +248,11 @@ [person setRsvp: @"TRUE"]; [person setRole: @"REQ-PARTICIPANT"]; - ownerEventObject = [self _lookupEvent: [theEvent uid] forUID: theOwner]; - theEvent = [[[theEvent parent] events] objectAtIndex: 0]; - attendees = [theEvent attendees]; + ownerObject = [self _lookupEvent: [theEvent uid] forUID: theOwner]; + ownerEvent = [[[theEvent parent] events] objectAtIndex: 0]; + attendees = [ownerEvent attendees]; found = NO; - // We check if the attendee that was added to a single occurence is - // present in the master component. If not, we add it with a participation - // status set to "DECLINED" for (i = 0; i < [attendees count]; i++) { if ([[attendees objectAtIndex: i] hasSameEmailAddress: person]) @@ -262,9 +264,11 @@ if (!found) { - [theEvent addToAttendees: person]; - iCalString = [[theEvent parent] versitString]; - [ownerEventObject saveContentString: iCalString]; + // Update the master event in the owner's calendar with the + // status of the new attendee set as "DECLINED". + [ownerEvent addToAttendees: person]; + iCalString = [[ownerEvent parent] versitString]; + [ownerObject saveContentString: iCalString]; } } else @@ -272,7 +276,8 @@ iCalString = [[theEvent parent] versitString]; } - [object saveContentString: iCalString]; + // Save the event in the attendee's calendar + [attendeeObject saveContentString: iCalString]; } } @@ -776,16 +781,18 @@ NSEnumerator *recipientsEnum; NSString *recipient, *uid, *ownerUID; iCalEvent *newEvent, *oldEvent, *emailEvent; - iCalPerson *person; + iCalPerson *person, *eventOwner; BOOL isUpdate, hasChanged; elements = [NSMutableArray array]; ownerUID = [[LDAPUserManager sharedUserManager] getUIDForEmail: originator]; + eventOwner = [self iCalPersonWithUID: ownerUID]; emailEvent = [self component: NO secure: NO]; newEvent = [self component: NO secure: NO]; + [newEvent removeAllAlarms]; [[newEvent parent] setMethod: @""]; - + recipientsEnum = [recipients objectEnumerator]; while ((recipient = [recipientsEnum nextObject])) if ([[recipient lowercaseString] hasPrefix: @"mailto:"]) @@ -897,6 +904,8 @@ [person setRsvp: @"TRUE"]; [person setRole: @"REQ-PARTICIPANT"]; [newEvent addToAttendees: person]; + if ([[newEvent organizer] isVoid]) + [newEvent setOrganizer: eventOwner]; [ownerEventObject saveContentString: [[newEvent parent] versitString]]; } } diff --git a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox index 14a4ef391..1abb27e27 100644 --- a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox +++ b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox @@ -26,6 +26,7 @@ +
-
+
+ diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 21bffe76e..97ab47cbd 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -176,20 +176,6 @@ function contactsListCallback(http) { log ("ajax problem 1: status = " + http.status); } -function onAddressBooksContextMenu(event) { - var menu = $("contactFoldersMenu"); - menu.observe("mousedown", onAddressBooksContextMenuHide); - popupMenu(event, "contactFoldersMenu", this); - - var topNode = $("contactFolders"); - var selectedNodes = topNode.getSelectedRows(); - topNode.menuSelectedRows = selectedNodes; - for (var i = 0; i < selectedNodes.length; i++) - $(selectedNodes[i]).deselect(); - topNode.menuSelectedEntry = this; - $(this).selectElement(); -} - function onContactContextMenu(event) { var contactsList = $("contactsList"); var menu = $("contactMenu"); @@ -213,21 +199,6 @@ function onContactContextMenuHide(event) { } } -function onAddressBooksContextMenuHide(event) { - var topNode = $("contactFolders"); - - if (topNode.menuSelectedEntry) { - topNode.menuSelectedEntry.deselect(); - topNode.menuSelectedEntry = null; - } - if (topNode.menuSelectedRows) { - var nodes = topNode.menuSelectedRows; - for (var i = 0; i < nodes.length; i++) - nodes[i].selectElement(); - topNode.menuSelectedRows = null; - } -} - function onFolderMenuHide(event) { var topNode = $('d'); @@ -778,6 +749,7 @@ function configureAddressBooks() { if (contactFolders) { contactFolders.observe("mousedown", listRowMouseDownHandler); contactFolders.observe("click", onFolderSelectionChange); + contactFolders.attachMenu("contactFoldersMenu"); var lis = contactFolders.childNodesWithTag("li"); for (var i = 0; i < lis.length; i++) setEventsOnAddressBook(lis[i]); @@ -851,7 +823,6 @@ function setEventsOnAddressBook(folder) { node.observe("mousedown", listRowMouseDownHandler); node.observe("click", onRowClick); node.observe("dblclick", onAddressBookModify); - node.observe("contextmenu", onAddressBooksContextMenu); } function onAddressBookModify(event) { @@ -930,7 +901,11 @@ function onAddressBooksMenuPrepareVisibility() { removeOption.addClassName("disabled"); else removeOption.removeClassName("disabled"); + + return true; } + + return false; } function onContactMenuPrepareVisibility() { diff --git a/UI/WebServerResources/HTMLElement.js b/UI/WebServerResources/HTMLElement.js index c49ac642a..c0c81a3cd 100644 --- a/UI/WebServerResources/HTMLElement.js +++ b/UI/WebServerResources/HTMLElement.js @@ -138,15 +138,20 @@ Element.addMethods( if (leftDiff < 0) menuLeft -= popup.offsetWidth; + var isVisible = true; if (popup.prepareVisibility) - popup.prepareVisibility(); + isVisible = popup.prepareVisibility(); - popup.setStyle( { top: menuTop + "px", - left: menuLeft + "px", - visibility: "visible" } ); - - document.currentPopupMenu = popup; - document.body.observe("click", onBodyClickMenuHandler); + if (isVisible) { + popup.setStyle( { top: menuTop + "px", + left: menuLeft + "px", + visibility: "visible" } ); + + document.currentPopupMenu = popup; + document.body.observe("click", onBodyClickMenuHandler); + } + else + log ("Warning: not showing the contextual menu " + element.id); }, attachMenu: function(element, menuName) { diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index bf9493156..1dee78282 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -936,7 +936,7 @@ function configureLinksInMessage() { if (anchors[i].href.substring(0,7) == "mailto:") { $(anchors[i]).observe("click", onEmailTo); $(anchors[i]).observe("contextmenu", onEmailAddressClick); - } + } else $(anchors[i]).observe("click", onMessageAnchorClick); @@ -1273,11 +1273,6 @@ function refreshCurrentFolder() { openMailbox(Mailer.currentMailbox, true); } -function refreshFolderByType(type) { - if (Mailer.currentMailboxType == type) - refreshCurrentFolder(); -} - var mailboxSpanAcceptType = function(type) { return (type == "mailRow"); }; @@ -1594,13 +1589,13 @@ function updateMailboxTreeInPage() { var valueDiv = new Element('div', { 'class': 'value ' + level, 'style': 'width: ' + ((percents > 100)?100:percents) + '%' }); var marksDiv = new Element('div', { 'class': 'marks' }); var textP = new Element('p').update(text); - marksDiv.appendChild(new Element('div')); - marksDiv.appendChild(new Element('div')); - marksDiv.appendChild(new Element('div')); - levelDiv.appendChild(valueDiv); - levelDiv.appendChild(marksDiv); - levelDiv.appendChild(textP); - quotaDiv.appendChild(levelDiv); + marksDiv.insert(new Element('div')); + marksDiv.insert(new Element('div')); + marksDiv.insert(new Element('div')); + levelDiv.insert(valueDiv); + levelDiv.insert(marksDiv); + levelDiv.insert(textP); + quotaDiv.insert(levelDiv); treeContent.insertBefore(quotaDiv, tree); } diff --git a/UI/WebServerResources/SchedulerUI.css b/UI/WebServerResources/SchedulerUI.css index fcadbffc9..0957f0996 100644 --- a/UI/WebServerResources/SchedulerUI.css +++ b/UI/WebServerResources/SchedulerUI.css @@ -895,8 +895,6 @@ DIV.event._selected > DIV.eventInside DIV.monthView DIV.event, DIV.monthView DIV.event > DIV.eventInside { bottom: 0px; - nopadding: 0px; - nomargin: 0px; top: 0px; } DIV.monthView DIV.event > DIV.eventInside diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index becf6e26f..ebeaef7df 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -594,8 +594,8 @@ function eventsListCallback(http) { row.observe("mousedown", onRowClick); row.observe("selectstart", listRowMouseDownHandler); row.observe("dblclick", editDoubleClickedEvent); - row.observe("contextmenu", onEventContextMenu); - + row.attachMenu("eventsListMenu"); + var td = $(document.createElement("td")); row.appendChild(td); td.observe("mousedown", listRowMouseDownHandler, true); @@ -973,6 +973,22 @@ function refreshCalendarEventsCallback(http) { } function newBaseEventDIV(eventRep, event, eventText) { +// log ("0 cname = " + event[0]); +// log ("1 calendar = " + event[1]); +// log ("2 status = " + event[2]); +// log ("3 title = " + event[3]); +// log ("4 start = " + event[4]); +// log ("5 end = " + event[5]); +// log ("6 location = " + event[6]); +// log ("7 isallday = " + event[7]); +// log ("8 classification = " + event[8]); +// log ("9 participants emails = " + event[9]); +// log ("10 participants states = " + event[10]); +// log ("11 owner = " + event[11]); +// log ("12 iscycle = " + event[12]); +// log ("13 nextalarm = " + event[13]); +// log ("14 recurrenceid = " + event[14]); + var eventDiv = $(document.createElement("div")); eventDiv.cname = event[0]; eventDiv.calendar = event[1]; @@ -1167,23 +1183,6 @@ function popupCalendar(node) { return false; } -function onEventContextMenu(event) { - var topNode = $("eventsList"); - var menu = $("eventsListMenu"); - - menu.observe("hideMenu", onEventContextMenuHide); - popupMenu(event, "eventsListMenu", this); -} - -function onEventContextMenuHide(event) { - var topNode = $("eventsList"); - - if (topNode.menuSelectedEntry) { - topNode.menuSelectedEntry.deselect(); - topNode.menuSelectedEntry = null; - } -} - function onEventsSelectionChange() { listOfSelection = this; this.removeClassName("_unfocused"); @@ -1634,7 +1633,6 @@ function browseURL(anchor, event) { function onCalendarsMenuPrepareVisibility() { var folders = $("calendarList"); var selected = folders.getSelectedNodes(); - if (selected.length > 0) { var folderOwner = selected[0].getAttribute("owner"); var sharingOption = $(this).down("ul").childElements().last(); @@ -1643,7 +1641,9 @@ function onCalendarsMenuPrepareVisibility() { sharingOption.removeClassName("disabled"); else sharingOption.addClassName("disabled"); - } + return true; + } + return false; } function getMenus() { @@ -1815,6 +1815,7 @@ function appendCalendar(folderName, folderPath) { var checkBox = createElement("input", null, "checkBox", { checked: 1 }, { type: "checkbox" }, li); + li.appendChild(document.createTextNode(" ")); var colorBox = document.createElement("div"); @@ -1827,8 +1828,11 @@ function appendCalendar(folderName, folderPath) { $(colorBox).addClassName("colorBox"); $(colorBox).addClassName('calendarFolder' + folderPath.substr(1)); + // Check the checkbox (required for IE) + $(li).down("input.checkBox").checked = true; + // Register events (doesn't work with Safari) - setEventsOnCalendar(checkBox, li); + setEventsOnCalendar($(checkBox), $(li)); var url = URLForFolderID(folderPath) + "/canAccessContent"; triggerAjaxRequest(url, calendarEntryCallback, folderPath); @@ -1865,10 +1869,10 @@ function appendStyleElement(folderPath, color) { function onFolderSubscribeCB(folderData) { var folder = $(folderData["folder"]); if (!folder) { - appendCalendar(folderData["folderName"], folderData["folder"]); + appendCalendar(folderData["folderName"], folderData["folder"]); refreshEvents(); refreshTasks(); - changeCalendarDisplay(); + changeCalendarDisplay(); } } @@ -1998,9 +2002,7 @@ function initCalendars() { initCalendarSelector(); configureSearchField(); configureLists(); - var selector = $("calendarSelector"); - if (selector) - selector.attachMenu("calendarsMenu"); + $("calendarList").attachMenu("calendarsMenu"); $(document.body).observe("click", onBodyClickHandler); } diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index ffbf03557..8ffe8e9b7 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -25,6 +25,7 @@ function addUser(userName, userID) { } function addUserCallback(http) { + // Ignore response } function setEventsOnUserNode(node) { diff --git a/UI/WebServerResources/UIxAttendeesEditor.js b/UI/WebServerResources/UIxAttendeesEditor.js index c4425fa11..6f6ba0e96 100644 --- a/UI/WebServerResources/UIxAttendeesEditor.js +++ b/UI/WebServerResources/UIxAttendeesEditor.js @@ -60,12 +60,16 @@ function onContactKeydown(event) { preventDefault(event); if (this.confirmedValue) this.value = this.confirmedValue; - if (this.uid) - this.blur(); // triggers checkAttendee function call $(this).selectText(0, this.value.length); if (document.currentPopupMenu) hideMenu(document.currentPopupMenu); attendeesEditor.selectedIndex = -1; + if (this.uid) { + this.hasfreebusy = false; + this.setAttribute ("modified", "1"); + this.blur(); // triggers checkAttendee function call + } + } else if ($('attendeesMenu').getStyle('visibility') == 'visible') { attendeesEditor.currentField = this; @@ -446,12 +450,13 @@ function initializeWindowButtons() { var buttons = $("freeBusyViewButtons").childNodesWithTag("a"); for (var i = 0; i < buttons.length; i++) buttons[i].observe("click", listRowMouseDownHandler, false); - buttons = $("freeBusyZoomButtons").childNodesWithTag("a"); +/* buttons = $("freeBusyZoomButtons").childNodesWithTag("a"); for (var i = 0; i < buttons.length; i++) buttons[i].observe("click", listRowMouseDownHandler, false); buttons = $("freeBusyButtons").childNodesWithTag("a"); for (var i = 0; i < buttons.length; i++) buttons[i].observe("click", listRowMouseDownHandler, false); +*/ } function onEditorOkClick(event) { diff --git a/UI/WebServerResources/UIxContactsUserFolders.js b/UI/WebServerResources/UIxContactsUserFolders.js index cef67f63d..68449cdd9 100644 --- a/UI/WebServerResources/UIxContactsUserFolders.js +++ b/UI/WebServerResources/UIxContactsUserFolders.js @@ -205,7 +205,7 @@ function onConfirmFolderSelection(event) { .replace("<", "<", "g") .replace(">", ">", "g")); folderName = resource.innerHTML + ' (' + email + ')'; - } + } folderName = folderName.replace(/>,.*(\))?$/, ">)$1", "g"); var data = { folderName: folderName, folder: folder, window: window }; diff --git a/UI/WebServerResources/UIxReminderEditor.css b/UI/WebServerResources/UIxReminderEditor.css index 1ce54565c..3eff67bcd 100644 --- a/UI/WebServerResources/UIxReminderEditor.css +++ b/UI/WebServerResources/UIxReminderEditor.css @@ -1,12 +1,3 @@ -n0DIV#windowButtonz -{ position: absolute; - bottom: 0px; - left: 0px; - right: 0px; - height: 2em; - margin: 1em; - text-align: right; } - DIV#windowButtons { position: absolute; bottom: 0px; diff --git a/UI/WebServerResources/dtree.js b/UI/WebServerResources/dtree.js index 8a2e5e776..b2eedb938 100644 --- a/UI/WebServerResources/dtree.js +++ b/UI/WebServerResources/dtree.js @@ -133,6 +133,7 @@ dTree.prototype.addNode = function(pNode) { dTree.prototype.node = function(node, nodeId) { var str = ''; + this.aNodes[nodeId] = node; if (this.root.id != node.pid || !this.config.hideRoot) { str += '