diff --git a/ChangeLog b/ChangeLog index 18a80e335..7bb1765b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2007-06-11 Wolfgang Sourdeau + + * UI/Scheduler/UIxCalMonthView.m: no longer retrieve appointments. + + * UI/Scheduler/UIxCalView.m ([-fetchCoreAppointmentsInfos]): + removed method. + ([-fetchCoreTasksInfos]): removed method. + + * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions + -init]): initialize an instance of SOGoDateFormatter. + ([UIxCalListingActions -eventsListAction]): the display start and + end dates are added to the listing for each event. + + * UI/Scheduler/UIxCalDayTable.m: no longer retrieve appointments. + + * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor + -isAllDay]): returns YES if the "hm" url parameter is set to + "allday". + ([UIxAppointmentEditor -defaultAction]): if isAllDay, the enddate + is displayed one day earlier. + 2007-06-07 Wolfgang Sourdeau * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index d18e248a1..9332a7e5c 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -541,7 +541,7 @@ static BOOL uixDebugEnabled = NO; - (NSDictionary *)locale { /* we need no fallback here, as locale is guaranteed to be set by sogod */ - return [[self context] valueForKey:@"locale"]; + return [context valueForKey: @"locale"]; } - (WOResourceManager *) pageResourceManager diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 1725abe45..365cab4e3 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -69,7 +69,12 @@ /* icalendar values */ - (BOOL) isAllDay { - return isAllDay; + NSString *hm; + + hm = [self queryParameterForKey: @"hm"]; + + return (isAllDay + || (hm && [hm isEqualToString: @"allday"])); } - (void) setIsAllDay: (BOOL) newIsAllDay @@ -249,7 +254,11 @@ if (event) { startDate = [event startDate]; - endDate = [event endDate]; + isAllDay = [event isAllDay]; + if (isAllDay) + endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1]; + else + endDate = [event endDate]; } else { @@ -304,7 +313,7 @@ iCalString = [[clientObject calendar: NO] versitString]; [clientObject saveContentString: iCalString]; - return [self jsCloseWithRefreshMethod: @"refreshAppointmentsAndDisplay()"]; + return [self jsCloseWithRefreshMethod: @"refreshEventsAndDisplay()"]; } - (BOOL) shouldTakeValuesFromRequest: (WORequest *) request diff --git a/UI/Scheduler/UIxCalDayTable.h b/UI/Scheduler/UIxCalDayTable.h index 1cd2d3ad0..37f6364d6 100644 --- a/UI/Scheduler/UIxCalDayTable.h +++ b/UI/Scheduler/UIxCalDayTable.h @@ -40,9 +40,6 @@ NSString *currentTableHour; NSMutableArray *daysToDisplay; NSMutableArray *hoursToDisplay; - NSArray *allAppointments; - - NSDictionary *currentAppointment; NSString *cssClass; NSString *cssId; @@ -65,9 +62,6 @@ - (void) setCurrentTableDay: (NSCalendarDate *) aTableDay; - (NSCalendarDate *) currentTableDay; -- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment; -- (NSDictionary *) currentAppointment; - @end #endif /* UIXCALDAYTABLE_H */ diff --git a/UI/Scheduler/UIxCalDayTable.m b/UI/Scheduler/UIxCalDayTable.m index 0cb213e29..aac4cf73f 100644 --- a/UI/Scheduler/UIxCalDayTable.m +++ b/UI/Scheduler/UIxCalDayTable.m @@ -41,7 +41,7 @@ { if ((self = [super init])) { - allAppointments = nil; +// allAppointments = nil; daysToDisplay = nil; hoursToDisplay = nil; numberOfDays = 1; @@ -57,12 +57,10 @@ - (void) dealloc { - if (allAppointments) - [allAppointments release]; - if (daysToDisplay) - [daysToDisplay release]; - if (hoursToDisplay) - [hoursToDisplay release]; +// if (allAppointments) +// [allAppointments release]; + [daysToDisplay release]; + [hoursToDisplay release]; [dateFormatter release]; [super dealloc]; } @@ -90,11 +88,8 @@ - (void) setNumberOfDays: (NSString *) aNumber { numberOfDays = [aNumber intValue]; - if (daysToDisplay) - { - [daysToDisplay release]; - daysToDisplay = nil; - } + [daysToDisplay release]; + daysToDisplay = nil; } - (NSString *) numberOfDays @@ -105,11 +100,8 @@ - (void) setStartDate: (NSCalendarDate *) aStartDate { startDate = aStartDate; - if (daysToDisplay) - { - [daysToDisplay release]; - daysToDisplay = nil; - } + [daysToDisplay release]; + daysToDisplay = nil; } - (NSCalendarDate *) startDate @@ -169,6 +161,7 @@ [daysToDisplay addObject: [currentDate dateByAddingYears: 0 months: 0 days: count]]; + } return daysToDisplay; @@ -201,94 +194,97 @@ - (NSString *) labelForDay { - return [NSString stringWithFormat: @"%@
%@", - [dateFormatter shortDayOfWeek: [currentTableDay dayOfWeek]], - [dateFormatter stringForObjectValue: currentTableDay]]; + return [dateFormatter shortDayOfWeek: [currentTableDay dayOfWeek]]; } -- (NSDictionary *) _adjustedAppointment: (NSDictionary *) anAppointment - forStart: (NSCalendarDate *) start - andEnd: (NSCalendarDate *) end +- (NSString *) labelForDate { - NSMutableDictionary *newMutableAppointment; - NSDictionary *newAppointment; - BOOL startIsEarlier, endIsLater; + return [dateFormatter stringForObjectValue: currentTableDay]; +} - startIsEarlier - = ([[anAppointment objectForKey: @"startDate"] laterDate: start] == start); - endIsLater - = ([[anAppointment objectForKey: @"endDate"] earlierDate: end] == end); +// - (NSDictionary *) _adjustedAppointment: (NSDictionary *) anAppointment +// forStart: (NSCalendarDate *) start +// andEnd: (NSCalendarDate *) end +// { +// NSMutableDictionary *newMutableAppointment; +// NSDictionary *newAppointment; +// BOOL startIsEarlier, endIsLater; - if (startIsEarlier || endIsLater) - { - newMutableAppointment - = [NSMutableDictionary dictionaryWithDictionary: anAppointment]; +// startIsEarlier +// = ([[anAppointment objectForKey: @"startDate"] laterDate: start] == start); +// endIsLater +// = ([[anAppointment objectForKey: @"endDate"] earlierDate: end] == end); + +// if (startIsEarlier || endIsLater) +// { +// newMutableAppointment +// = [NSMutableDictionary dictionaryWithDictionary: anAppointment]; - if (startIsEarlier) - [newMutableAppointment setObject: start - forKey: @"startDate"]; - if (endIsLater) - [newMutableAppointment setObject: end - forKey: @"endDate"]; +// if (startIsEarlier) +// [newMutableAppointment setObject: start +// forKey: @"startDate"]; +// if (endIsLater) +// [newMutableAppointment setObject: end +// forKey: @"endDate"]; - newAppointment = newMutableAppointment; - } - else - newAppointment = anAppointment; +// newAppointment = newMutableAppointment; +// } +// else +// newAppointment = anAppointment; - return newAppointment; -} +// return newAppointment; +// } -- (NSArray *) appointmentsForCurrentDay -{ - NSMutableArray *filteredAppointments; - NSEnumerator *aptsEnumerator; - NSDictionary *currentDayAppointment; - NSCalendarDate *start, *end; - int endHour; +// - (NSArray *) appointmentsForCurrentDay +// { +// NSMutableArray *filteredAppointments; +// NSEnumerator *aptsEnumerator; +// NSDictionary *currentDayAppointment; +// NSCalendarDate *start, *end; +// int endHour; - if (!allAppointments) - { - allAppointments = [self fetchCoreAppointmentsInfos]; - [allAppointments retain]; - } +// if (!allAppointments) +// { +// allAppointments = [self fetchCoreAppointmentsInfos]; +// [allAppointments retain]; +// } - filteredAppointments = [NSMutableArray new]; - [filteredAppointments autorelease]; +// filteredAppointments = [NSMutableArray new]; +// [filteredAppointments autorelease]; - start = [currentTableDay hour: [self dayStartHour] minute: 0]; - endHour = [self dayEndHour]; - if (endHour < 24) - end = [currentTableDay hour: [self dayEndHour] minute: 59]; - else - end = [[currentTableDay tomorrow] hour: 0 minute: 0]; +// start = [currentTableDay hour: [self dayStartHour] minute: 0]; +// endHour = [self dayEndHour]; +// if (endHour < 24) +// end = [currentTableDay hour: [self dayEndHour] minute: 59]; +// else +// end = [[currentTableDay tomorrow] hour: 0 minute: 0]; - aptsEnumerator = [allAppointments objectEnumerator]; - currentDayAppointment = [aptsEnumerator nextObject]; - while (currentDayAppointment) - { - if (([end laterDate: [currentDayAppointment - valueForKey: @"startDate"]] == end) - && ([start earlierDate: [currentDayAppointment - valueForKey: @"endDate"]] == start)) - [filteredAppointments - addObject: [self _adjustedAppointment: currentDayAppointment - forStart: start andEnd: end]]; - currentDayAppointment = [aptsEnumerator nextObject]; - } +// aptsEnumerator = [allAppointments objectEnumerator]; +// currentDayAppointment = [aptsEnumerator nextObject]; +// while (currentDayAppointment) +// { +// if (([end laterDate: [currentDayAppointment +// valueForKey: @"startDate"]] == end) +// && ([start earlierDate: [currentDayAppointment +// valueForKey: @"endDate"]] == start)) +// [filteredAppointments +// addObject: [self _adjustedAppointment: currentDayAppointment +// forStart: start andEnd: end]]; +// currentDayAppointment = [aptsEnumerator nextObject]; +// } - return filteredAppointments; -} +// return filteredAppointments; +// } -- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment -{ - currentAppointment = newCurrentAppointment; -} +// - (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment +// { +// currentAppointment = newCurrentAppointment; +// } -- (NSDictionary *) currentAppointment -{ - return currentAppointment; -} +// - (NSDictionary *) currentAppointment +// { +// return currentAppointment; +// } - (NSString *) appointmentsClasses { diff --git a/UI/Scheduler/UIxCalListingActions.h b/UI/Scheduler/UIxCalListingActions.h index c222ec0c1..ed455673f 100644 --- a/UI/Scheduler/UIxCalListingActions.h +++ b/UI/Scheduler/UIxCalListingActions.h @@ -31,6 +31,8 @@ @class NSString; @class NSTimeZone; +@class SOGoDateFormatter; + @class WOResponse; @class WORequest; @@ -41,6 +43,7 @@ NSCalendarDate *endDate; NSString *userLogin; WORequest *request; + SOGoDateFormatter *dateFormatter; } - (WOResponse *) eventsListAction; diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 246462dc4..02987da45 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -38,27 +38,33 @@ #import #import +#import "../SOGoUI/SOGoDateFormatter.h" + #import "UIxCalListingActions.h" @implementation UIxCalListingActions - (id) init { + NSDictionary *locale; + if ((self = [super init])) { componentsData = [NSMutableDictionary new]; startDate = nil; endDate = nil; request = nil; -// knowsToShow = NO; -// showCompleted = NO; - } + locale = [[self context] valueForKey: @"locale"]; + dateFormatter = [[SOGoDateFormatter alloc] initWithLocale: locale]; + [dateFormatter setFullWeekdayNameAndDetails]; + } return self; } - (void) dealloc { + [dateFormatter release]; [componentsData release]; [startDate release]; [endDate release]; @@ -159,7 +165,7 @@ else startDate = nil; - param = [request formValueForKey: @"sd"]; + param = [request formValueForKey: @"ed"]; if ([param length] > 0) endDate = [[NSCalendarDate dateFromShortDateString: param andShortTimeString: nil @@ -292,16 +298,42 @@ - (WOResponse *) eventsListAction { - NSArray *fields; - NSArray *events; + NSArray *fields, *oldEvent; + NSEnumerator *events; + NSString *date; + NSMutableArray *newEvents, *newEvent; + unsigned int interval; [self _setupContext]; + newEvents = [NSMutableArray array]; fields = [NSArray arrayWithObjects: @"c_name", @"owner", @"status", - @"title", @"startdate", @"enddate", @"location", nil]; - events = [self _fetchFields: fields forComponentOfType: @"vevent"]; + @"title", @"startdate", @"enddate", @"location", + @"isallday", nil]; + events = [[self _fetchFields: fields + forComponentOfType: @"vevent"] objectEnumerator]; + oldEvent = [events nextObject]; + while (oldEvent) + { + newEvent = [NSMutableArray arrayWithArray: oldEvent]; + interval = [[oldEvent objectAtIndex: 4] intValue]; + date + = [dateFormatter stringForObjectValue: + [NSCalendarDate dateWithTimeIntervalSince1970: interval]]; + [newEvent addObject: date]; + interval = [[oldEvent objectAtIndex: 5] intValue]; + if ([[oldEvent objectAtIndex: 7] boolValue]) + interval -= 86400; + date + = [dateFormatter stringForObjectValue: + [NSCalendarDate dateWithTimeIntervalSince1970: interval]]; + [newEvent addObject: date]; + [newEvents addObject: newEvent]; - return [self _responseWithData: events]; + oldEvent = [events nextObject]; + } + + return [self _responseWithData: newEvents]; } - (NSString *) _getStatusClassForStatusCode: (int) statusCode diff --git a/UI/Scheduler/UIxCalMonthView.m b/UI/Scheduler/UIxCalMonthView.m index 53bd5a757..9f3076650 100644 --- a/UI/Scheduler/UIxCalMonthView.m +++ b/UI/Scheduler/UIxCalMonthView.m @@ -64,39 +64,6 @@ [super dealloc]; } -- (void) _addEventToSortedEvents: (NSDictionary *) newEvent -{ - NSMutableArray *eventArray; - NSString *dayId; - - dayId = [[newEvent objectForKey: @"startDate"] shortDateString]; - eventArray = [sortedAppointments objectForKey: dayId]; - if (!eventArray) - { - eventArray = [NSMutableArray new]; - [eventArray autorelease]; - [sortedAppointments setObject: eventArray forKey: dayId]; - } - [eventArray addObject: newEvent]; -} - -- (id ) defaultAction -{ - NSEnumerator *events; - NSDictionary *currentEvent; - - events = [[self fetchCoreAppointmentsInfos] objectEnumerator]; - currentEvent = [events nextObject]; - while (currentEvent) - { - [self _addEventToSortedEvents: currentEvent]; - currentEvent = [events nextObject]; -// NSLog (@"event:\n'%@'", currentEvent); - } - - return self; -} - - (NSArray *) headerDaysToDisplay { NSMutableArray *headerDaysToDisplay; diff --git a/UI/Scheduler/UIxCalView.h b/UI/Scheduler/UIxCalView.h index 396afe10e..6aa6ca243 100644 --- a/UI/Scheduler/UIxCalView.h +++ b/UI/Scheduler/UIxCalView.h @@ -98,8 +98,6 @@ - (NSCalendarDate *) startDate; - (NSCalendarDate *) endDate; -- (NSArray *) fetchCoreAppointmentsInfos; -- (NSArray *) fetchCoreTasksInfos; /* date selection */ diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index da409b0ee..351a21b52 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -451,135 +451,6 @@ static BOOL shouldDisplayWeekend = NO; return [[self startDate] tomorrow]; } -- (SOGoAppointmentFolder *) _aptFolder: (NSString *) folder - withClientObject: (SOGoAppointmentFolder *) clientObject -{ - SOGoAppointmentFolder *aptFolder; - NSArray *folderParts; - - if ([folder isEqualToString: @"/"]) - aptFolder = clientObject; - else - { - folderParts = [folder componentsSeparatedByString: @":"]; - aptFolder - = [clientObject lookupCalendarFolderForUID: - [folderParts objectAtIndex: 0]]; - } - - return aptFolder; -} - -- (NSArray *) _activeCalendarFolders -{ - NSMutableArray *activeFolders; - NSEnumerator *folders; - NSDictionary *currentFolderDict; - SOGoAppointmentFolder *currentFolder, *clientObject; - - activeFolders = [NSMutableArray new]; - [activeFolders autorelease]; - - clientObject = [self clientObject]; - - folders = [[clientObject calendarFolders] objectEnumerator]; - currentFolderDict = [folders nextObject]; - while (currentFolderDict) - { - if ([[currentFolderDict objectForKey: @"active"] boolValue]) - { - currentFolder - = [self _aptFolder: [currentFolderDict objectForKey: @"folder"] - withClientObject: clientObject]; - [activeFolders addObject: currentFolder]; - } - - currentFolderDict = [folders nextObject]; - } - - return activeFolders; -} - -- (void) _updatePrivacyInObjects: (NSArray *) objectInfos - fromFolder: (SOGoAppointmentFolder *) folder -{ - int hideDetails[] = {-1, -1, -1}; - NSMutableDictionary *currentRecord; - int privacyFlag; - NSString *roleString, *userLogin; - NSEnumerator *infos; - - userLogin = [[context activeUser] login]; - infos = [objectInfos objectEnumerator]; - currentRecord = [infos nextObject]; - while (currentRecord) - { - privacyFlag = [[currentRecord objectForKey: @"classification"] intValue]; - if (hideDetails[privacyFlag] == -1) - { - roleString = [folder roleForComponentsWithAccessClass: privacyFlag - forUser: userLogin]; - hideDetails[privacyFlag] = ([roleString isEqualToString: @"ComponentDAndTViewer"] - ? 1 : 0); - } - if (hideDetails[privacyFlag]) - { - [currentRecord setObject: [self labelForKey: @"(Private Event)"] - forKey: @"title"]; - [currentRecord setObject: @"" forKey: @"location"]; - } - currentRecord = [infos nextObject]; - } -} - -- (NSArray *) _fetchCoreInfosForComponent: (NSString *) component -{ - NSArray *currentInfos; - NSMutableArray *infos; - NSEnumerator *folders; - SOGoAppointmentFolder *currentFolder; - - infos = [componentsData objectForKey: component]; - if (!infos) - { - infos = [NSMutableArray array]; - folders = [[self _activeCalendarFolders] objectEnumerator]; - currentFolder = [folders nextObject]; - while (currentFolder) - { - currentInfos = [currentFolder fetchCoreInfosFrom: [[self startDate] beginOfDay] - to: [[self endDate] endOfDay] - component: component]; - [currentInfos makeObjectsPerform: @selector (setObject:forKey:) - withObject: [currentFolder ownerInContext: nil] - withObject: @"owner"]; - [self _updatePrivacyInObjects: currentInfos - fromFolder: currentFolder]; - [infos addObjectsFromArray: currentInfos]; - currentFolder = [folders nextObject]; - } - [componentsData setObject: infos forKey: component]; - } - - return infos; -} - -- (NSArray *) fetchCoreAppointmentsInfos -{ - if (!appointments) - [self setAppointments: [self _fetchCoreInfosForComponent: @"vevent"]]; - - return appointments; -} - -- (NSArray *) fetchCoreTasksInfos -{ - if (!tasks) - [self setTasks: [self _fetchCoreInfosForComponent: @"vtodo"]]; - - return tasks; -} - /* query parameters */ - (BOOL) shouldDisplayRejectedAppointments diff --git a/UI/Templates/SchedulerUI/UIxCalDayTable.wox b/UI/Templates/SchedulerUI/UIxCalDayTable.wox index 15662a4c3..0bf0f2e04 100644 --- a/UI/Templates/SchedulerUI/UIxCalDayTable.wox +++ b/UI/Templates/SchedulerUI/UIxCalDayTable.wox @@ -1,73 +1,89 @@ - -
-
-
:00
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
+ + +
+

- +
+
+ +
+
+
:00
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
diff --git a/UI/Templates/SchedulerUI/UIxCalDayView.wox b/UI/Templates/SchedulerUI/UIxCalDayView.wox index 821d803ba..deca9e61b 100644 --- a/UI/Templates/SchedulerUI/UIxCalDayView.wox +++ b/UI/Templates/SchedulerUI/UIxCalDayView.wox @@ -1,49 +1,49 @@ - - - - - - -
- -
-
+ + + + + + +
+ +
+
diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index fe34f7e23..34c751a41 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -89,10 +89,10 @@
- + - +
diff --git a/UI/Templates/SchedulerUI/UIxCalMonthView.wox b/UI/Templates/SchedulerUI/UIxCalMonthView.wox index cb098db59..4ef911bc5 100644 --- a/UI/Templates/SchedulerUI/UIxCalMonthView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMonthView.wox @@ -46,25 +46,25 @@ >
-
- - +
diff --git a/UI/WebServerResources/JavascriptAPIExtensions.js b/UI/WebServerResources/JavascriptAPIExtensions.js index 4e581cb91..ff9b05a1e 100644 --- a/UI/WebServerResources/JavascriptAPIExtensions.js +++ b/UI/WebServerResources/JavascriptAPIExtensions.js @@ -33,7 +33,15 @@ String.prototype.asDate = function () { newDate = new Date(date[2], date[1] - 1, date[0]); else { date = this.split("-"); - newDate = new Date(date[0], date[1] - 1, date[2]); + if (date.length == 3) + newDate = new Date(date[0], date[1] - 1, date[2]); + else { + if (this.length == 8) { + newDate = new Date(this.substring(0, 4), + this.substring(4, 6) - 1, + this.substring(6, 8)); + } + } } return newDate; @@ -99,6 +107,19 @@ Date.prototype.getHourString = function() { return newString; } +Date.prototype.getDisplayHoursString = function() { + var hoursString = this.getHours(); + if (hoursString.length == 1) + hoursString = '0' + hoursString; + + var minutesString = this.getMinutes(); + if (minutesString.length == 1) + minutesString = '0' + minutesString; + + + return hoursString + ":" + minutesString; +} + Date.prototype.stringWithSeparator = function(separator) { var month = '' + (this.getMonth() + 1); var day = '' + this.getDate(); @@ -118,3 +139,19 @@ Date.prototype.stringWithSeparator = function(separator) { Date.prototype.sogoFreeBusyStringWithSeparator = function(separator) { return this.sogoDayName() + ", " + this.stringWithSeparator(separator); } + +Date.prototype.addDays = function(nbrDays) { + var milliSeconds = this.getTime(); + milliSeconds += 86400000 * nbrDays; + this.setTime(milliSeconds); +} + +Date.prototype.earlierDate = function(otherDate) { + return ((this.getTime() < otherDate.getTime()) + ? this : otherDate); +} + +Date.prototype.laterDate = function(otherDate) { + return ((this.getTime() < otherDate.getTime()) + ? otherDate : this); +} diff --git a/UI/WebServerResources/SchedulerUI.css b/UI/WebServerResources/SchedulerUI.css index a9a297310..45af96731 100644 --- a/UI/WebServerResources/SchedulerUI.css +++ b/UI/WebServerResources/SchedulerUI.css @@ -124,8 +124,7 @@ UL#tasksList LI[class~="_selected"].duelater } DIV#rightPanel -{ - position: absolute; +{ position: absolute; top: 5.5em; left: 18.5em; right: 0px; @@ -135,69 +134,56 @@ DIV#rightPanel padding: 0px; overflow: hidden; } -DIV#appointmentsListView +DIV#eventsListView { display: block; + cursor: default; position: absolute; background: #fff; top: 2.5em; left: 0px; right: 0px; - overflow: auto; - overflow-x: hidden; height: 15.5em; - min-width: 600px; } + overflow: auto; } DIV#calendarView -{ - position: absolute; +{ position: absolute; background: #fff; top: 18em; margin-top: 5px; bottom: 0px; width: 100%; border-top: 1px solid #aaa; - border-left: 1px solid #aaa; -} + border-left: 1px solid #aaa; } DIV#calendarView A -{ - text-decoration: none; +{ text-decoration: none; font: inherit; - color: inherit; -} + color: inherit; } #verticalDragHandle -{ - cursor: e-resize; +{ cursor: e-resize; top: 7.5em; left: 18.5em; width: 5px; - bottom: 0px; -} + bottom: 0px; } #rightDragHandle -{ - cursor: n-resize; +{ cursor: n-resize; top: 18em; left: 0px; right: 0px; - height: 5px; -} + height: 5px; } #filterPanel -{ - padding-right: .5em; -} +{ padding-right: .5em; } #dateSelector -{ - margin: 0px auto; +{ margin: 0px auto; background: #fff; border-top: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} + border-bottom: 1px solid #aaa; } #dateSelector > .header { background: #efefef; @@ -255,13 +241,11 @@ DIV#calendarView A width: 100%; } #dateSelector TABLE TABLE TD -{ - cursor: pointer; +{ cursor: pointer; margin: 0px; padding: 0px; width: 100%; - border: 1px solid #fff; -} + border: 1px solid #fff; } #dateSelector TABLE TABLE TD:hover { color: #f00; @@ -289,18 +273,18 @@ DIV#calendarView A { background: #ddd; border: 1px solid #deebf7; } -TABLE#appointmentsList +TABLE#eventsList { display: block; position: relative; width: 100%; } -TABLE#appointmentsList td.tbtv_subject_headercell, -TABLE#appointmentsList td.headerLocation +TABLE#eventsList td.tbtv_subject_headercell, +TABLE#eventsList td.headerLocation { width: 35%; } ._unfocused#dateSelector TD._selected, UL._unfocused > LI._selected, -TABLE._unfocused#appointmentsList TR._selected TD +TABLE._unfocused#eventsList TR._selected TD { background: #d4d0c8 !important;; color: #fff !important;; @@ -394,47 +378,95 @@ SPAN.day0, SPAN.week0, SPAN.month0 background: #ddd; } A.leftNavigationArrow -{ - position: absolute; +{ position: absolute; display: block; top: .5em; - left: .5em; -} + left: .5em; } A.rightNavigationArrow -{ - position: absolute; +{ position: absolute; display: block; top: .5em; - right: .5em; -} + right: .5em; } -DIV#calendarContent +DIV#calendarHeader, +DIV#daysView { position: absolute; - top: 3.5em; - padding: 0px; - margin: 0px; - bottom: 0px; + border: 0px; left: 0px; right: 0px; - overflow: auto; + padding: 0px; + margin: 0px; } + +DIV#daysView +{ top: 11em; + bottom: 0px; + border: 0px; + margin: 0px; + margin-left: 1px; + border-top: 2px solid #397d94; + overflow: auto; } + +DIV#calendarHeader +{ top: 3.5em; + height: 7.5em; } + +DIV#calendarHeader DIV.dayLabels, +DIV#calendarHeader DIV.days +{ position: absolute; + margin: 0px; + padding: 0px; + border: 0px; + border-left: 1px solid #397d94; + border-top: 1px solid #397d94; + left: 5em; + margin-left: 0px; + margin-right: 18px; + right: 0px; } + +DIV#calendarHeader DIV.dayLabels +{ bottom: 4em; + height: 3em; } + +DIV#calendarHeader DIV.dayLabels DIV.day +{ text-align: center; + font-weight: bold; + color: #77a; + background: #e7efef; } + +DIV#calendarHeader SPAN.dayOfWeek +{ font-size: medium; } + +DIV#calendarHeader DIV.dayLabels +{ cursor: default; } + +DIV#calendarHeader DIV.days +{ cursor: pointer; + bottom: 0px; + height: 4em; } + +DIV#calendarHeader DIV.day +{ height: 100%; + margin: 0px; + padding: 0px; + margin-right: 1px; } + +/* DIV#daysView /* background-position: top center; background-repeat: no-repeat; background-image: url("/SOGo.woa/WebServerResources/background.jpg"); - */} + } */ .menu LI.currentMonth, .menu LI.currentYear -{ - border-top: 1px solid #aaa; +{ border-top: 1px solid #aaa; border-left: 1px solid #aaa; border-bottom: 1px solid #fff; border-right: 1px solid #fff; background: #ccc; - color: #222; -} + color: #222; } -DIV.appointmentView +DIV.eventView { display: block; overflow: hidden; white-space: nowrap; @@ -442,18 +474,13 @@ DIV.appointmentView /* new draggable presentation */ -DIV.daysView -{ position: relative; - margin: 1em; - height: 100em; - border-bottom: 1px solid #397d94; } - -DIV.daysView DIV.days +DIV#daysView DIV.days { position: absolute; top: 0px; + border: 0px; bottom: 0px; left: 5em; - right: 0px; } + right: 3px; } DIV.multicolumnDayView DIV.lastDayUser { border-right: 1px solid #397d94; } @@ -461,7 +488,7 @@ DIV.multicolumnDayView DIV.lastDayUser DIV.monthView { position: absolute; left: .5em; - top: .5em; + top: 4em; right: 1em; bottom: 1em; border: 0px; @@ -478,6 +505,7 @@ DIV.monthView > DIV.days > DIV DIV.monthView > DIV.headerDay { text-align: center; + cursor: default; padding-top: .5em; border-left: 2px solid #397d94 !important; border-top: 2px solid #397d94 !important; @@ -487,26 +515,27 @@ DIV.monthView > DIV.headerDay font-weight: bold; background: #e7efef; } -DIV.monthView DIV.dayOfToday -{ border: 0px solid #397d94; - background-color: #deebf7; } +DIV.dayOfToday +{ background-color: #deebf7; } -DIV.monthView DIV.weekEndDay +DIV.weekEndDay { background-color: #fffbe7; } -DIV.monthView DIV.dayOfAnotherMonth +DIV.dayOfAnotherMonth { background-color: #e7efef; } -DIV.monthView DIV.selectedDay +DIV.selectedDay { background-color: #ffe79c; } DIV.monthView DIV.dayHeader { margin-left: 1em; + cursor: pointer; color: #397d94; font-weight: bold; } DIV.monthView DIV.days { top: 2em; + cursor: pointer; bottom: 0px; left: 0px; right: 0px; } @@ -583,36 +612,35 @@ DIV.monthView DIV.week5 DIV.monthView DIV.week6 { top: 90%; } -DIV.daysView DIV.day +DIV#calendarHeader DIV.day, +DIV#daysView DIV.day { position: absolute; border-left: 1px solid #397d94; - left: 0px; - top: 0px; - bottom: 0px; } + margin: 0px; + padding: 0px; + top: 0px; } -DIV.daysView > DIV.days > DIV.day > DIV.header -{ height: 3.5em; +DIV#calendarHeader DIV.day1 +{ border-left: 0px; } + +/* DIV#daysView > DIV.days > DIV.day > DIV.header +{ position: fixed; + top: ; + height: 3.5em; padding-top: .5em; border: 0px; border-top: 1px solid #397d94; font-weight: bold; text-align: center; background: #e7efef; - color: #397d94; } - -DIV.daysView > DIV.days > DIV.dayOfToday -{ background-color: #deebf7; } - -DIV.daysView > DIV.days > DIV.weekEndDay -{ background-color: #fffbe7; } - -DIV.daysView > DIV.days > DIV.selectedDay -{ background-color: #ffe79c; } + color: #397d94; } */ DIV.daysViewFor1Days DIV.day -{ width: 100%; - border-right: 1px solid #397d94; - left: 0px; } +{ border-right: 1px solid #397d94; + width: 100%; } + +/* DIV#daysView DIV.day +{ margin-right: 3px; } */ DIV.monthView DIV.headerDay, DIV.monthView DIV.day, @@ -651,158 +679,160 @@ DIV.daysViewFor7Days DIV.day0 { left: 85.7142%; border-right: 1px solid #397d94; } -DIV.daysView > DIV.hours +DIV#daysView > DIV.hours { position: absolute; border: 0px; left: 0px; - top: 4em; + top: 0px; width: 4.5em; height: 95.5em; font-weight: bold; - color: #77a; margin: 0px; padding-top: .5em; padding-right: .5em; border-left: 1px solid #397d94; + color: #77a; background: #e7efef; text-align: right; } -DIV.daysView > DIV.hours > DIV.hour +DIV#daysView > DIV.hours > DIV.hour { height: 4em; } -DIV.daysView > DIV.hourLines > DIV.hourLine +DIV#daysView > DIV.hourLines > DIV.hourLine { position: absolute; z-index: 1; height: 1px; left: 0px; right: 0px; - border-top: 1px solid #397d94; } + padding-left: 1em; + margin-right: 2px; + border-bottom: 1px solid #397d94; } DIV.clickableHourCell -{ width: 100%; +{ cursor: pointer; + width: 100%; height: 4em; } DIV.clickableHourCell0 { top: 0px; } DIV.clickableHourCell1, -DIV.daysView > DIV.hourLines > DIV.hourLine0 +DIV#daysView > DIV.hourLines > DIV.hourLine0 { top: 4em; } DIV.clickableHourCell2, -DIV.daysView > DIV.hourLines > DIV.hourLine1 +DIV#daysView > DIV.hourLines > DIV.hourLine1 { top: 8em; } DIV.clickableHourCell3, -DIV.daysView > DIV.hourLines > DIV.hourLine2 +DIV#daysView > DIV.hourLines > DIV.hourLine2 { top: 12em; } -DIV.clickableHourCell3, -DIV.daysView > DIV.hourLines > DIV.hourLine3 +DIV.clickableHourCell4, +DIV#daysView > DIV.hourLines > DIV.hourLine3 { top: 16em; } DIV.clickableHourCell5, -DIV.daysView > DIV.hourLines > DIV.hourLine4 +DIV#daysView > DIV.hourLines > DIV.hourLine4 { top: 20em; } -DIV.clickableHourCell4, -DIV.daysView > DIV.hourLines > DIV.hourLine5 +DIV.clickableHourCell6, +DIV#daysView > DIV.hourLines > DIV.hourLine5 { top: 24em; } -DIV.clickableHourCell5, -DIV.daysView > DIV.hourLines > DIV.hourLine6 +DIV.clickableHourCell7, +DIV#daysView > DIV.hourLines > DIV.hourLine6 { top: 28em; } -DIV.clickableHourCell6, -DIV.daysView > DIV.hourLines > DIV.hourLine7 +DIV.clickableHourCell8, +DIV#daysView > DIV.hourLines > DIV.hourLine7 { top: 32em; } -DIV.clickableHourCell7, -DIV.daysView > DIV.hourLines > DIV.hourLine8 +DIV.clickableHourCell9, +DIV#daysView > DIV.hourLines > DIV.hourLine8 { top: 36em; } -DIV.clickableHourCell8, -DIV.daysView > DIV.hourLines > DIV.hourLine9 +DIV.clickableHourCell10, +DIV#daysView > DIV.hourLines > DIV.hourLine9 { top: 40em; } -DIV.clickableHourCell9, -DIV.daysView > DIV.hourLines > DIV.hourLine10 +DIV.clickableHourCell11, +DIV#daysView > DIV.hourLines > DIV.hourLine10 { top: 44em; } -DIV.clickableHourCell10, -DIV.daysView > DIV.hourLines > DIV.hourLine11 +DIV.clickableHourCell12, +DIV#daysView > DIV.hourLines > DIV.hourLine11 { top: 48em; } -DIV.clickableHourCell11, -DIV.daysView > DIV.hourLines > DIV.hourLine12 +DIV.clickableHourCell13, +DIV#daysView > DIV.hourLines > DIV.hourLine12 { top: 52em; } -DIV.clickableHourCell12, -DIV.daysView > DIV.hourLines > DIV.hourLine13 +DIV.clickableHourCell14, +DIV#daysView > DIV.hourLines > DIV.hourLine13 { top: 56em; } -DIV.clickableHourCell13, -DIV.daysView > DIV.hourLines > DIV.hourLine14 +DIV.clickableHourCell15, +DIV#daysView > DIV.hourLines > DIV.hourLine14 { top: 60em; } -DIV.clickableHourCell14, -DIV.daysView > DIV.hourLines > DIV.hourLine15 +DIV.clickableHourCell16, +DIV#daysView > DIV.hourLines > DIV.hourLine15 { top: 64em; } -DIV.clickableHourCell15, -DIV.daysView > DIV.hourLines > DIV.hourLine16 +DIV.clickableHourCell17, +DIV#daysView > DIV.hourLines > DIV.hourLine16 { top: 68em; } -DIV.clickableHourCell16, -DIV.daysView > DIV.hourLines > DIV.hourLine17 +DIV.clickableHourCell18, +DIV#daysView > DIV.hourLines > DIV.hourLine17 { top: 72em; } -DIV.clickableHourCell17, -DIV.daysView > DIV.hourLines > DIV.hourLine18 +DIV.clickableHourCell19, +DIV#daysView > DIV.hourLines > DIV.hourLine18 { top: 76em; } -DIV.clickableHourCell18, -DIV.daysView > DIV.hourLines > DIV.hourLine19 +DIV.clickableHourCell20, +DIV#daysView > DIV.hourLines > DIV.hourLine19 { top: 80em; } -DIV.clickableHourCell19, -DIV.daysView > DIV.hourLines > DIV.hourLine20 +DIV.clickableHourCell21, +DIV#daysView > DIV.hourLines > DIV.hourLine20 { top: 84em; } -DIV.clickableHourCell20, -DIV.daysView > DIV.hourLines > DIV.hourLine21 +DIV.clickableHourCell22, +DIV#daysView > DIV.hourLines > DIV.hourLine21 { top: 88em; } -DIV.clickableHourCell21, -DIV.daysView > DIV.hourLines > DIV.hourLine22 +DIV.clickableHourCell23, +DIV#daysView > DIV.hourLines > DIV.hourLine22 { top: 92em; } -DIV.clickableHourCell22, -DIV.daysView > DIV.hourLines > DIV.hourLine23 +DIV#daysView > DIV.hourLines > DIV.hourLine23 { top: 96em; } -DIV.daysView DIV.appointments +DIV#daysView DIV.events { position: absolute; z-index: 2; - border-top: 1px solid #397d94; + border: 0px; left: 0px; right: 0px; bottom: 0px; - top: 4em; } + top: 0px; } -DIV.appointments > DIV.appointment +DIV.events > DIV.event { cursor: default; position: absolute; left: 0px; right: 1px; padding: 1px; } -DIV[class~="appointment"]._selected > DIV.appointmentInside +DIV[class~="event"]._selected > DIV.eventInside { -moz-opacity: 0.7; opacity: 0.7; filter: alpha(opacity=70); } -DIV.appointment > DIV.appointmentInside +DIV.event > DIV.eventInside { position: absolute; overflow: hidden; top: 1px; @@ -846,7 +876,7 @@ DIV.shadow4 right: 3px; top: 3px; bottom: 4px; - moz-opacity: 0.4; + -moz-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=40); } @@ -862,7 +892,7 @@ DIV.gradient > IMG { height: 100%; width: 100%; } -DIV.monthView DIV.appointment +DIV.monthView DIV.event { position: relative; cursor: default; white-space: nowrap; @@ -871,587 +901,587 @@ DIV.monthView DIV.appointment padding: 1px; height: 2em; } -DIV.appointment DIV.text +DIV.event DIV.text { font-size: 92%; } -DIV.daysView DIV[class~="appointment"].starts0 +DIV#daysView DIV[class~="event"].starts0 { top: 0.000000%; } -DIV.daysView DIV[class~="appointment"].starts1 +DIV#daysView DIV[class~="event"].starts1 { top: 1.041667%; } -DIV.daysView DIV[class~="appointment"].starts2 +DIV#daysView DIV[class~="event"].starts2 { top: 2.083333%; } -DIV.daysView DIV[class~="appointment"].starts3 +DIV#daysView DIV[class~="event"].starts3 { top: 3.125000%; } -DIV.daysView DIV[class~="appointment"].starts4 +DIV#daysView DIV[class~="event"].starts4 { top: 4.166667%; } -DIV.daysView DIV[class~="appointment"].starts5 +DIV#daysView DIV[class~="event"].starts5 { top: 5.208333%; } -DIV.daysView DIV[class~="appointment"].starts6 +DIV#daysView DIV[class~="event"].starts6 { top: 6.250000%; } -DIV.daysView DIV[class~="appointment"].starts7 +DIV#daysView DIV[class~="event"].starts7 { top: 7.291667%; } -DIV.daysView DIV[class~="appointment"].starts8 +DIV#daysView DIV[class~="event"].starts8 { top: 8.333333%; } -DIV.daysView DIV[class~="appointment"].starts9 +DIV#daysView DIV[class~="event"].starts9 { top: 9.375000%; } -DIV.daysView DIV[class~="appointment"].starts10 +DIV#daysView DIV[class~="event"].starts10 { top: 10.416667%; } -DIV.daysView DIV[class~="appointment"].starts11 +DIV#daysView DIV[class~="event"].starts11 { top: 11.458333%; } -DIV.daysView DIV[class~="appointment"].starts12 +DIV#daysView DIV[class~="event"].starts12 { top: 12.500000%; } -DIV.daysView DIV[class~="appointment"].starts13 +DIV#daysView DIV[class~="event"].starts13 { top: 13.541667%; } -DIV.daysView DIV[class~="appointment"].starts14 +DIV#daysView DIV[class~="event"].starts14 { top: 14.583333%; } -DIV.daysView DIV[class~="appointment"].starts15 +DIV#daysView DIV[class~="event"].starts15 { top: 15.625000%; } -DIV.daysView DIV[class~="appointment"].starts16 +DIV#daysView DIV[class~="event"].starts16 { top: 16.666667%; } -DIV.daysView DIV[class~="appointment"].starts17 +DIV#daysView DIV[class~="event"].starts17 { top: 17.708333%; } -DIV.daysView DIV[class~="appointment"].starts18 +DIV#daysView DIV[class~="event"].starts18 { top: 18.750000%; } -DIV.daysView DIV[class~="appointment"].starts19 +DIV#daysView DIV[class~="event"].starts19 { top: 19.791667%; } -DIV.daysView DIV[class~="appointment"].starts20 +DIV#daysView DIV[class~="event"].starts20 { top: 20.833333%; } -DIV.daysView DIV[class~="appointment"].starts21 +DIV#daysView DIV[class~="event"].starts21 { top: 21.875000%; } -DIV.daysView DIV[class~="appointment"].starts22 +DIV#daysView DIV[class~="event"].starts22 { top: 22.916667%; } -DIV.daysView DIV[class~="appointment"].starts23 +DIV#daysView DIV[class~="event"].starts23 { top: 23.958333%; } -DIV.daysView DIV[class~="appointment"].starts24 +DIV#daysView DIV[class~="event"].starts24 { top: 25.000000%; } -DIV.daysView DIV[class~="appointment"].starts25 +DIV#daysView DIV[class~="event"].starts25 { top: 26.041667%; } -DIV.daysView DIV[class~="appointment"].starts26 +DIV#daysView DIV[class~="event"].starts26 { top: 27.083333%; } -DIV.daysView DIV[class~="appointment"].starts27 +DIV#daysView DIV[class~="event"].starts27 { top: 28.125000%; } -DIV.daysView DIV[class~="appointment"].starts28 +DIV#daysView DIV[class~="event"].starts28 { top: 29.166667%; } -DIV.daysView DIV[class~="appointment"].starts29 +DIV#daysView DIV[class~="event"].starts29 { top: 30.208333%; } -DIV.daysView DIV[class~="appointment"].starts30 +DIV#daysView DIV[class~="event"].starts30 { top: 31.250000%; } -DIV.daysView DIV[class~="appointment"].starts31 +DIV#daysView DIV[class~="event"].starts31 { top: 32.291667%; } -DIV.daysView DIV[class~="appointment"].starts32 +DIV#daysView DIV[class~="event"].starts32 { top: 33.333333%; } -DIV.daysView DIV[class~="appointment"].starts33 +DIV#daysView DIV[class~="event"].starts33 { top: 34.375000%; } -DIV.daysView DIV[class~="appointment"].starts34 +DIV#daysView DIV[class~="event"].starts34 { top: 35.416667%; } -DIV.daysView DIV[class~="appointment"].starts35 +DIV#daysView DIV[class~="event"].starts35 { top: 36.458333%; } -DIV.daysView DIV[class~="appointment"].starts36 +DIV#daysView DIV[class~="event"].starts36 { top: 37.500000%; } -DIV.daysView DIV[class~="appointment"].starts37 +DIV#daysView DIV[class~="event"].starts37 { top: 38.541667%; } -DIV.daysView DIV[class~="appointment"].starts38 +DIV#daysView DIV[class~="event"].starts38 { top: 39.583333%; } -DIV.daysView DIV[class~="appointment"].starts39 +DIV#daysView DIV[class~="event"].starts39 { top: 40.625000%; } -DIV.daysView DIV[class~="appointment"].starts40 +DIV#daysView DIV[class~="event"].starts40 { top: 41.666667%; } -DIV.daysView DIV[class~="appointment"].starts41 +DIV#daysView DIV[class~="event"].starts41 { top: 42.708333%; } -DIV.daysView DIV[class~="appointment"].starts42 +DIV#daysView DIV[class~="event"].starts42 { top: 43.750000%; } -DIV.daysView DIV[class~="appointment"].starts43 +DIV#daysView DIV[class~="event"].starts43 { top: 44.791667%; } -DIV.daysView DIV[class~="appointment"].starts44 +DIV#daysView DIV[class~="event"].starts44 { top: 45.833333%; } -DIV.daysView DIV[class~="appointment"].starts45 +DIV#daysView DIV[class~="event"].starts45 { top: 46.875000%; } -DIV.daysView DIV[class~="appointment"].starts46 +DIV#daysView DIV[class~="event"].starts46 { top: 47.916667%; } -DIV.daysView DIV[class~="appointment"].starts47 +DIV#daysView DIV[class~="event"].starts47 { top: 48.958333%; } -DIV.daysView DIV[class~="appointment"].starts48 +DIV#daysView DIV[class~="event"].starts48 { top: 50.000000%; } -DIV.daysView DIV[class~="appointment"].starts49 +DIV#daysView DIV[class~="event"].starts49 { top: 51.041667%; } -DIV.daysView DIV[class~="appointment"].starts50 +DIV#daysView DIV[class~="event"].starts50 { top: 52.083333%; } -DIV.daysView DIV[class~="appointment"].starts51 +DIV#daysView DIV[class~="event"].starts51 { top: 53.125000%; } -DIV.daysView DIV[class~="appointment"].starts52 +DIV#daysView DIV[class~="event"].starts52 { top: 54.166667%; } -DIV.daysView DIV[class~="appointment"].starts53 +DIV#daysView DIV[class~="event"].starts53 { top: 55.208333%; } -DIV.daysView DIV[class~="appointment"].starts54 +DIV#daysView DIV[class~="event"].starts54 { top: 56.250000%; } -DIV.daysView DIV[class~="appointment"].starts55 +DIV#daysView DIV[class~="event"].starts55 { top: 57.291667%; } -DIV.daysView DIV[class~="appointment"].starts56 +DIV#daysView DIV[class~="event"].starts56 { top: 58.333333%; } -DIV.daysView DIV[class~="appointment"].starts57 +DIV#daysView DIV[class~="event"].starts57 { top: 59.375000%; } -DIV.daysView DIV[class~="appointment"].starts58 +DIV#daysView DIV[class~="event"].starts58 { top: 60.416667%; } -DIV.daysView DIV[class~="appointment"].starts59 +DIV#daysView DIV[class~="event"].starts59 { top: 61.458333%; } -DIV.daysView DIV[class~="appointment"].starts60 +DIV#daysView DIV[class~="event"].starts60 { top: 62.500000%; } -DIV.daysView DIV[class~="appointment"].starts61 +DIV#daysView DIV[class~="event"].starts61 { top: 63.541667%; } -DIV.daysView DIV[class~="appointment"].starts62 +DIV#daysView DIV[class~="event"].starts62 { top: 64.583333%; } -DIV.daysView DIV[class~="appointment"].starts63 +DIV#daysView DIV[class~="event"].starts63 { top: 65.625000%; } -DIV.daysView DIV[class~="appointment"].starts64 +DIV#daysView DIV[class~="event"].starts64 { top: 66.666667%; } -DIV.daysView DIV[class~="appointment"].starts65 +DIV#daysView DIV[class~="event"].starts65 { top: 67.708333%; } -DIV.daysView DIV[class~="appointment"].starts66 +DIV#daysView DIV[class~="event"].starts66 { top: 68.750000%; } -DIV.daysView DIV[class~="appointment"].starts67 +DIV#daysView DIV[class~="event"].starts67 { top: 69.791667%; } -DIV.daysView DIV[class~="appointment"].starts68 +DIV#daysView DIV[class~="event"].starts68 { top: 70.833333%; } -DIV.daysView DIV[class~="appointment"].starts69 +DIV#daysView DIV[class~="event"].starts69 { top: 71.875000%; } -DIV.daysView DIV[class~="appointment"].starts70 +DIV#daysView DIV[class~="event"].starts70 { top: 72.916667%; } -DIV.daysView DIV[class~="appointment"].starts71 +DIV#daysView DIV[class~="event"].starts71 { top: 73.958333%; } -DIV.daysView DIV[class~="appointment"].starts72 +DIV#daysView DIV[class~="event"].starts72 { top: 75.000000%; } -DIV.daysView DIV[class~="appointment"].starts73 +DIV#daysView DIV[class~="event"].starts73 { top: 76.041667%; } -DIV.daysView DIV[class~="appointment"].starts74 +DIV#daysView DIV[class~="event"].starts74 { top: 77.083333%; } -DIV.daysView DIV[class~="appointment"].starts75 +DIV#daysView DIV[class~="event"].starts75 { top: 78.125000%; } -DIV.daysView DIV[class~="appointment"].starts76 +DIV#daysView DIV[class~="event"].starts76 { top: 79.166667%; } -DIV.daysView DIV[class~="appointment"].starts77 +DIV#daysView DIV[class~="event"].starts77 { top: 80.208333%; } -DIV.daysView DIV[class~="appointment"].starts78 +DIV#daysView DIV[class~="event"].starts78 { top: 81.250000%; } -DIV.daysView DIV[class~="appointment"].starts79 +DIV#daysView DIV[class~="event"].starts79 { top: 82.291667%; } -DIV.daysView DIV[class~="appointment"].starts80 +DIV#daysView DIV[class~="event"].starts80 { top: 83.333333%; } -DIV.daysView DIV[class~="appointment"].starts81 +DIV#daysView DIV[class~="event"].starts81 { top: 84.375000%; } -DIV.daysView DIV[class~="appointment"].starts82 +DIV#daysView DIV[class~="event"].starts82 { top: 85.416667%; } -DIV.daysView DIV[class~="appointment"].starts83 +DIV#daysView DIV[class~="event"].starts83 { top: 86.458333%; } -DIV.daysView DIV[class~="appointment"].starts84 +DIV#daysView DIV[class~="event"].starts84 { top: 87.500000%; } -DIV.daysView DIV[class~="appointment"].starts85 +DIV#daysView DIV[class~="event"].starts85 { top: 88.541667%; } -DIV.daysView DIV[class~="appointment"].starts86 +DIV#daysView DIV[class~="event"].starts86 { top: 89.583333%; } -DIV.daysView DIV[class~="appointment"].starts87 +DIV#daysView DIV[class~="event"].starts87 { top: 90.625000%; } -DIV.daysView DIV[class~="appointment"].starts88 +DIV#daysView DIV[class~="event"].starts88 { top: 91.666667%; } -DIV.daysView DIV[class~="appointment"].starts89 +DIV#daysView DIV[class~="event"].starts89 { top: 92.708333%; } -DIV.daysView DIV[class~="appointment"].starts90 +DIV#daysView DIV[class~="event"].starts90 { top: 93.750000%; } -DIV.daysView DIV[class~="appointment"].starts91 +DIV#daysView DIV[class~="event"].starts91 { top: 94.791667%; } -DIV.daysView DIV[class~="appointment"].starts92 +DIV#daysView DIV[class~="event"].starts92 { top: 95.833333%; } -DIV.daysView DIV[class~="appointment"].starts93 +DIV#daysView DIV[class~="event"].starts93 { top: 96.875000%; } -DIV.daysView DIV[class~="appointment"].starts94 +DIV#daysView DIV[class~="event"].starts94 { top: 97.916667%; } -DIV.daysView DIV[class~="appointment"].starts95 +DIV#daysView DIV[class~="event"].starts95 { top: 98.958333%; } -DIV.daysView DIV[class~="appointment"].starts96 +DIV#daysView DIV[class~="event"].starts96 { top: 100.000000%; } -DIV.daysView DIV[class~="appointment"].lasts0 +DIV#daysView DIV[class~="event"].lasts0 { height: 0px; } -DIV.daysView DIV[class~="appointment"].lasts1 +DIV#daysView DIV[class~="event"].lasts1 { height: 1.041667%; } -DIV.daysView DIV[class~="appointment"].lasts2 +DIV#daysView DIV[class~="event"].lasts2 { height: 2.083333%; } -DIV.daysView DIV[class~="appointment"].lasts3 +DIV#daysView DIV[class~="event"].lasts3 { height: 3.125000%; } -DIV.daysView DIV[class~="appointment"].lasts4 +DIV#daysView DIV[class~="event"].lasts4 { height: 4.166667%; } -DIV.daysView DIV[class~="appointment"].lasts5 +DIV#daysView DIV[class~="event"].lasts5 { height: 5.208333%; } -DIV.daysView DIV[class~="appointment"].lasts6 +DIV#daysView DIV[class~="event"].lasts6 { height: 6.250000%; } -DIV.daysView DIV[class~="appointment"].lasts7 +DIV#daysView DIV[class~="event"].lasts7 { height: 7.291667%; } -DIV.daysView DIV[class~="appointment"].lasts8 +DIV#daysView DIV[class~="event"].lasts8 { height: 8.333333%; } -DIV.daysView DIV[class~="appointment"].lasts9 +DIV#daysView DIV[class~="event"].lasts9 { height: 9.375000%; } -DIV.daysView DIV[class~="appointment"].lasts10 +DIV#daysView DIV[class~="event"].lasts10 { height: 10.416667%; } -DIV.daysView DIV[class~="appointment"].lasts11 +DIV#daysView DIV[class~="event"].lasts11 { height: 11.458333%; } -DIV.daysView DIV[class~="appointment"].lasts12 +DIV#daysView DIV[class~="event"].lasts12 { height: 12.500000%; } -DIV.daysView DIV[class~="appointment"].lasts13 +DIV#daysView DIV[class~="event"].lasts13 { height: 13.541667%; } -DIV.daysView DIV[class~="appointment"].lasts14 +DIV#daysView DIV[class~="event"].lasts14 { height: 14.583333%; } -DIV.daysView DIV[class~="appointment"].lasts15 +DIV#daysView DIV[class~="event"].lasts15 { height: 15.625000%; } -DIV.daysView DIV[class~="appointment"].lasts16 +DIV#daysView DIV[class~="event"].lasts16 { height: 16.666667%; } -DIV.daysView DIV[class~="appointment"].lasts17 +DIV#daysView DIV[class~="event"].lasts17 { height: 17.708333%; } -DIV.daysView DIV[class~="appointment"].lasts18 +DIV#daysView DIV[class~="event"].lasts18 { height: 18.750000%; } -DIV.daysView DIV[class~="appointment"].lasts19 +DIV#daysView DIV[class~="event"].lasts19 { height: 19.791667%; } -DIV.daysView DIV[class~="appointment"].lasts20 +DIV#daysView DIV[class~="event"].lasts20 { height: 20.833333%; } -DIV.daysView DIV[class~="appointment"].lasts21 +DIV#daysView DIV[class~="event"].lasts21 { height: 21.875000%; } -DIV.daysView DIV[class~="appointment"].lasts22 +DIV#daysView DIV[class~="event"].lasts22 { height: 22.916667%; } -DIV.daysView DIV[class~="appointment"].lasts23 +DIV#daysView DIV[class~="event"].lasts23 { height: 23.958333%; } -DIV.daysView DIV[class~="appointment"].lasts24 +DIV#daysView DIV[class~="event"].lasts24 { height: 25.000000%; } -DIV.daysView DIV[class~="appointment"].lasts25 +DIV#daysView DIV[class~="event"].lasts25 { height: 26.041667%; } -DIV.daysView DIV[class~="appointment"].lasts26 +DIV#daysView DIV[class~="event"].lasts26 { height: 27.083333%; } -DIV.daysView DIV[class~="appointment"].lasts27 +DIV#daysView DIV[class~="event"].lasts27 { height: 28.125000%; } -DIV.daysView DIV[class~="appointment"].lasts28 +DIV#daysView DIV[class~="event"].lasts28 { height: 29.166667%; } -DIV.daysView DIV[class~="appointment"].lasts29 +DIV#daysView DIV[class~="event"].lasts29 { height: 30.208333%; } -DIV.daysView DIV[class~="appointment"].lasts30 +DIV#daysView DIV[class~="event"].lasts30 { height: 31.250000%; } -DIV.daysView DIV[class~="appointment"].lasts31 +DIV#daysView DIV[class~="event"].lasts31 { height: 32.291667%; } -DIV.daysView DIV[class~="appointment"].lasts32 +DIV#daysView DIV[class~="event"].lasts32 { height: 33.333333%; } -DIV.daysView DIV[class~="appointment"].lasts33 +DIV#daysView DIV[class~="event"].lasts33 { height: 34.375000%; } -DIV.daysView DIV[class~="appointment"].lasts34 +DIV#daysView DIV[class~="event"].lasts34 { height: 35.416667%; } -DIV.daysView DIV[class~="appointment"].lasts35 +DIV#daysView DIV[class~="event"].lasts35 { height: 36.458333%; } -DIV.daysView DIV[class~="appointment"].lasts36 +DIV#daysView DIV[class~="event"].lasts36 { height: 37.500000%; } -DIV.daysView DIV[class~="appointment"].lasts37 +DIV#daysView DIV[class~="event"].lasts37 { height: 38.541667%; } -DIV.daysView DIV[class~="appointment"].lasts38 +DIV#daysView DIV[class~="event"].lasts38 { height: 39.583333%; } -DIV.daysView DIV[class~="appointment"].lasts39 +DIV#daysView DIV[class~="event"].lasts39 { height: 40.625000%; } -DIV.daysView DIV[class~="appointment"].lasts40 +DIV#daysView DIV[class~="event"].lasts40 { height: 41.666667%; } -DIV.daysView DIV[class~="appointment"].lasts41 +DIV#daysView DIV[class~="event"].lasts41 { height: 42.708333%; } -DIV.daysView DIV[class~="appointment"].lasts42 +DIV#daysView DIV[class~="event"].lasts42 { height: 43.750000%; } -DIV.daysView DIV[class~="appointment"].lasts43 +DIV#daysView DIV[class~="event"].lasts43 { height: 44.791667%; } -DIV.daysView DIV[class~="appointment"].lasts44 +DIV#daysView DIV[class~="event"].lasts44 { height: 45.833333%; } -DIV.daysView DIV[class~="appointment"].lasts45 +DIV#daysView DIV[class~="event"].lasts45 { height: 46.875000%; } -DIV.daysView DIV[class~="appointment"].lasts46 +DIV#daysView DIV[class~="event"].lasts46 { height: 47.916667%; } -DIV.daysView DIV[class~="appointment"].lasts47 +DIV#daysView DIV[class~="event"].lasts47 { height: 48.958333%; } -DIV.daysView DIV[class~="appointment"].lasts48 +DIV#daysView DIV[class~="event"].lasts48 { height: 50.000000%; } -DIV.daysView DIV[class~="appointment"].lasts49 +DIV#daysView DIV[class~="event"].lasts49 { height: 51.041667%; } -DIV.daysView DIV[class~="appointment"].lasts50 +DIV#daysView DIV[class~="event"].lasts50 { height: 52.083333%; } -DIV.daysView DIV[class~="appointment"].lasts51 +DIV#daysView DIV[class~="event"].lasts51 { height: 53.125000%; } -DIV.daysView DIV[class~="appointment"].lasts52 +DIV#daysView DIV[class~="event"].lasts52 { height: 54.166667%; } -DIV.daysView DIV[class~="appointment"].lasts53 +DIV#daysView DIV[class~="event"].lasts53 { height: 55.208333%; } -DIV.daysView DIV[class~="appointment"].lasts54 +DIV#daysView DIV[class~="event"].lasts54 { height: 56.250000%; } -DIV.daysView DIV[class~="appointment"].lasts55 +DIV#daysView DIV[class~="event"].lasts55 { height: 57.291667%; } -DIV.daysView DIV[class~="appointment"].lasts56 +DIV#daysView DIV[class~="event"].lasts56 { height: 58.333333%; } -DIV.daysView DIV[class~="appointment"].lasts57 +DIV#daysView DIV[class~="event"].lasts57 { height: 59.375000%; } -DIV.daysView DIV[class~="appointment"].lasts58 +DIV#daysView DIV[class~="event"].lasts58 { height: 60.416667%; } -DIV.daysView DIV[class~="appointment"].lasts59 +DIV#daysView DIV[class~="event"].lasts59 { height: 61.458333%; } -DIV.daysView DIV[class~="appointment"].lasts60 +DIV#daysView DIV[class~="event"].lasts60 { height: 62.500000%; } -DIV.daysView DIV[class~="appointment"].lasts61 +DIV#daysView DIV[class~="event"].lasts61 { height: 63.541667%; } -DIV.daysView DIV[class~="appointment"].lasts62 +DIV#daysView DIV[class~="event"].lasts62 { height: 64.583333%; } -DIV.daysView DIV[class~="appointment"].lasts63 +DIV#daysView DIV[class~="event"].lasts63 { height: 65.625000%; } -DIV.daysView DIV[class~="appointment"].lasts64 +DIV#daysView DIV[class~="event"].lasts64 { height: 66.666667%; } -DIV.daysView DIV[class~="appointment"].lasts65 +DIV#daysView DIV[class~="event"].lasts65 { height: 67.708333%; } -DIV.daysView DIV[class~="appointment"].lasts66 +DIV#daysView DIV[class~="event"].lasts66 { height: 68.750000%; } -DIV.daysView DIV[class~="appointment"].lasts67 +DIV#daysView DIV[class~="event"].lasts67 { height: 69.791667%; } -DIV.daysView DIV[class~="appointment"].lasts68 +DIV#daysView DIV[class~="event"].lasts68 { height: 70.833333%; } -DIV.daysView DIV[class~="appointment"].lasts69 +DIV#daysView DIV[class~="event"].lasts69 { height: 71.875000%; } -DIV.daysView DIV[class~="appointment"].lasts70 +DIV#daysView DIV[class~="event"].lasts70 { height: 72.916667%; } -DIV.daysView DIV[class~="appointment"].lasts71 +DIV#daysView DIV[class~="event"].lasts71 { height: 73.958333%; } -DIV.daysView DIV[class~="appointment"].lasts72 +DIV#daysView DIV[class~="event"].lasts72 { height: 75.000000%; } -DIV.daysView DIV[class~="appointment"].lasts73 +DIV#daysView DIV[class~="event"].lasts73 { height: 76.041667%; } -DIV.daysView DIV[class~="appointment"].lasts74 +DIV#daysView DIV[class~="event"].lasts74 { height: 77.083333%; } -DIV.daysView DIV[class~="appointment"].lasts75 +DIV#daysView DIV[class~="event"].lasts75 { height: 78.125000%; } -DIV.daysView DIV[class~="appointment"].lasts76 +DIV#daysView DIV[class~="event"].lasts76 { height: 79.166667%; } -DIV.daysView DIV[class~="appointment"].lasts77 +DIV#daysView DIV[class~="event"].lasts77 { height: 80.208333%; } -DIV.daysView DIV[class~="appointment"].lasts78 +DIV#daysView DIV[class~="event"].lasts78 { height: 81.250000%; } -DIV.daysView DIV[class~="appointment"].lasts79 +DIV#daysView DIV[class~="event"].lasts79 { height: 82.291667%; } -DIV.daysView DIV[class~="appointment"].lasts80 +DIV#daysView DIV[class~="event"].lasts80 { height: 83.333333%; } -DIV.daysView DIV[class~="appointment"].lasts81 +DIV#daysView DIV[class~="event"].lasts81 { height: 84.375000%; } -DIV.daysView DIV[class~="appointment"].lasts82 +DIV#daysView DIV[class~="event"].lasts82 { height: 85.416667%; } -DIV.daysView DIV[class~="appointment"].lasts83 +DIV#daysView DIV[class~="event"].lasts83 { height: 86.458333%; } -DIV.daysView DIV[class~="appointment"].lasts84 +DIV#daysView DIV[class~="event"].lasts84 { height: 87.500000%; } -DIV.daysView DIV[class~="appointment"].lasts85 +DIV#daysView DIV[class~="event"].lasts85 { height: 88.541667%; } -DIV.daysView DIV[class~="appointment"].lasts86 +DIV#daysView DIV[class~="event"].lasts86 { height: 89.583333%; } -DIV.daysView DIV[class~="appointment"].lasts87 +DIV#daysView DIV[class~="event"].lasts87 { height: 90.625000%; } -DIV.daysView DIV[class~="appointment"].lasts88 +DIV#daysView DIV[class~="event"].lasts88 { height: 91.666667%; } -DIV.daysView DIV[class~="appointment"].lasts89 +DIV#daysView DIV[class~="event"].lasts89 { height: 92.708333%; } -DIV.daysView DIV[class~="appointment"].lasts90 +DIV#daysView DIV[class~="event"].lasts90 { height: 93.750000%; } -DIV.daysView DIV[class~="appointment"].lasts91 +DIV#daysView DIV[class~="event"].lasts91 { height: 94.791667%; } -DIV.daysView DIV[class~="appointment"].lasts92 +DIV#daysView DIV[class~="event"].lasts92 { height: 95.833333%; } -DIV.daysView DIV[class~="appointment"].lasts93 +DIV#daysView DIV[class~="event"].lasts93 { height: 96.875000%; } -DIV.daysView DIV[class~="appointment"].lasts94 +DIV#daysView DIV[class~="event"].lasts94 { height: 97.916667%; } -DIV.daysView DIV[class~="appointment"].lasts95 +DIV#daysView DIV[class~="event"].lasts95 { height: 98.958333%; } -DIV.daysView DIV[class~="appointment"].lasts96 +DIV#daysView DIV[class~="event"].lasts96 { height: 100.000000%; } diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 914563e19..cce8d7215 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -23,7 +23,7 @@ var usersRightsWindowHeight = 250; var usersRightsWindowWidth = 502; function newEvent(sender, type) { - var day = sender.getAttribute("day"); + var day = sender.day; if (!day) day = currentDay; @@ -32,7 +32,9 @@ function newEvent(sender, type) { && currentView == "multicolumndayview" && type == "event") user = sender.parentNode.parentNode.getAttribute("user"); - var hour = sender.getAttribute("hour"); + var hour = sender.hour; + if (!hour) + hour = sender.getAttribute("hour"); var urlstr = UserFolderURL + "../" + user + "/Calendar/new" + type; var params = new Array(); if (day) @@ -182,7 +184,7 @@ function modifyEventCallback(http) { } } else { - log("showing alert..."); +// log("showing alert..."); window.alert(labels["eventPartStatModificationError"]); } document.modifyEventAjaxRequest = null; @@ -211,11 +213,11 @@ function deleteEventCallback(http) { log ("deleteEventCallback Ajax error"); } -function editDoubleClickedEvent() { - _editEventId(this.getAttribute("id"), - this.owner); - - return false; +function editDoubleClickedEvent(event) { + _editEventId(this.cname, this.owner); + + event.preventDefault(); + event.cancelBubble = true; } function onSelectAll() { @@ -225,18 +227,8 @@ function onSelectAll() { return false; } -function displayEvent(event) { - _editEventId(this.getAttribute("aptCName"), - this.owner); - - preventDefault(event); - event.stopPropagation(); - event.cancelBubble = true; - event.returnValue = false; -} - function onDaySelect(node) { - var day = node.getAttribute("day"); + var day = node.day; var needRefresh = (listFilter == 'view_selectedday' && day != currentDay); @@ -303,10 +295,10 @@ function dateSelectorCallback(http) { } function eventsListCallback(http) { - var div = $("eventsListView"); - if (http.readyState == 4 && http.status == 200) { + var div = $("eventsListView"); + document.eventsListAjaxRequest = null; var table = $("eventsList").tBodies[0]; var params = parseQueryParameters(http.callbackData); @@ -320,6 +312,7 @@ function eventsListCallback(http) { table.appendChild(row); $(row).addClassName("eventRow"); row.setAttribute("id", data[i][0]); + row.cname = data[i][0]; row.owner = data[i][1]; var startDate = new Date(); @@ -339,12 +332,12 @@ function eventsListCallback(http) { td = document.createElement("td"); row.appendChild(td); Event.observe(td, "mousedown", listRowMouseDownHandler, true); - td.appendChild(document.createTextNode(data[i][4])); + td.appendChild(document.createTextNode(data[i][8])); td = document.createElement("td"); row.appendChild(td); Event.observe(td, "mousedown", listRowMouseDownHandler, true); - td.appendChild(document.createTextNode(data[i][5])); + td.appendChild(document.createTextNode(data[i][9])); td = document.createElement("td"); row.appendChild(td); @@ -369,7 +362,7 @@ function tasksListCallback(http) { //log(i + " = " + data[i][3]); var listItem = document.createElement("li"); list.appendChild(listItem); - //Event.observe(listItem, "mousedown", listRowMouseDownHandler); // causes problem with Safari + Event.observe(listItem, "mousedown", listRowMouseDownHandler); // causes problem with Safari Event.observe(listItem, "click", onRowClick); Event.observe(listItem, "dblclick", editDoubleClickedEvent.bindAsEventListener(listItem)); listItem.setAttribute("id", data[i][0]); @@ -393,7 +386,7 @@ function tasksListCallback(http) { if (http.callbackData) { var selectedNodesId = http.callbackData; for (var i = 0; i < selectedNodesId.length; i++) { - log(selectedNodesId[i] + " (" + i + ") is selected"); +// log(selectedNodesId[i] + " (" + i + ") is selected"); $(selectedNodesId[i]).select(); } } @@ -410,14 +403,14 @@ function restoreCurrentDaySelection(div) { var i = 9; while (!day && i < elements.length) { - day = elements[i].getAttribute("day"); + day = elements[i].day; i++; } if (day && day.substr(0, 6) == currentDay.substr(0, 6)) { for (i = 0; i < elements.length; i++) { - day = elements[i].getAttribute("day"); + day = elements[i].day; if (day && day == currentDay) { var td = elements[i].getParentWithTagName("td"); if (document.selectedDate) @@ -483,11 +476,9 @@ function changeCalendarDisplay(time, newView) { document.dayDisplayAjaxRequest.aborted = true; document.dayDisplayAjaxRequest.abort(); } - document.dayDisplayAjaxRequest = triggerAjaxRequest(url, - calendarDisplayCallback, - { "view": newView, - "day": day, - "hour": hour }); + document.dayDisplayAjaxRequest + = triggerAjaxRequest(url, calendarDisplayCallback, + { "view": newView, "day": day, "hour": hour }); return false; } @@ -530,9 +521,10 @@ function scrollDayView(hour) { rowNumber = 8; var daysView = $("daysView"); - var hours = $(daysView.childNodesWithTag("div")[0]).childNodesWithTag("div"); + var hours = + $(daysView.childNodesWithTag("div"))[0].childNodesWithTag("div"); if (hours.length > 0) - daysView.parentNode.scrollTop = hours[rowNumber + 1].offsetTop; + daysView.scrollTop = hours[rowNumber].offsetTop; } function onClickableCellsDblClick(event) { @@ -542,6 +534,179 @@ function onClickableCellsDblClick(event) { event.returnValue = false; } +function refreshCalendarEvents() { + var sd = currentDay; + if (!sd) { + var todayDate = new Date(); + sd = todayDate.getDayString(); + } + var ed; + if (currentView == "dayview") + ed = sd; + else if (currentView == "weekview") { + var endDate = sd.asDate(); + endDate.addDays(6); + ed = endDate.getDayString(); + } + else { + var monthDate = sd.asDate(); + monthDate.setDate(1); + + var workDate = new Date(); + workDate.setTime(monthDate.getTime()); + var day = workDate.getDay(); + if (day > 0) + workDate.addDays(1 - day); + else + workDate.addDays(-6); + + sd = workDate.getDayString(); + + workDate.setTime(monthDate.getTime()); + workDate.setMonth(workDate.getMonth() + 1); + workDate.addDays(-1); + + var day = workDate.getDay(); + if (day > 0) + workDate.addDays(7 - day); + ed = workDate.getDayString(); + } + if (document.refreshCalendarEventsAjaxRequest) { + document.refreshCalendarEventsAjaxRequest.aborted = true; + document.refreshCalendarEventsAjaxRequest.abort(); + } + var url = ApplicationBaseURL + "eventslist?sd=" + sd + "&ed=" + ed; + document.refreshCalendarEventsAjaxRequest + = triggerAjaxRequest(url, refreshCalendarEventsCallback, + {"startDate": sd, "endDate": ed}); +} + +function refreshCalendarEventsCallback(http) { + if (http.readyState == 4 + && http.status == 200) { + var data = http.responseText.evalJSON(true); +// log("refresh calendar events: " + data.length); + for (var i = 0; i < data.length; i++) + drawCalendarEvent(data[i], + http.callbackData["startDate"], + http.callbackData["endDate"]); + } + else + log("AJAX error when refreshing calendar events"); +} + +function drawCalendarEvent(eventData, sd, ed) { + var viewStartDate = sd.asDate(); + var viewEndDate = ed.asDate(); + + var startDate = new Date(); + startDate.setTime(eventData[4] * 1000); + var endDate = new Date(); + endDate.setTime(eventData[5] * 1000); + + var days = startDate.daysUpTo(endDate); + + var divs = new Array(); + + var title = null; + var startHour = null; + var endHour = null; + for (var i = 0; i < days.length; i++) + if (days[i].earlierDate(viewStartDate) == viewStartDate + && days[i].laterDate(viewEndDate) == viewEndDate) { + var starts; + if (i == 0) { + var quarters = (startDate.getHours() * 4 + + Math.floor(startDate.getMinutes() / 15)); + starts = quarters; + title = eventData[3]; + startHour = startDate.getDisplayHoursString(); + endHour = endDate.getDisplayHoursString(); + } + else + starts = 0; + + var ends; + var lasts; + if (i == days.length - 1) { + var quarters = (endDate.getHours() * 4 + + Math.ceil(endDate.getMinutes() / 15)); + ends = quarters; + } + else + ends = 96; + lasts = ends - starts; + + var parentDiv; + if (currentView == "monthview") { + var eventDiv = newCalendarDIV(eventData[0], eventData[1], starts, lasts, + null, null, title); + + var dayString = days[i].getDayString(); + var dayDivs = $("monthDaysView").childNodesWithTag("div"); + var j = 0; + while (!parentDiv && j < dayDivs.length) { + if (dayDivs[j].getAttribute("day") == dayString) + parentDiv = dayDivs[j]; + else + j++; + } + parentDiv.appendChild(eventDiv); + } + else { + + } + } +} + +function newCalendarDIV(cname, owner, starts, lasts, + startHour, endHour, title) { + var eventDiv = document.createElement("div"); + eventDiv.cname = cname; + eventDiv.owner = owner; + eventDiv.addClassName("event"); + eventDiv.addClassName("starts" + starts); + eventDiv.addClassName("lasts" + lasts); + for (var i = 1; i < 5; i++) { + var shadowDiv = document.createElement("div"); + eventDiv.appendChild(shadowDiv); + shadowDiv.addClassName("shadow"); + shadowDiv.addClassName("shadow" + i); + } + var innerDiv = document.createElement("div"); + eventDiv.appendChild(innerDiv); + innerDiv.addClassName("eventInside"); + innerDiv.addClassName("ownerIs" + owner); + + var gradientDiv = document.createElement("div"); + innerDiv.appendChild(gradientDiv); + gradientDiv.addClassName("gradient"); + var gradientImg = document.createElement("img"); + gradientDiv.appendChild(gradientImg); + gradientImg.src = ResourcesURL + "/event-gradient.png"; + + var textDiv = document.createElement("div"); + innerDiv.appendChild(textDiv); + textDiv.addClassName("text"); + if (startHour) { + var headerSpan = document.createElement("span"); + textDiv.appendChild(headerSpan); + headerSpan.addClassName("eventHeader"); + headerSpan.appendChild(document.createTextNode(startHour + " - " + + endHour)); + textDiv.appendChild(document.createElement("br")); + } + textDiv.appendChild(document.createTextNode(title)); + + Event.observe(eventDiv, "mousedown", listRowMouseDownHandler); + Event.observe(eventDiv, "click", + onCalendarSelectEvent.bindAsEventListener(eventDiv)); + Event.observe(eventDiv, "dblclick", + editDoubleClickedEvent.bindAsEventListener(eventDiv)); + + return eventDiv; +} + function calendarDisplayCallback(http) { var div = $("calendarView"); @@ -563,26 +728,33 @@ function calendarDisplayCallback(http) { scrollDayView(hour); contentView = $("daysView"); } - var events = document.getElementsByClassName("event", contentView); - for (var i = 0; i < events.length; i++) { - Event.observe(events[i], "mousedown", listRowMouseDownHandler); - Event.observe(events[i], "click", onCalendarSelectEvent.bindAsEventListener(events[i])); - Event.observe(events[i], "dblclick", displayEvent.bindAsEventListener(events[i])); - } + refreshCalendarEvents(); var days = document.getElementsByClassName("day", contentView); if (currentView == "monthview") for (var i = 0; i < days.length; i++) { Event.observe(days[i], "click", onCalendarSelectDay.bindAsEventListener(days[i])); Event.observe(days[i], "dblclick", onClickableCellsDblClick.bindAsEventListener(days[i])); } - else - for (var i = 0; i < days.length; i++) { - Event.observe(days[i], "click", onCalendarSelectDay.bindAsEventListener(days[i])); - var clickableCells = document.getElementsByClassName("clickableHourCell", - days[i]); - for (var j = 0; j < clickableCells.length; j++) - Event.observe(clickableCells[j], "dblclick", onClickableCellsDblClick.bindAsEventListener(clickableCells[j])); - } + else { + var headerDivs = $("calendarHeader").childNodesWithTag("div"); + var headerDaysLabels = document.getElementsByClassName("day", headerDivs[0]); + var headerDays = document.getElementsByClassName("day", headerDivs[1]); + for (var i = 0; i < days.length; i++) { + headerDays[i].hour = "allday"; + Event.observe(headerDaysLabels[i], "mousedown", listRowMouseDownHandler); + Event.observe(headerDays[i], "click", + onCalendarSelectDay.bindAsEventListener(days[i])); + Event.observe(headerDays[i], "dblclick", + onClickableCellsDblClick.bindAsEventListener(headerDays[i])); + Event.observe(days[i], "click", + onCalendarSelectDay.bindAsEventListener(days[i])); + var clickableCells = document.getElementsByClassName("clickableHourCell", + days[i]); + for (var j = 0; j < clickableCells.length; j++) + Event.observe(clickableCells[j], "dblclick", + onClickableCellsDblClick.bindAsEventListener(clickableCells[j])); + } + } } else log ("calendarDisplayCallback Ajax error (" + http.readyState + "/" + http.status + ")"); @@ -730,8 +902,8 @@ function onListFilterChange() { function onEventClick(event) { var target = getTarget(event); var node = target.getParentWithTagName("tr"); - var day = node.getAttribute("day"); - var hour = node.getAttribute("hour"); + var day = node.day; + var hour = node.hour; changeCalendarDisplay( { "day": day, "hour": hour} ); changeDateSelectorDisplay(day); @@ -818,12 +990,11 @@ function onCalendarSelectEvent() { var list = $("eventsList"); list.deselectAll(); - var aptCName = this.getAttribute("aptCName"); if (selectedCalendarCell) selectedCalendarCell.deselect(); this.select(); selectedCalendarCell = this; - var row = $(aptCName); + var row = $(this.cname); if (row) { var div = row.parentNode.parentNode.parentNode; div.scrollTop = row.offsetTop - (div.offsetHeight / 2); @@ -834,7 +1005,7 @@ function onCalendarSelectEvent() { function onCalendarSelectDay(event) { var day; if (currentView == "multicolumndayview") - day = this.parentNode.getAttribute("day"); + day = this.getAttribute("day"); else day = this.getAttribute("day"); var needRefresh = (listFilter == 'view_selectedday' @@ -857,12 +1028,21 @@ function onCalendarSelectDay(event) { function changeWeekCalendarDisplayOfSelectedDay(node) { var days = document.getElementsByClassName("day", node.parentNode); + var headerDiv = $("calendarHeader").childNodesWithTag("div")[1]; + var headerDays = document.getElementsByClassName("day", headerDiv); +// log ("days: " + days.length + "; headerDays: " + headerDays.length); for (var i = 0; i < days.length; i++) - if (days[i] != node) - days[i].removeClassName("selectedDay"); - - node.addClassName("selectedDay"); + if (days[i] != node) { +// log("unselect day : " + i); + headerDays[i].removeClassName("selectedDay"); + days[i].removeClassName("selectedDay"); + } + else { +// log("selected day : " + i); + headerDays[i].addClassName("selectedDay"); + days[i].addClassName("selectedDay"); + } } function findMonthCalendarSelectedCell(daysContainer) { @@ -904,7 +1084,7 @@ function updateTaskStatus(event) { var newStatus = (this.checked ? 1 : 0); var http = createHTTPClient(); - log("update task status: " + taskId + " to " + this.checked); +// log("update task status: " + taskId + " to " + this.checked); event.cancelBubble = true; url = (UserFolderURL + "../" + taskOwner @@ -975,7 +1155,7 @@ function calendarStatusCallback(http) { http.status == 1223) { refreshEvents(); refreshTasks(); - changeCalendarDispla4y(); + changeCalendarDisplay(); } else { var folder = $(http.callbackData); diff --git a/UI/WebServerResources/UIxAppointmentEditor.js b/UI/WebServerResources/UIxAppointmentEditor.js index 9995a1ba7..91c58ecab 100644 --- a/UI/WebServerResources/UIxAppointmentEditor.js +++ b/UI/WebServerResources/UIxAppointmentEditor.js @@ -181,7 +181,7 @@ function endDayAsShortString() { return $('endTime_date').valueAsShortDateString(); } -this._getDate = function(which) { +function _getDate(which) { var date = window.timeWidgets[which]['date'].valueAsDate(); date.setHours( window.timeWidgets[which]['hour'].value ); date.setMinutes( window.timeWidgets[which]['minute'].value ); @@ -189,7 +189,7 @@ this._getDate = function(which) { return date; } -this._getShadowDate = function(which) { +function _getShadowDate(which) { var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate(); var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value")); date.setHours(intValue); @@ -200,23 +200,23 @@ this._getShadowDate = function(which) { return date; } -this.getStartDate = function() { +function getStartDate() { return this._getDate('start'); } -this.getEndDate = function() { +function getEndDate() { return this._getDate('end'); } -this.getShadowStartDate = function() { +function getShadowStartDate() { return this._getShadowDate('start'); } -this.getShadowEndDate = function() { +function getShadowEndDate() { return this._getShadowDate('end'); } -this._setDate = function(which, newDate) { +function _setDate(which, newDate) { window.timeWidgets[which]['date'].setValueAsDate(newDate); window.timeWidgets[which]['hour'].value = newDate.getHours(); var minutes = newDate.getMinutes(); @@ -225,16 +225,16 @@ this._setDate = function(which, newDate) { window.timeWidgets[which]['minute'].value = minutes; } -this.setStartDate = function(newStartDate) { +function setStartDate(newStartDate) { this._setDate('start', newStartDate); } -this.setEndDate = function(newEndDate) { +function setEndDate(newEndDate) { // window.alert(newEndDate); this._setDate('end', newEndDate); } -this.onAdjustEndTime = function(event) { +function onAdjustEndTime(event) { var dateDelta = (window.getStartDate().valueOf() - window.getShadowStartDate().valueOf()); // window.alert(window.getEndDate().valueOf() + ' ' + dateDelta); @@ -245,10 +245,39 @@ this.onAdjustEndTime = function(event) { window.timeWidgets['start']['minute'].updateShadowValue(); } -this.initTimeWidgets = function (widgets) { +function onAllDayChanged(event) { + for (var type in window.timeWidgets) { + window.timeWidgets[type]['hour'].disabled = this.checked; + window.timeWidgets[type]['minute'].disabled = this.checked; + } +} + +function initTimeWidgets(widgets) { this.timeWidgets = widgets; Event.observe(widgets['start']['date'], "change", this.onAdjustEndTime, false); Event.observe(widgets['start']['hour'], "change", this.onAdjustEndTime, false); Event.observe(widgets['start']['minute'], "change", this.onAdjustEndTime, false); + + var allDayLabel = $("allDay"); + var input = $(allDayLabel).childNodesWithTag("input")[0]; + Event.observe(input, "change", onAllDayChanged.bindAsEventListener(input)); + if (input.checked) { + for (var type in widgets) { + widgets[type]['hour'].disabled = true; + widgets[type]['minute'].disabled = true; + } + } } + +function onAppointmentEditorLoad() { + var widgets = {'start': {'date': $("startTime_date"), + 'hour': $("startTime_time_hour"), + 'minute': $("startTime_time_minute")}, + 'end': {'date': $("endTime_date"), + 'hour': $("endTime_time_hour"), + 'minute': $("endTime_time_minute")}}; + initTimeWidgets(widgets); +} + +addEvent(window, 'load', onAppointmentEditorLoad); diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index deeb9ab29..8e9eda5bd 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -56,10 +56,12 @@ LABEL TABLE { display: block; table-layout: fixed; - border-spacing: 0px; - padding: 0px; - margin: 0px; - border: 0px; } + border-spacing: 0px; } + +TABLE TD +{ white-space: nowrap; + padding-left: .25em; + padding-right: .25em; } a:link { color: #0033CC; } @@ -441,11 +443,15 @@ TR.tableview TD padding-left: .3em; padding-right: .3em; } -TR.tableview TD.headerDateTime -{ width: 18em; } +TD.headerDateTime +{ width: 30em; + min-width: 30em; } -TR.tableview TD.headerLocation -{ width: 10em; } +TD.headerTitle +{ width: 30%; } + +TD.headerLocation +{ min-width: 20em; } td img.tbtv_sortcell { float: right;