Skip to content
Snippets Groups Projects
Commit ad8c4ab1 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Only create new calendar when there are none. Fix oc-1007.

parent ad32c203
No related branches found
No related tags found
Loading
...@@ -11,7 +11,7 @@ OCP\User::checkLoggedIn(); ...@@ -11,7 +11,7 @@ OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('calendar'); OCP\App::checkAppEnabled('calendar');
// Create default calendar ... // Create default calendar ...
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true); $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), false);
if( count($calendars) == 0){ if( count($calendars) == 0){
OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(),'Default calendar'); OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(),'Default calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true); $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
...@@ -19,8 +19,10 @@ if( count($calendars) == 0){ ...@@ -19,8 +19,10 @@ if( count($calendars) == 0){
$eventSources = array(); $eventSources = array();
foreach($calendars as $calendar){ foreach($calendars as $calendar){
if($calendar['active'] == 1) {
$eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar); $eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar);
} }
}
$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true'); $eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true');
$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false'); $eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment