summaryrefslogtreecommitdiffstats
path: root/apps/calendar/lib
diff options
context:
space:
mode:
authorGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-08-31 20:20:46 +0200
committerGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-08-31 20:20:46 +0200
commit5678d78d54cdabf4b6971803acd0bd3eb3573cc9 (patch)
treeafa20e855c2d8e41ec3d650ff746ee4335ec845f /apps/calendar/lib
parent9a60313c3b7a1abd3aa75d3c914682bfbd03fb07 (diff)
downloadnextcloud-server-5678d78d54cdabf4b6971803acd0bd3eb3573cc9.tar.gz
nextcloud-server-5678d78d54cdabf4b6971803acd0bd3eb3573cc9.zip
new changes (e.g. show events) by Bart Visscher
Diffstat (limited to 'apps/calendar/lib')
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/calendar.php21
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/connector_sabre.php0
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/hooks.php0
3 files changed, 11 insertions, 10 deletions
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index e28e384ba88..c1223b5b3ab 100644..100755
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -56,15 +56,15 @@
* This class manages our calendars
*/
class OC_Calendar_Calendar{
- public static function allCalendars($uid){
+ public static function allCalendars($uid, $active=null){
$values = array($uid);
- $active_where = '';
- if (!is_null($active)){
- $active_where = ' AND active = ?';
- $values[] = $active;
- }
- $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*calendar_calendars WHERE userid = ?' . $active_where );
- $result = $stmt->execute($values);
+ $active_where = '';
+ if (!is_null($active)){
+ $active_where = ' AND active = ?';
+ $values[] = $active;
+ }
+ $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*calendar_calendars WHERE userid = ?' . $active_where );
+ $result = $stmt->execute($values);
$calendars = array();
while( $row = $result->fetchRow()){
@@ -112,14 +112,14 @@ class OC_Calendar_Calendar{
public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){
// Need these ones for checking uri
- $calendar = self::find($id);
+ $calendar = self::findCalendar($id);
// Keep old stuff
if(is_null($name)) $name = $calendar['name'];
if(is_null($description)) $description = $calendar['description'];
if(is_null($components)) $components = $calendar['components'];
if(is_null($timezone)) $timezone = $calendar['timezone'];
- if(is_null($order)) $order = $calendar['order'];
+ if(is_null($order)) $order = $calendar['calendarorder'];
if(is_null($color)) $color = $calendar['color'];
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,description=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
@@ -131,6 +131,7 @@ class OC_Calendar_Calendar{
public static function setCalendarActive($id,$active){
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET active = ? WHERE id = ?' );
$stmt->execute(array($active, $id));
+
return true;
}
diff --git a/apps/calendar/lib/connector_sabre.php b/apps/calendar/lib/connector_sabre.php
index aff1941688f..aff1941688f 100644..100755
--- a/apps/calendar/lib/connector_sabre.php
+++ b/apps/calendar/lib/connector_sabre.php
diff --git a/apps/calendar/lib/hooks.php b/apps/calendar/lib/hooks.php
index 5c446102b22..5c446102b22 100644..100755
--- a/apps/calendar/lib/hooks.php
+++ b/apps/calendar/lib/hooks.php