* uri VARCHAR(100),
* active INTEGER UNSIGNED NOT NULL DEFAULT '0',
* ctag INTEGER UNSIGNED NOT NULL DEFAULT '0',
- * description TEXT,
* calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0',
* calendarcolor VARCHAR(10),
* timezone TEXT,
* @brief Creates a new calendar
* @param string $userid
* @param string $name
- * @param string $description
* @param string $components Default: "VEVENT,VTODO,VJOURNAL"
* @param string $timezone Default: null
* @param integer $order Default: 1
* @param string $color Default: null
* @return insertid
*/
- public static function addCalendar($userid,$name,$description,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
+ public static function addCalendar($userid,$name,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
$all = self::allCalendars($userid);
$uris = array();
foreach($all as $i){
$uri = self::createURI($name, $uris );
- $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
- $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+ $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
}
* @param string $principaluri
* @param string $uri
* @param string $name
- * @param string $description
* @param string $components
* @param string $timezone
* @param integer $order
* @param string $color
* @return insertid
*/
- public static function addCalendarFromDAVData($principaluri,$uri,$name,$description,$components,$timezone,$order,$color){
+ public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){
$userid = self::extractUserID($principaluri);
- $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
- $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+ $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
}
* @brief Edits a calendar
* @param integer $id
* @param string $name Default: null
- * @param string $description Default: null
* @param string $components Default: null
* @param string $timezone Default: null
* @param integer $order Default: null
*
* Values not null will be set
*/
- public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){
+ public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null){
// Need these ones for checking uri
$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['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=?' );
- $result = $stmt->execute(array($name,$description,$order,$color,$timezone,$components,$id));
+ $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
+ $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id));
return true;
}
}
if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed';
- if(!isset($newValues['description'])) $newValues['description'] = '';
if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO';
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
- return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['description'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+ return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
}
/**
// Success
if(!isset($newValues['displayname'])) $newValues['displayname'] = null;
- if(!isset($newValues['description'])) $newValues['description'] = null;
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
- OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],$newValues['description'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+ OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
return true;