Only create new calendar when there are none. Fix oc-1007.
This commit is contained in:
parent
ad32c20300
commit
ad8c4ab182
|
@ -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){
|
||||||
|
|
||||||
$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');
|
||||||
|
|
Loading…
Reference in New Issue