diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 265c66a25b0..27da363c6a9 100755 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -164,7 +164,10 @@ Calendar={ if (view == oc_cal_currentview){ return; } + $('#'+oc_cal_currentview).css('display', "none"); + $('#'+oc_cal_currentview + "_radio").css('color', "#000000"); oc_cal_currentview = view; + //sending ajax request on every change view $("#sysbox").load(oc_webroot + "/apps/calendar/ajax/changeview.php?v="+view); //not necessary to check whether the response is true or not switch(view) { @@ -186,6 +189,9 @@ Calendar={ default: break; } + $('#'+oc_cal_currentview).css('display', "block"); + $('#'+oc_cal_currentview + "_radio").css('color', "#0098E4"); + this.updateView(); }, updateDate:function(direction){ if(direction == "forward") { @@ -193,12 +199,14 @@ Calendar={ if(oc_cal_month == 11){ this.loadEvents(oc_cal_year + 1); } + Calendar.UI.updateView(); } if(direction == "backward") { this.current.backward(); if(oc_cal_month == 0){ this.loadEvents(oc_cal_year - 1); } + Calendar.UI.updateView(); } }, loadEvents:function(year){ @@ -262,7 +270,7 @@ Calendar={ Calendar.Date.backward_day(); }, removeEvents:function(){ - $("#onedayview_wholeday").html(""); + $("#onedayview_allday").html(""); for(var i = 0; i <= 23; i++) { $("#onedayview_" + i).html(""); } @@ -287,9 +295,6 @@ Calendar={ Calendar.UI.createEventsForDate([oc_cal_dayofmonth, oc_cal_month, oc_cal_year], 0, 0); }, getEventContainer:function(week, weekday, when){ - if (when == "allday"){ - when = "wholeday"; - } return $("#onedayview_" + when); }, createEventBox:function(day_events, week, weekday, when, eventnumber){ diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index d98c288881a..1e0614700bb 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -1,15 +1,38 @@ + $l->t('All day'), + 0 => '00:00', + 1 => '01:00', + 2 => '02:00', + 3 => '03:00', + 4 => '04:00', + 5 => '05:00', + 6 => '06:00', + 7 => '07:00', + 8 => '08:00', + 9 => '09:00', + 10 => '10:00', + 11 => '11:00', + 12 => '12:00', + 13 => '13:00', + 14 => '14:00', + 15 => '15:00', + 16 => '16:00', + 17 => '17:00', + 18 => '18:00', + 19 => '19:00', + 20 => '20:00', + 21 => '21:00', + 22 => '22:00', + 23 => '23:00', +); +$weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); +?> @@ -18,24 +41,24 @@
| t("Monday");?> | -t("Tuesday");?> | -t("Wednesday");?> | -t("Thursday");?> | -t("Friday");?> | -t("Saturday");?> | -t("Sunday");?> | + $weekday): ?> +t(ucfirst($weekday));?> | +|||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
-
+
+
+ |
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
- |
+
-
-
+ |