From 07c56db6c93078bd71d0842baadfd4df973913e9 Mon Sep 17 00:00:00 2001 From: C Robert Date: Tue, 14 Jul 2009 17:15:03 +0000 Subject: [PATCH 1/3] reindent Monotone-Parent: 5e3e865225772f121d4060fe62b0894cec61ddbe Monotone-Revision: d8f1c16855547eb4ff333738e080e5d47913e035 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-14T17:15:03 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxAppointmentEditor.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 8df1550ef..45336a0e8 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -278,17 +278,17 @@ { sm = [SoSecurityManager sharedSecurityManager]; if (![sm validatePermission: SoPerm_AddDocumentsImagesAndFiles - onObject: co - inContext: context]) - { - method = [NSString stringWithFormat:@"%@/%@.ics/editAsAppointment", - [co soURL], objectId]; - } + onObject: co + inContext: context]) + { + method = [NSString stringWithFormat:@"%@/%@.ics/editAsAppointment", + [co soURL], objectId]; + } else - { - method = [NSString stringWithFormat: @"%@/Calendar/personal/%@.vcf/editAsAppointment", - [self userFolderPath], objectId]; - } + { + method = [NSString stringWithFormat: @"%@/Calendar/personal/%@.vcf/editAsAppointment", + [self userFolderPath], objectId]; + } uri = [self completeHrefForMethod: method]; result = [self redirectToLocation: uri]; } From 23759f2991792a39d8b3e92071237cca7e056d8b Mon Sep 17 00:00:00 2001 From: C Robert Date: Tue, 14 Jul 2009 17:17:06 +0000 Subject: [PATCH 2/3] reindent Monotone-Parent: d8f1c16855547eb4ff333738e080e5d47913e035 Monotone-Revision: d2b6077fa24d79c27ba0efea14127c05071e51b9 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-14T17:17:06 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxAppointmentEditor.m | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 45336a0e8..fb4dbfab5 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -218,12 +218,12 @@ startDate = [self newStartDate]; duration = [self queryParameterForKey:@"dur"]; if ([duration length] > 0) - minutes = [duration intValue]; + minutes = [duration intValue]; else - minutes = 60; + minutes = 60; endDate - = [startDate dateByAddingYears: 0 months: 0 days: 0 - hours: 0 minutes: minutes seconds: 0]; + = [startDate dateByAddingYears: 0 months: 0 days: 0 + hours: 0 minutes: minutes seconds: 0]; } else { @@ -234,28 +234,28 @@ startDate = [event startDate]; daylightOffset = 0; - + if ([co isNew] && [co isKindOfClass: [SOGoAppointmentOccurence class]]) - { - // We are creating a new exception in a recurrent event -- compute the daylight - // saving time with respect to the first occurrence of the recurrent event. - master = (iCalEvent*)[[event parent] firstChildWithTag: @"vevent"]; - firstDate = [master startDate]; - timeZone = [[context activeUser] timeZone]; - - if ([timeZone isDaylightSavingTimeForDate: startDate] != [timeZone isDaylightSavingTimeForDate: firstDate]) - { - daylightOffset = (signed int)[timeZone secondsFromGMTForDate: firstDate] - - (signed int)[timeZone secondsFromGMTForDate: startDate]; - startDate = [startDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset]; - } - } - + { + // We are creating a new exception in a recurrent event -- compute the daylight + // saving time with respect to the first occurrence of the recurrent event. + master = (iCalEvent*)[[event parent] firstChildWithTag: @"vevent"]; + firstDate = [master startDate]; + timeZone = [[context activeUser] timeZone]; + + if ([timeZone isDaylightSavingTimeForDate: startDate] != [timeZone isDaylightSavingTimeForDate: firstDate]) + { + daylightOffset = (signed int)[timeZone secondsFromGMTForDate: firstDate] + - (signed int)[timeZone secondsFromGMTForDate: startDate]; + startDate = [startDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset]; + } + } + isAllDay = [event isAllDay]; if (isAllDay) - endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1]; + endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1]; else - endDate = [[event endDate] dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset]; + endDate = [[event endDate] dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset]; isTransparent = ![event isOpaque]; } From 98fd12e7412621f0fcc2d8c334a38cb124cfb402 Mon Sep 17 00:00:00 2001 From: C Robert Date: Tue, 14 Jul 2009 18:04:50 +0000 Subject: [PATCH 3/3] Monotone-Parent: d2b6077fa24d79c27ba0efea14127c05071e51b9 Monotone-Revision: d5700732397ebf4e67639bb33ff05a1c35349ff0 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-14T18:04:50 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Scheduler/UIxComponentEditor.m | 13 +++++++++++++ UI/WebServerResources/UIxComponentEditor.js | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 65b9a4fab..227eea70c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-14 Cyril Robert + + * UI/Scheduler/UIxComponentEditor.m: Added a default title for + vevents and vtodos + 2009-07-14 Francis Lachapelle * SoObjects/Appointments/SOGoCalendarComponent.m diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 089a67ebc..5fbc6afd7 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -614,6 +614,19 @@ iRANGE(2); - (NSString *) title { + SOGoObject *co; + NSString *tag; + + co = [self clientObject]; + if ([co isNew] && [co isKindOfClass: [SOGoCalendarComponent class]]) + { + tag = [co componentTag]; + if ([tag isEqualToString: @"vevent"]) + [self setTitle: [self labelForKey: @"New Event"]]; + else if ([tag isEqualToString: @"vtodo"]) + [self setTitle: [self labelForKey: @"New Task"]]; + } + return title; } diff --git a/UI/WebServerResources/UIxComponentEditor.js b/UI/WebServerResources/UIxComponentEditor.js index dabd8af18..0b8940ebc 100644 --- a/UI/WebServerResources/UIxComponentEditor.js +++ b/UI/WebServerResources/UIxComponentEditor.js @@ -135,11 +135,17 @@ function onComponentEditorLoad(event) { $("repeatList").observe("change", onPopupRecurrenceWindow); $("reminderHref").observe("click", onPopupReminderWindow); $("reminderList").observe("change", onPopupReminderWindow); + $("summary").observe("keyup", onSummaryChange); Event.observe(window, "resize", onWindowResize); onPopupRecurrenceWindow(null); onPopupReminderWindow(null); + onSummaryChange (null); +} + +function onSummaryChange (e) { + document.title = $("summary").value; } function onWindowResize(event) {