From dbaf83902506ca79c43f669fdbc5389b3d75c9fb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 27 May 2010 13:30:36 +0000 Subject: [PATCH] Monotone-Parent: c81c7151deb5466ad48ca5eb97d70f3b1172934c Monotone-Revision: aae7c0443ed50c145721274def3a8a4f2d2216e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-27T13:30:36 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 14 ++++ .../Localizable.strings | 2 - UI/Scheduler/Czech.lproj/Localizable.strings | 2 - UI/Scheduler/Dutch.lproj/Localizable.strings | 1 - .../English.lproj/Localizable.strings | 2 - UI/Scheduler/French.lproj/Localizable.strings | 2 - UI/Scheduler/German.lproj/Localizable.strings | 2 - .../Hungarian.lproj/Localizable.strings | 2 - .../Italian.lproj/Localizable.strings | 2 - .../Russian.lproj/Localizable.strings | 2 - .../Spanish.lproj/Localizable.strings | 2 - .../Swedish.lproj/Localizable.strings | 2 - UI/Scheduler/Welsh.lproj/Localizable.strings | 2 - .../SchedulerUI/UIxAttendeesEditor.wox | 51 ++++++------- UI/WebServerResources/UIxAttendeesEditor.css | 20 ++--- UI/WebServerResources/UIxAttendeesEditor.js | 74 ++++++++++--------- 16 files changed, 80 insertions(+), 102 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6fe4e772..6b0af4fdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2010-05-26 Wolfgang Sourdeau + + * UI/WebServerResources/UIxAttendeesEditor.js: + (toggleOfficeHours): removed obsolete method. + (initialiseTimeSlotWidgets): we now initialize the time range + hours to the day start hour and day end hour, respectively, + instead of the event start and end time. + (handleAllDay): we make use of the "dayStartHour" and "dayEndHour" + variables instead of hardcoded values. Also, we hide the time + range widgets when this code is executed. + (availabilityController.onNextSlotClick, + availabilityController.onPreviousSlotClick): ignore clicks when a + request is already active. + 2010-05-25 Wolfgang Sourdeau * SoObjects/Appointments/SOGoCalendarComponent.m diff --git a/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings b/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings index 588b37031..fdcfb6802 100644 --- a/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings +++ b/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "A data que você informou ocorre antes da data ini "Next hour" = "Próxima hora"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Czech.lproj/Localizable.strings b/UI/Scheduler/Czech.lproj/Localizable.strings index 4ec2c82db..4753074bc 100644 --- a/UI/Scheduler/Czech.lproj/Localizable.strings +++ b/UI/Scheduler/Czech.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "Zadané datum konce je před začátkem události. "Next hour" = "Následující hodina"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Dutch.lproj/Localizable.strings b/UI/Scheduler/Dutch.lproj/Localizable.strings index 20e994f6e..64e35a69f 100644 --- a/UI/Scheduler/Dutch.lproj/Localizable.strings +++ b/UI/Scheduler/Dutch.lproj/Localizable.strings @@ -484,7 +484,6 @@ validate_endbeforestart = "Het begin vindt plaats vóór het einde."; "Next hour" = "Volgend uur"; "Work days only" = "Slechts werkdagen"; "The whole day" = "De hele dag"; -"During specified hours" = "Tijdens gespecificeerde uren"; "and" = "en"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index ebafba714..b33094d42 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "The end date that you entered occurs before the st "Next hour" = "Next hour"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index b75b0cce0..4eb003ad4 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "La date de fin est avant la date de début."; "Next hour" = "Prochaine heure"; "Work days only" = "Seulement les jours ouvrables"; "The whole day" = "La journée complète"; -"During office hours" = "Pendant les heures de bureau"; -"During specified hours" = "Pendant les heures spécifiées"; "and" = "et"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/German.lproj/Localizable.strings b/UI/Scheduler/German.lproj/Localizable.strings index 3707d52fc..ebe75189e 100644 --- a/UI/Scheduler/German.lproj/Localizable.strings +++ b/UI/Scheduler/German.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "Ihr Beginn ist nach dem Ende"; "Next hour" = "Nächste Stunde"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Hungarian.lproj/Localizable.strings b/UI/Scheduler/Hungarian.lproj/Localizable.strings index 87235bd97..55ac0b840 100644 --- a/UI/Scheduler/Hungarian.lproj/Localizable.strings +++ b/UI/Scheduler/Hungarian.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "A megadott befejező dátum korábbi, mint a kezd "Next hour" = "Következő óra"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Italian.lproj/Localizable.strings b/UI/Scheduler/Italian.lproj/Localizable.strings index 7394edc0e..25e015201 100644 --- a/UI/Scheduler/Italian.lproj/Localizable.strings +++ b/UI/Scheduler/Italian.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "La data finale specificata è precedente alla data "Next hour" = "Ora successiva"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Russian.lproj/Localizable.strings b/UI/Scheduler/Russian.lproj/Localizable.strings index bd18894df..1c8d5cd29 100644 --- a/UI/Scheduler/Russian.lproj/Localizable.strings +++ b/UI/Scheduler/Russian.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "The end date that you entered occurs before the st "Next hour" = "Next hour"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Spanish.lproj/Localizable.strings b/UI/Scheduler/Spanish.lproj/Localizable.strings index 4d4935cfe..0563b37f7 100644 --- a/UI/Scheduler/Spanish.lproj/Localizable.strings +++ b/UI/Scheduler/Spanish.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "Su fecha/hora de comienzo es posterio a la de fina "Next hour" = "Hora siguiente"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Swedish.lproj/Localizable.strings b/UI/Scheduler/Swedish.lproj/Localizable.strings index 16f6f8354..251a208c9 100644 --- a/UI/Scheduler/Swedish.lproj/Localizable.strings +++ b/UI/Scheduler/Swedish.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "Angivet slutdatumet inträffar före angivet start "Next hour" = "Nästa timme"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Scheduler/Welsh.lproj/Localizable.strings b/UI/Scheduler/Welsh.lproj/Localizable.strings index 8cd6a6cf7..50bc6d823 100644 --- a/UI/Scheduler/Welsh.lproj/Localizable.strings +++ b/UI/Scheduler/Welsh.lproj/Localizable.strings @@ -484,8 +484,6 @@ validate_endbeforestart = "Mae'r dyddiad gorffen sydd wedi'i roi yn digwydd c "Next hour" = "Awr nesaf"; "Work days only" = "Work days only"; "The whole day" = "The whole day"; -"During office hours" = "During office hours"; -"During specified hours" = "During specified hours"; "and" = "and"; "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?" diff --git a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox index e59d2fd4c..686082b5e 100644 --- a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox +++ b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox @@ -19,6 +19,28 @@ var dayEndHour = ;
+
+ + + + + + + + + + + + + + +
+
@@ -88,35 +110,6 @@ > -
-
- -
- - - - - -
- - -
DIV.buttons { margin: 0px; - margin-top: 4px; - background-color: #000; } - -DIV#freeBusyZoomButtons -{ position: absolute; - height: 2em; - top: 0px; - right: 0px; } + margin-top: 4px; } DIV#freeBusyReplicas { position: absolute; diff --git a/UI/WebServerResources/UIxAttendeesEditor.js b/UI/WebServerResources/UIxAttendeesEditor.js index 5cd5a82ba..d1d295204 100644 --- a/UI/WebServerResources/UIxAttendeesEditor.js +++ b/UI/WebServerResources/UIxAttendeesEditor.js @@ -20,15 +20,17 @@ var attendeesEditor = { }; function handleAllDay() { - window.timeWidgets['end']['hour'].value = 17; - window.timeWidgets['end']['minute'].value = 0; - window.timeWidgets['start']['hour'].value = 9; + window.timeWidgets['start']['hour'].value = dayStartHour; window.timeWidgets['start']['minute'].value = 0; + window.timeWidgets['end']['hour'].value = dayEndHour; + window.timeWidgets['end']['minute'].value = 0; $("startTime_time_hour").disabled = true; $("startTime_time_minute").disabled = true; $("endTime_time_hour").disabled = true; $("endTime_time_minute").disabled = true; + + $("freeBusyTimeRange").addClassName("hidden"); } /* address completion */ @@ -550,6 +552,7 @@ function availabilitySession(uids, direction, start, end, listener) { this._findDate = this._backwardFindDate; this._adjustCurrentStart = this._backwardAdjustCurrentStart; } + this.mStart = start; this.mStartLimit = 0; @@ -756,6 +759,7 @@ availabilitySession.prototype = { }; function availabilityController(previousSlotButton, nextSlotButton) { + this.mActive = false; this.previousSlotButton = previousSlotButton; this.nextSlotButton = nextSlotButton; @@ -766,15 +770,22 @@ function availabilityController(previousSlotButton, nextSlotButton) { } availabilityController.prototype = { + mActive: false, previousSlotButton: null, nextSlotButton: null, onPreviousSlotClick: function ac_onPreviousSlotClick(event) { - this._findSlot(-1); + if (!this.mActive) { + this.mActive = true; + this._findSlot(-1); + } this.previousSlotButton.blur(); }, onNextSlotClick: function aC_onNextSlotClick(event) { - this._findSlot(1); + if (!this.mActive) { + this.mActive = true; + this._findSlot(1); + } this.nextSlotButton.blur(); }, _findSlot: function aC__findSlot(direction) { @@ -788,22 +799,27 @@ availabilityController.prototype = { } var start = window.timeWidgets['start']['date'].valueAsDate(); - start.setHours(window.timeWidgets['start']['hour'].value); - start.setMinutes(window.timeWidgets['start']['minute'].value); - var end = window.timeWidgets['end']['date'].valueAsDate(); - end.setHours(window.timeWidgets['end']['hour'].value); - end.setMinutes(window.timeWidgets['end']['minute'].value); + if (isAllDay) { + start.setHours(dayStartHour); + start.setMinutes(0); + start.setSeconds(0); + end.setHours(dayEndHour); + end.setMinutes(0); + end.setSeconds(0); + } + else { + start.setHours(window.timeWidgets['start']['hour'].value); + start.setMinutes(window.timeWidgets['start']['minute'].value); + end.setHours(window.timeWidgets['end']['hour'].value); + end.setMinutes(window.timeWidgets['end']['minute'].value); + } var session = new availabilitySession(uids, direction, start, end, this); - var limits = $("timeSlotLimits"); - if (limits.value == "office-hours") { - var start = dayStartHour * 4; - var end = dayEndHour * 4; - session.setLimits(start, end); - } - else if (limits.value == "range") { + if (isAllDay) { + session.setLimits(dayStartHour * 4, dayEndHour * 4); + } else { var start = (parseInt($("timeSlotStartLimitHour").value) + parseInt($("timeSlotStartLimitMinute").value)); var end = (parseInt($("timeSlotEndLimitHour").value) @@ -828,6 +844,7 @@ availabilityController.prototype = { else { redisplayEventSpans(); } + this.mActive = false; } }; @@ -1169,9 +1186,9 @@ function initializeTimeSlotWidgets() { } } var limitWidget = $("timeSlotStartLimitHour"); - limitWidget.value = parseInt($("startTime_time_hour").value) * 4; + limitWidget.value = dayStartHour * 4; limitWidget = $("timeSlotEndLimitHour"); - limitWidget.value = parseInt($("endTime_time_hour").value) * 4; + limitWidget.value = dayEndHour * 4; var minuteWidgets = [ "timeSlotStartLimitMinute", "timeSlotEndLimitMinute" ]; @@ -1227,20 +1244,6 @@ function scrollToEvent () { dataDiv.scrollLeft = headerDiv.scrollLeft; } -function toggleOfficeHours () { - var endDate = window.getEndDate(); - var startDate = window.getStartDate(); - - if (startDate.getHours () < dayStartHour - || startDate.getHours () > dayEndHour - || endDate.getHours () > dayEndHour - || endDate.getHours () < dayStartHour) { - if ($("onlyOfficeHours")) { - $("onlyOfficeHours").checked = false; - } - } -} - function updateSlotDisplayCallback(http) { var data = http.responseText.evalJSON(true); var start = new Date(); @@ -1565,9 +1568,10 @@ function onFreeBusyLoadHandler() { 'minute': $("endTime_time_minute")}}; synchronizeWithParent("startTime", "startTime"); synchronizeWithParent("endTime", "endTime"); - initTimeWidgets(widgets); + initTimeWidgets(widgets); initializeTimeSlotWidgets(); + initializeWindowButtons(); prepareTableHeaders(); prepareTableRows(); @@ -1577,7 +1581,6 @@ function onFreeBusyLoadHandler() { Event.observe(window, "resize", onWindowResize); $$('TABLE#freeBusy TD.freeBusyData DIV').first().observe("scroll", onScroll); scrollToEvent(); - toggleOfficeHours(); } document.observe("dom:loaded", onFreeBusyLoadHandler); @@ -1652,7 +1655,6 @@ function onAdjustTime(event) { // Specific function for the attendees editor onTimeDateWidgetChange(); - toggleOfficeHours (); } function _getDate(which) {