diff --git a/UI/Scheduler/UIxCalDayTable.h b/UI/Scheduler/UIxCalDayTable.h index 57d91e846..1e63c5574 100644 --- a/UI/Scheduler/UIxCalDayTable.h +++ b/UI/Scheduler/UIxCalDayTable.h @@ -39,7 +39,7 @@ NSArray *weekDays; NSString *currentView, *timeFormat, *currentTableHour; NSCalendarDate *startDate, *currentTableDay; - NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay; + NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay; unsigned int numberOfDays; } diff --git a/UI/Scheduler/UIxCalDayTable.m b/UI/Scheduler/UIxCalDayTable.m index a3c13fc2f..de1f9ab98 100644 --- a/UI/Scheduler/UIxCalDayTable.m +++ b/UI/Scheduler/UIxCalDayTable.m @@ -37,6 +37,9 @@ #import #import +#import +#import + #import "UIxCalDayTable.h" @class SOGoAppointment; @@ -292,6 +295,28 @@ return [weekDays objectAtIndex: [currentTableDay dayOfWeek]]; } +- (NSString *) labelForMonth +{ + NSCalendarDate *nextDay; + BOOL isLastOrFirstDay; + + isLastOrFirstDay = NO; + if ([currentTableDay dayOfMonth] == 1) + { + isLastOrFirstDay = YES; + } + else if ([currentTableDay dayOfMonth] > 27) + { + nextDay = [currentTableDay dateByAddingYears: 0 + months: 0 + days: 1]; + if ([nextDay dayOfMonth] == 1) + isLastOrFirstDay = YES; + } + + return isLastOrFirstDay? [currentTableDay descriptionWithCalendarFormat: @"%b" locale: locale] : nil; +} + - (NSString *) labelForDate { return [dateFormatter shortFormattedDate: currentTableDay]; @@ -410,6 +435,11 @@ return daysView; } +- (NSString *) daysViewHeaderClasses +{ + return [NSString stringWithFormat: @"%@ daysHeader", [self daysViewClasses]]; +} + - (NSString *) dayClasses { NSMutableString *classes; @@ -468,4 +498,9 @@ return NO; } +- (BOOL) isWeekView +{ + return [currentView isEqualToString:@"weekview"]; +} + @end diff --git a/UI/Templates/SchedulerUI/UIxCalDayTable.wox b/UI/Templates/SchedulerUI/UIxCalDayTable.wox index d212250dd..34f2a6e54 100644 --- a/UI/Templates/SchedulerUI/UIxCalDayTable.wox +++ b/UI/Templates/SchedulerUI/UIxCalDayTable.wox @@ -6,7 +6,7 @@ xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" xmlns:label="OGo:label"> -
+
@@ -18,7 +18,7 @@
- +
@@ -28,7 +28,7 @@
- +
@@ -45,24 +45,33 @@
-
- +
+ +
+
+ +
+
+
- + -
+
-
+
+ +
- - - -
+ +
@@ -70,6 +79,9 @@
+ + +
diff --git a/UI/WebServerResources/js/Scheduler/CalendarController.js b/UI/WebServerResources/js/Scheduler/CalendarController.js index 6f91602c0..435c716bb 100644 --- a/UI/WebServerResources/js/Scheduler/CalendarController.js +++ b/UI/WebServerResources/js/Scheduler/CalendarController.js @@ -10,13 +10,15 @@ function CalendarController($scope, $state, $stateParams, $timeout, $interval, $log, focus, Calendar, Component, stateEventsBlocks) { var vm = this; - vm.blocks = stateEventsBlocks; + vm.blocks = stateEventsBlocks.blocks; + vm.allDayBlocks = stateEventsBlocks.allDayBlocks; vm.changeView = changeView; // Refresh current view when the list of calendars is modified $scope.$on('calendars:list', function() { Component.$eventsBlocksForView($stateParams.view, $stateParams.day.asDate()).then(function(data) { - vm.blocks = data; + vm.blocks = data.blocks; + vm.allDayBlocks = data.allDayBlocks; }); }); diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index 9593cca1e..ce89c8233 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -278,7 +278,7 @@ futureComponentData = this.$$resource.fetch(null, 'eventsblocks', params); futureComponentData.then(function(data) { Component.$timeout(function() { - var components = [], blocks = {}; + var components = [], blocks = {}, allDayBlocks = {}, dates = []; // Instantiate Component objects _.reduce(data.events, function(objects, eventData, i) { @@ -294,18 +294,35 @@ block.component = components[block.nbr]; }); - // Convert array of blocks to object with days as keys + // Associate Component objects to all-day blocks positions + _.each(_.flatten(data.allDayBlocks), function(allDayBlock) { + allDayBlock.component = components[allDayBlock.nbr]; + }); + + // Build array of dates for (i = 0; i < data.blocks.length; i++) { - blocks[startDate.getDayString()] = data.blocks[i]; + dates.push(startDate.getDayString()); startDate.addDays(1); } - Component.$log.debug('blocks ready (' + _.keys(blocks).length + ')'); + // Convert array of blocks to object with days as keys + for (i = 0; i < data.blocks.length; i++) { + blocks[dates[i]] = data.blocks[i]; + } + + // Convert array of all-day blocks to object with days as keys + for (i = 0; i < data.allDayBlocks.length; i++) { + allDayBlocks[dates[i]] = data.allDayBlocks[i]; + } + + Component.$log.debug('blocks ready (' + _.flatten(data.blocks).length + ')'); + Component.$log.debug('all day blocks ready (' + _.flatten(data.allDayBlocks).length + ')'); // Save the blocks to the object model Component.$blocks = blocks; + Component.$allDayBlocks = allDayBlocks; - deferred.resolve(blocks); + deferred.resolve({ blocks: blocks, allDayBlocks: allDayBlocks }); }); }, deferred.reject); diff --git a/UI/WebServerResources/js/Scheduler/sgCalendarDayBlock.directive.js b/UI/WebServerResources/js/Scheduler/sgCalendarDayBlock.directive.js index 2dee79d3e..204a64631 100644 --- a/UI/WebServerResources/js/Scheduler/sgCalendarDayBlock.directive.js +++ b/UI/WebServerResources/js/Scheduler/sgCalendarDayBlock.directive.js @@ -34,11 +34,11 @@ '
', '
{{ block.component.c_title }}', ' ', - // Component has an alarm + // Component has an alarm ' ', - // Component is confidential + // Component is confidential ' ', - // Component is private + // Component is private ' ', '
', '
', diff --git a/UI/WebServerResources/scss/views/SchedulerUI.scss b/UI/WebServerResources/scss/views/SchedulerUI.scss index 83f4b68e7..46579d467 100644 --- a/UI/WebServerResources/scss/views/SchedulerUI.scss +++ b/UI/WebServerResources/scss/views/SchedulerUI.scss @@ -6,27 +6,19 @@ $hours_margin: 50px; } .dayLabels { - color: sg-color($sogoBlue, 700); - height: 35px; - left: 0; + //color: sg-color($sogoBlue, 700); overflow: hidden; - position: relative; .day { - height: 100%; - position: absolute; text-align: center; } } .days { - left: 0; - right: 0; - top: 0; - margin-left: $hours_margin; - position: relative; + display: flex; + flex-direction: row; + align-items: stretch; .day { border-left: 1px solid sg-color($sogoPaper, 300); - position: absolute; .clickableHourCell { height: 40px; border-bottom: 1px solid sg-color($sogoPaper, 300); @@ -34,24 +26,12 @@ $hours_margin: 50px; } } -.daysViewFor1Days { - .day { - left: $hours_margin; - width: 100%; - } - .days { - margin-left: 0; - } -} - +.daysViewFor1Days, .daysViewFor7Days { + margin-left: $hours_margin; .day { - width: (100% / 7); - } - $i: 0; - @while $i < 7 { - .day#{$i} { left: 1% * 100 / 7 * $i; } - $i: $i + 1; + flex-grow: 1; + flex-basis: 0; } } @@ -66,31 +46,35 @@ $hours_margin: 50px; padding: 2px; } +.hours { + color: sg-color($sogoBlue, 700); + display: inline-block; + float: left; + clear: left; + font-weight: $sg-font-light; + height: auto; + left: 0; + position: relative; + top: 0; + width: $hours_margin; + .hour { + border-bottom: 1px solid sg-color($sogoPaper, 300); + height: 40px; + left: 0; + padding: 2px; + position: relative; + right: 0; + top: 0; + } +} + .daysView { bottom: 0; overflow-x: hidden; overflow: auto; - position: relative; top: 0; - .hours { - color: sg-color($sogoBlue, 700); - display: inline-block; - float: left; - font-weight: $sg-font-light; - height: auto; - left: 0; + .hourCells { position: relative; - top: 0; - width: $hours_margin; - .hour { - border-bottom: 1px solid sg-color($sogoPaper, 300); - height: 40px; - left: 0; - padding: 2px; - position: relative; - right: 0; - top: 0; - } } .sg-event { border-radius: 10px; @@ -98,6 +82,7 @@ $hours_margin: 50px; position: absolute; left: 0%; right: 0%; + overflow: hidden; $i: 0; @while $i < 96 { // number of 15-minutes blocks in a day &.starts#{$i} { top: 10px * $i; } @@ -105,12 +90,12 @@ $hours_margin: 50px; $i: $i + 1; } .eventInside { - position: absolute; overflow: hidden; - top: 0px; - bottom: 0px; - left: 0px; - right: 0px; + } + } + &.daysHeader { + .sg-event { + position: relative; } } } @@ -150,6 +135,9 @@ $hours_margin: 50px; right: 1px; bottom: 1px; overflow: hidden; + .allDays & { + position: relative; + } } .gradient > IMG { @@ -166,7 +154,7 @@ $hours_margin: 50px; /* Attendees Editor */ .attendees { overflow: hidden; - overflow-x: scroll; + overflow-x: auto; md-content { display: table-row; } @@ -180,12 +168,13 @@ $hours_margin: 50px; } } md-list-item { + padding-left: 0; &:hover { background-color: initial; } - img { - margin-right: $mg/4; - } +// img { +// margin-right: $mg/4; +// } } .hours { font-size: 9px;