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

Agree on argument type.

parent 1e76a530
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ foreach($lines as $line) { ...@@ -45,7 +45,7 @@ foreach($lines as $line) {
} }
$i++; $i++;
} }
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1); $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
$id = $calendars[0]['id']; $id = $calendars[0]['id'];
foreach($uids as $uid) { foreach($uids as $uid) {
$prefix=$suffix=$content=array(); $prefix=$suffix=$content=array();
......
...@@ -11,11 +11,11 @@ OCP\User::checkLoggedIn(); ...@@ -11,11 +11,11 @@ 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(), 1); $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
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(), 1); // $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
} // }
$eventSources = array(); $eventSources = array();
foreach($calendars as $calendar){ foreach($calendars as $calendar){
......
...@@ -44,13 +44,13 @@ class OC_Calendar_Calendar{ ...@@ -44,13 +44,13 @@ class OC_Calendar_Calendar{
/** /**
* @brief Returns the list of calendars for a specific user. * @brief Returns the list of calendars for a specific user.
* @param string $uid User ID * @param string $uid User ID
* @param boolean $active Only return calendars with this $active state, default(=null) is don't care * @param boolean $active Only return calendars with this $active state, default(=false) is don't care
* @return array * @return array
*/ */
public static function allCalendars($uid, $active=null){ public static function allCalendars($uid, $active=false){
$values = array($uid); $values = array($uid);
$active_where = ''; $active_where = '';
if (!is_null($active) && $active){ if ($active === true){
$active_where = ' AND active = ?'; $active_where = ' AND active = ?';
$values[] = $active; $values[] = $active;
} }
......
<?php <?php
class OC_Search_Provider_Calendar extends OC_Search_Provider{ class OC_Search_Provider_Calendar extends OC_Search_Provider{
function search($query){ function search($query){
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1); $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
if(count($calendars)==0 || !OCP\App::isEnabled('calendar')){ if(count($calendars)==0 || !OCP\App::isEnabled('calendar')){
//return false; //return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment