diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index b396ff4945..ef05c7cd49 100644 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -7,10 +7,9 @@ */ require_once ("../../../lib/base.php"); -if(!OC_USER::isLoggedIn()) { - die(""); -} +OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $currentview = $_GET["v"]; OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview); +OC_JSON::success(); ?> diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 7150fb8490..2764184dac 100644 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -19,6 +19,17 @@ $eventSources = array(); foreach($calendars as $calendar){ $eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar); } +//Fix currentview for fullcalendar +if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){ + OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "agendaWeek"); +} +if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){ + OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "month"); +} +if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){ + OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "month"); +} + OC_Util::addScript('3rdparty/fullcalendar', 'fullcalendar'); OC_Util::addStyle('3rdparty/fullcalendar', 'fullcalendar'); OC_Util::addScript('calendar', 'calendar'); diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index bf9e2628ff..fccc301a91 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -531,10 +531,10 @@ $(document).ready(function(){ }); $('#onemonthview_radio').click(function(){ $('#calendar_holder').fullCalendar('changeView', 'month'); - }); + });/* $('#listview_radio').click(function(){ $('#calendar_holder').fullCalendar('changeView', 'list'); - }); + });*/ $('#today_input').click(function(){ $('#calendar_holder').fullCalendar('today'); }); diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 1c948b948c..d9c6a506e0 100644 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -13,7 +13,7 @@ var allDayText = 't('All day') ?>';
- +