Fix whitespace in calendar

master
Bart Visscher 2012-09-07 14:32:45 +02:00
parent ebd9de8466
commit 3e4bd9fbb5
44 changed files with 170 additions and 170 deletions

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();

View File

@ -4,7 +4,7 @@
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
*/
$l10n = OC_L10N::get('calendar');
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
// Check if we are a user
OCP\JSON::checkLoggedIn();

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
if(!OCP\User::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
@ -29,12 +29,12 @@ $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
switch($dtstart->getDateType()) {
case Sabre_VObject_Property_DateTime::UTC:
$timeOffset = $_SESSION['timezone']*60;
$newDT = $dtstart->getDateTime();
$newDT = $dtstart->getDateTime();
$newDT->add(new DateInterval("PT" . $timeOffset . "M"));
$dtstart->setDateTime($newDT);
$newDT = $dtend->getDateTime();
$dtstart->setDateTime($newDT);
$newDT = $dtend->getDateTime();
$newDT->add(new DateInterval("PT" . $timeOffset . "M"));
$dtend->setDateTime($newDT);
$dtend->setDateTime($newDT);
case Sabre_VObject_Property_DateTime::LOCALTZ:
case Sabre_VObject_Property_DateTime::LOCAL:
$startdate = $dtstart->getDateTime()->format('d-m-Y');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
if(!OCP\User::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
$firstday = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
OCP\JSON::encodedPrint(array('firstday' => $firstday));

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection')));

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
if(isset($_POST["firstday"])){

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
if(isset($_POST["timeformat"])){

View File

@ -7,7 +7,7 @@
*/
// Init owncloud
$l=OC_L10N::get('calendar');

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
$timeformat = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24");
OCP\JSON::encodedPrint(array("timeformat" => $timeformat));

View File

@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
if(array_key_exists('timezonedetection', $_POST) && $_POST['timezonedetection'] == 'on'){

View File

@ -16,7 +16,7 @@ if(isset($cal)){
exit;
}
header('Content-Type: text/Calendar');
header('Content-Disposition: inline; filename=' . str_replace(' ', '-', $calendar['displayname']) . '.ics');
header('Content-Disposition: inline; filename=' . str_replace(' ', '-', $calendar['displayname']) . '.ics');
echo OC_Calendar_Export::export($cal, OC_Calendar_Export::CALENDAR);
}elseif(isset($event)){
$data = OC_Calendar_App::getEventObject($_GET['eventid'], true);

View File

@ -242,7 +242,7 @@ Calendar={
if(Calendar.UI.scrollcount < 5){
return;
}
var scroll = $(document).scrollTop(),
doc_height = $(document).height(),
win_height = $(window).height();
@ -357,7 +357,7 @@ Calendar={
$('#advanced_weekday').css('display', 'block');
}
}
},
setViewActive: function(view){
$('#view input[type="button"]').removeClass('active');
@ -457,7 +457,7 @@ Calendar={
$("#displayname_"+calendarid).css('background-color', '#F8F8F8');
});
}
var url;
if (calendarid == 'new'){
url = OC.filePath('calendar', 'ajax/calendar', 'new.php');
@ -548,7 +548,7 @@ Calendar={
return false;
}
});
$('.shareactions > input:checkbox').change(function() {
var container = $(this).parents('li').first();
var permissions = parseInt(container.data('permissions'));
@ -572,7 +572,7 @@ Calendar={
}
OC.Share.setPermissions(itemType, itemSource, shareType, shareWith, permissions);
});
$('.shareactions > .delete').click(function() {
var container = $(this).parents('li').first();
var itemType = container.data('item-type');
@ -630,7 +630,7 @@ Calendar={
Settings:{
//
},
}
$.fullCalendar.views.list = ListView;
function ListView(element, calendar) {

View File

@ -4,7 +4,7 @@
* later.
* See the COPYING-README file.
*/
if (navigator.geolocation) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$.post(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php'), {lat: position.coords.latitude, lng: position.coords.longitude},
function(data){

View File

@ -128,7 +128,7 @@ Calendar_Import={
}
},
send: function(){
$.post(OC.filePath('calendar', 'ajax/import', 'import.php'),
$.post(OC.filePath('calendar', 'ajax/import', 'import.php'),
{progresskey: Calendar_Import.Store.progresskey, method: String (Calendar_Import.Store.method), calname: String (Calendar_Import.Store.calname), path: String (Calendar_Import.Store.path), file: String (Calendar_Import.Store.file), id: String (Calendar_Import.Store.id), calcolor: String (Calendar_Import.Store.calcolor)}, function(data){
if(data.status == 'success'){
$('#calendar_import_progressbar').progressbar('option', 'value', 100);
@ -173,7 +173,7 @@ Calendar_Import={
}
$(document).ready(function(){
if(typeof FileActions !== 'undefined'){
FileActions.register('text/calendar','importCalendar', OC.PERMISSION_READ, '', Calendar_Import.Dialog.open);
FileActions.register('text/calendar','importCalendar', OC.PERMISSION_READ, '', Calendar_Import.Dialog.open);
FileActions.setDefault('text/calendar','importCalendar');
};
});

View File

@ -24,7 +24,7 @@ $(document).ready(function(){
$('#timezonedetection').change( function(){
var post = $('#timezonedetection').serialize();
$.post( OC.filePath('calendar', 'ajax/settings', 'timezonedetection.php'), post, function(data){
});
});
$.getJSON(OC.filePath('calendar', 'ajax/settings', 'timeformat.php'), function(jsondata, status) {
@ -48,7 +48,7 @@ $(document).ready(function(){
});
});
calendarcachecheck();
});
function calendarcachecheck(){
$.getJSON(OC.filePath('calendar', 'ajax/cache', 'status.php'), function(jsondata, status) {

View File

@ -9,5 +9,5 @@
* This class manages reminders for calendars
*/
class OC_Calendar_Alarm{
}

View File

@ -5,7 +5,7 @@
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*
*
* This class manages our app actions
*/
OC_Calendar_App::$l10n = new OC_L10N('calendar');
@ -17,7 +17,7 @@ class OC_Calendar_App{
* @brief language object for calendar app
*/
public static $l10n;
/**
* @brief categories of the user
*/
@ -27,7 +27,7 @@ class OC_Calendar_App{
* @brief timezone of the user
*/
public static $tz;
/**
* @brief returns informations about a calendar
* @param int $id - id of the calendar
@ -49,7 +49,7 @@ class OC_Calendar_App{
}
return $calendar;
}
/**
* @brief returns informations about an event
* @param int $id - id of the event
@ -71,7 +71,7 @@ class OC_Calendar_App{
return false;
}
/**
* @brief returns the parsed calendar data
* @param int $id - id of the event
@ -89,7 +89,7 @@ class OC_Calendar_App{
}
return $vobject;
}
/**
* @brief checks if an event was edited and dies if it was
* @param (object) $vevent - vevent object of the event
@ -104,7 +104,7 @@ class OC_Calendar_App{
}
return true;
}
/**
* @brief returns the default categories of ownCloud
* @return (array) $categories
@ -128,7 +128,7 @@ class OC_Calendar_App{
(string)self::$l10n->t('Work'),
);
}
/**
* @brief returns the vcategories object of the user
* @return (object) $vcategories
@ -141,7 +141,7 @@ class OC_Calendar_App{
}
return self::$categories;
}
/**
* @brief returns the categories of the vcategories object
* @return (array) $categories
@ -197,7 +197,7 @@ class OC_Calendar_App{
self::getVCategories()->loadFromVObject($object, true);
}
}
/**
* @brief returns the options for the repeat rule of an repeating event
* @return array - valid inputs for the repeat rule of an repeating event
@ -205,7 +205,7 @@ class OC_Calendar_App{
public static function getRepeatOptions(){
return OC_Calendar_Object::getRepeatOptions(self::$l10n);
}
/**
* @brief returns the options for the end of an repeating event
* @return array - valid inputs for the end of an repeating events
@ -213,7 +213,7 @@ class OC_Calendar_App{
public static function getEndOptions(){
return OC_Calendar_Object::getEndOptions(self::$l10n);
}
/**
* @brief returns the options for an monthly repeating event
* @return array - valid inputs for monthly repeating events
@ -221,7 +221,7 @@ class OC_Calendar_App{
public static function getMonthOptions(){
return OC_Calendar_Object::getMonthOptions(self::$l10n);
}
/**
* @brief returns the options for an weekly repeating event
* @return array - valid inputs for weekly repeating events
@ -229,7 +229,7 @@ class OC_Calendar_App{
public static function getWeeklyOptions(){
return OC_Calendar_Object::getWeeklyOptions(self::$l10n);
}
/**
* @brief returns the options for an yearly repeating event
* @return array - valid inputs for yearly repeating events
@ -237,7 +237,7 @@ class OC_Calendar_App{
public static function getYearOptions(){
return OC_Calendar_Object::getYearOptions(self::$l10n);
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific days of the year
* @return array - valid inputs for yearly repeating events
@ -245,7 +245,7 @@ class OC_Calendar_App{
public static function getByYearDayOptions(){
return OC_Calendar_Object::getByYearDayOptions();
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific month of the year
* @return array - valid inputs for yearly repeating events
@ -253,7 +253,7 @@ class OC_Calendar_App{
public static function getByMonthOptions(){
return OC_Calendar_Object::getByMonthOptions(self::$l10n);
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific week numbers of the year
* @return array - valid inputs for yearly repeating events
@ -261,7 +261,7 @@ class OC_Calendar_App{
public static function getByWeekNoOptions(){
return OC_Calendar_Object::getByWeekNoOptions();
}
/**
* @brief returns the options for an yearly or monthly repeating event which occurs on specific days of the month
* @return array - valid inputs for yearly or monthly repeating events
@ -269,7 +269,7 @@ class OC_Calendar_App{
public static function getByMonthDayOptions(){
return OC_Calendar_Object::getByMonthDayOptions();
}
/**
* @brief returns the options for an monthly repeating event which occurs on specific weeks of the month
* @return array - valid inputs for monthly repeating events
@ -296,8 +296,8 @@ class OC_Calendar_App{
* @see OCP\Share
*/
public static function getPermissions($id, $type) {
$permissions_all = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
$permissions_all = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
| OCP\Share::PERMISSION_DELETE | OCP\Share::PERMISSION_SHARE;
if($type == self::CALENDAR) {
@ -331,13 +331,13 @@ class OC_Calendar_App{
}
return 0;
}
/**
* @brief analyses the parameter for calendar parameter and returns the objects
* @param (string) $calendarid - calendarid
* @param (int) $start - unixtimestamp of start
* @param (int) $end - unixtimestamp of end
* @return (array) $events
* @return (array) $events
*/
public static function getrequestedEvents($calendarid, $start, $end){
$events = array();
@ -359,7 +359,7 @@ class OC_Calendar_App{
}
return $events;
}
/**
* @brief generates the output for an event which will be readable for our js
* @param (mixed) $event - event object / array
@ -414,7 +414,7 @@ class OC_Calendar_App{
continue;
}
$dynamicoutput = OC_Calendar_Object::generateStartEndDate($singleevent->DTSTART, OC_Calendar_Object::getDTEndFromVEvent($singleevent), $allday, self::$tz);
$return[] = array_merge($staticoutput, $dynamicoutput);
$return[] = array_merge($staticoutput, $dynamicoutput);
}
}
return $return;

View File

@ -9,5 +9,5 @@
* This class manages Attendees for calendars
*/
class OC_Calendar_Attendees{
}

View File

@ -47,9 +47,9 @@ class OC_Calendar_Calendar{
$calendars = array();
while( $row = $result->fetchRow()){
$row['permissions'] = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
| OCP\Share::PERMISSION_DELETE | OCP\Share::PERMISSION_SHARE;
$row['permissions'] = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
| OCP\Share::PERMISSION_DELETE | OCP\Share::PERMISSION_SHARE;
$calendars[] = $row;
}
$calendars = array_merge($calendars, OCP\Share::getItemsSharedWith('calendar', OC_Share_Backend_Calendar::FORMAT_CALENDAR));
@ -84,9 +84,9 @@ class OC_Calendar_Calendar{
}
$row['permissions'] = $sharedCalendar['permissions'];
} else {
$row['permissions'] = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
| OCP\Share::PERMISSION_DELETE | OCP\Share::PERMISSION_SHARE;
$row['permissions'] = OCP\Share::PERMISSION_CREATE
| OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE
| OCP\Share::PERMISSION_DELETE | OCP\Share::PERMISSION_SHARE;
}
return $row;
}
@ -248,7 +248,7 @@ class OC_Calendar_Calendar{
return true;
}
/**
* @brief merges two calendars
* @param integer $id1
@ -272,7 +272,7 @@ class OC_Calendar_Calendar{
self::touchCalendar($id1);
self::deleteCalendar($id2);
}
/**
* @brief Creates a URI for Calendar
* @param string $name name of the calendar
@ -283,7 +283,7 @@ class OC_Calendar_Calendar{
$strip=array(' ','/','?','&');//these may break sync clients
$name=str_replace($strip,'',$name);
$name = strtolower($name);
$newname = $name;
$i = 1;
while(in_array($newname,$existing)){
@ -301,7 +301,7 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid;
}
/**
* @brief returns the possible color for calendars
* @return array
@ -333,10 +333,10 @@ class OC_Calendar_Calendar{
'cache' => true,
);
}
/*
* @brief checks if a calendar name is available for a user
* @param string $calendarname
* @param string $calendarname
* @param string $userid
* @return boolean
*/
@ -349,7 +349,7 @@ class OC_Calendar_Calendar{
}
return true;
}
/*
* @brief generates the text color for the calendar
* @param string $calendarcolor rgb calendar color code in hex format (with or without the leading #)

View File

@ -45,7 +45,7 @@ class OC_Calendar_Export{
$return .= "END:VCALENDAR";
return $return;
}
/**
* @brief exports an event and convert all times to UTC
* @param integer $id id of the event
@ -58,7 +58,7 @@ class OC_Calendar_Export{
$return .= "END:VCALENDAR";
return $return;
}
/**
* @brief generates the VEVENT with UTC dates
* @param array $event
@ -78,12 +78,12 @@ class OC_Calendar_Export{
}
return $object->VEVENT->serialize();
}
/**
* @brief fixes new line breaks
* (fixes problems with Apple iCal)
* @param string $string to fix
* @return string
* @return string
*/
private static function fixLineBreaks($string){
$string = str_replace("\r\n", "\n", $string);

View File

@ -13,61 +13,61 @@ class OC_Calendar_Import{
* @brief counts the absolute number of parsed elements
*/
private $abscount;
/*
* @brief var saves if the percentage should be saved with OC_Cache
*/
private $cacheprogress;
/*
* @brief Sabre_VObject_Component_VCalendar object - for documentation see http://code.google.com/p/sabredav/wiki/Sabre_VObject_Component_VCalendar
*/
private $calobject;
/*
* @brief var counts the number of imported elements
*/
private $count;
/*
* @brief var to check if errors happend while initialization
*/
private $error;
/*
* @brief var saves the ical string that was submitted with the __construct function
*/
private $ical;
/*
* @brief calendar id for import
*/
private $id;
/*
* @brief var saves the percentage of the import's progress
*/
private $progress;
/*
* @brief var saves the key for the percentage of the import's progress
*/
private $progresskey;
/*
* @brief var saves the timezone the events shell converted to
*/
private $tz;
/*
* @brief var saves the userid
*/
private $userid;
/*
* public methods
* public methods
*/
/*
* @brief does general initialization for import object
* @param string $calendar content of ical file
@ -88,7 +88,7 @@ class OC_Calendar_Import{
}
return true;
}
/*
* @brief imports a calendar
* @return boolean
@ -121,7 +121,7 @@ class OC_Calendar_Import{
OC_Cache::remove($this->progresskey);
return true;
}
/*
* @brief sets the timezone
* @return boolean
@ -130,7 +130,7 @@ class OC_Calendar_Import{
$this->tz = $tz;
return true;
}
/*
* @brief sets the progresskey
* @return boolean
@ -139,7 +139,7 @@ class OC_Calendar_Import{
$this->progresskey = $progresskey;
return true;
}
/*
* @brief checks if something went wrong while initialization
* @return boolean
@ -150,7 +150,7 @@ class OC_Calendar_Import{
}
return false;
}
/*
* @brief returns the percentage of progress
* @return integer
@ -158,7 +158,7 @@ class OC_Calendar_Import{
public function getProgress(){
return $this->progress;
}
/*
* @brief enables the cache for the percentage of progress
* @return boolean
@ -167,7 +167,7 @@ class OC_Calendar_Import{
$this->cacheprogress = true;
return true;
}
/*
* @brief disables the cache for the percentage of progress
* @return boolean
@ -176,12 +176,12 @@ class OC_Calendar_Import{
$this->cacheprogress = false;
return false;
}
/*
* @brief generates a new calendar name
* @return string
*/
public function createCalendarName(){
public function createCalendarName(){
$calendars = OC_Calendar_Calendar::allCalendars($this->userid);
$calendarname = $guessedcalendarname = !is_null($this->guessCalendarName())?($this->guessCalendarName()):(OC_Calendar_App::$l10n->t('New Calendar'));
$i = 1;
@ -191,7 +191,7 @@ class OC_Calendar_Import{
}
return $calendarname;
}
/*
* @brief generates a new calendar color
* @return string
@ -202,7 +202,7 @@ class OC_Calendar_Import{
}
return $this->guessCalendarColor();
}
/*
* @brief sets the id for the calendar
* @param integer $id of the calendar
@ -212,7 +212,7 @@ class OC_Calendar_Import{
$this->id = $id;
return true;
}
/*
* @brief sets the userid to import the calendar
* @param string $id of the user
@ -222,9 +222,9 @@ class OC_Calendar_Import{
$this->userid = $userid;
return true;
}
/*
* @brief returns the private
* @brief returns the private
* @param string $id of the user
* @return boolean
*/
@ -233,30 +233,30 @@ class OC_Calendar_Import{
}
/*
* private methods
* private methods
*/
/*
* @brief generates an unique ID
* @return string
* @brief generates an unique ID
* @return string
*/
//private function createUID(){
// return substr(md5(rand().time()),0,10);
//}
/*
* @brief checks is the UID is already in use for another event
* @param string $uid uid to check
* @return boolean
*/
//private function isUIDAvailable($uid){
//
//
//}
/*
* @brief generates a proper VCalendar string
* @param string $vobject
* @return string
* @return string
*/
private function createVCalendar($vobject){
if(is_object($vobject)){
@ -267,7 +267,7 @@ class OC_Calendar_Import{
$vcalendar .= "END:VCALENDAR";
return $vcalendar;
}
/*
* @brief checks if an event already exists in the user's calendars
* @param integer $insertid id of the new object
@ -285,7 +285,7 @@ class OC_Calendar_Import{
}
return false;
}
/*
* @brief updates the progress var
* @param integer $percentage
@ -302,7 +302,7 @@ class OC_Calendar_Import{
/*
* public methods for (pre)rendering of X-... Attributes
*/
/*
* @brief guesses the calendar color
* @return mixed - string or boolean
@ -313,7 +313,7 @@ class OC_Calendar_Import{
}
return null;
}
/*
* @brief guesses the calendar description
* @return mixed - string or boolean
@ -324,7 +324,7 @@ class OC_Calendar_Import{
}
return null;
}
/*
* @brief guesses the calendar name
* @return mixed - string or boolean

View File

@ -314,7 +314,7 @@ class OC_Calendar_Object{
return true;
}
/**
* @brief Creates a UID
* @return string
@ -409,7 +409,7 @@ class OC_Calendar_Object{
public static function getUTCforMDB($datetime){
return date('Y-m-d H:i', $datetime->format('U') - $datetime->getOffset());
}
/**
* @brief returns the DTEND of an $vevent object
* @param object $vevent vevent object
@ -439,7 +439,7 @@ class OC_Calendar_Object{
}
return $dtend;
}
/**
* @brief returns the options for the repeat rule of an repeating event
* @return array - valid inputs for the repeat rule of an repeating event
@ -455,7 +455,7 @@ class OC_Calendar_Object{
'yearly' => $l10n->t('Yearly')
);
}
/**
* @brief returns the options for the end of an repeating event
* @return array - valid inputs for the end of an repeating events
@ -467,7 +467,7 @@ class OC_Calendar_Object{
'date' => $l10n->t('by date')
);
}
/**
* @brief returns the options for an monthly repeating event
* @return array - valid inputs for monthly repeating events
@ -478,7 +478,7 @@ class OC_Calendar_Object{
'weekday' => $l10n->t('by weekday')
);
}
/**
* @brief returns the options for an weekly repeating event
* @return array - valid inputs for weekly repeating events
@ -494,7 +494,7 @@ class OC_Calendar_Object{
'SU' => $l10n->t('Sunday')
);
}
/**
* @brief returns the options for an monthly repeating event which occurs on specific weeks of the month
* @return array - valid inputs for monthly repeating events
@ -510,7 +510,7 @@ class OC_Calendar_Object{
'-1' => $l10n->t('last')
);
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific days of the year
* @return array - valid inputs for yearly repeating events
@ -522,7 +522,7 @@ class OC_Calendar_Object{
}
return $return;
}
/**
* @brief returns the options for an yearly or monthly repeating event which occurs on specific days of the month
* @return array - valid inputs for yearly or monthly repeating events
@ -534,7 +534,7 @@ class OC_Calendar_Object{
}
return $return;
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific month of the year
* @return array - valid inputs for yearly repeating events
@ -555,7 +555,7 @@ class OC_Calendar_Object{
'12' => $l10n->t('December')
);
}
/**
* @brief returns the options for an yearly repeating event
* @return array - valid inputs for yearly repeating events
@ -568,7 +568,7 @@ class OC_Calendar_Object{
'bydaymonth' => $l10n->t('by day and month')
);
}
/**
* @brief returns the options for an yearly repeating event which occurs on specific week numbers of the year
* @return array - valid inputs for yearly repeating events
@ -576,7 +576,7 @@ class OC_Calendar_Object{
public static function getByWeekNoOptions(){
return range(1, 52);
}
/**
* @brief validates a request
* @param array $request
@ -729,19 +729,19 @@ class OC_Calendar_Object{
}
return false;
}
/**
* @brief validates time
* @param string $time
* @return boolean
*/
*/
protected static function checkTime($time){
list($hours, $minutes) = explode(':', $time);
return empty($time)
|| $hours < 0 || $hours > 24
|| $minutes < 0 || $minutes > 60;
}
/**
* @brief creates an VCalendar Object from the request data
* @param array $request
@ -759,7 +759,7 @@ class OC_Calendar_Object{
$vevent->setUID();
return self::updateVCalendarFromRequest($request, $vcalendar);
}
/**
* @brief updates an VCalendar Object from the request data
* @param array $request
@ -841,7 +841,7 @@ class OC_Calendar_Object{
case 'yearly':
$rrule .= 'FREQ=YEARLY';
if($request['advanced_year_select'] == 'bydate'){
}elseif($request['advanced_year_select'] == 'byyearday'){
list($_day, $_month, $_year) = explode('-', $from);
$byyearday = date('z', mktime(0,0,0, $_month, $_day, $_year)) + 1;
@ -887,7 +887,7 @@ class OC_Calendar_Object{
}
}
$rrule .= ';BYMONTH=' . $bymonth;
}
if(array_key_exists('bymonthday', $request)){
$bymonthday = '';
@ -899,7 +899,7 @@ class OC_Calendar_Object{
}
}
$rrule .= ';BYMONTHDAY=' . $bymonthday;
}
}
break;
@ -952,7 +952,7 @@ class OC_Calendar_Object{
return $vcalendar;
}
/**
* @brief returns the owner of an object
* @param integer $id
@ -963,7 +963,7 @@ class OC_Calendar_Object{
$cal = OC_Calendar_Calendar::find($event['calendarid']);
return $cal['userid'];
}
/**
* @brief returns the calendarid of an object
* @param integer $id
@ -973,7 +973,7 @@ class OC_Calendar_Object{
$event = self::find($id);
return $event['calendarid'];
}
/**
* @brief checks if an object is repeating
* @param integer $id
@ -983,9 +983,9 @@ class OC_Calendar_Object{
$event = self::find($id);
return ($event['repeating'] == 1)?true:false;
}
/**
* @brief converts the start_dt and end_dt to a new timezone
* @brief converts the start_dt and end_dt to a new timezone
* @param object $dtstart
* @param object $dtend
* @param boolean $allday

View File

@ -13,7 +13,7 @@ class OC_Calendar_Repeat{
/**
* @brief returns the cache of an event
* @param (int) $id - id of the event
* @return (array)
* @return (array)
*/
public static function get($id){
$stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_repeat` WHERE `eventid` = ?');
@ -47,7 +47,7 @@ class OC_Calendar_Repeat{
/**
* @brief returns the cache of all repeating events of a calendar
* @param (int) $id - id of the calendar
* @return (array)
* @return (array)
*/
public static function getCalendar($id){
$stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_repeat` WHERE `calid` = ?');

View File

@ -34,7 +34,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
*/
public function getCalendarsForUser($principalUri) {
$raw = OC_Calendar_Calendar::allCalendarsWherePrincipalURIIs($principalUri);
$calendars = array();
foreach( $raw as $row ){
$components = explode(',',$row['components']);
@ -49,7 +49,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
'{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => $row['ctag']?$row['ctag']:'0',
'{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet($components),
);
foreach($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@ -111,7 +111,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
$newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
}
return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
}
@ -174,7 +174,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
$fieldName = $this->propertyMap[$propertyName];
$newValues[$fieldName] = $propertyValue;
}
// If there were any errors we need to fail the request
@ -201,7 +201,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
$newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
}
OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
return true;
@ -218,7 +218,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
if(preg_match( '=iCal/[1-4]?.*Mac OS X/10.[1-6](.[0-9])?=', $_SERVER['HTTP_USER_AGENT'] )){
throw new Sabre_DAV_Exception_Forbidden("Action is not possible with OSX 10.6.x", 403);
}
OC_Calendar_Calendar::deleteCalendar($calendarId);
}
@ -306,7 +306,7 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
public function deleteCalendarObject($calendarId,$objectUri){
OC_Calendar_Object::deleteFromDAVData($calendarId,$objectUri);
}
/**
* @brief Creates a etag
* @param array $row Database result

View File

@ -63,7 +63,7 @@ class OC_Share_Backend_Calendar implements OCP\Share_Backend_Collection {
while (in_array($name.$suffix, $user_calendars)) {
$suffix++;
}
return $name.$suffix;
}

View File

@ -19,14 +19,14 @@ class OC_Share_Backend_Event implements OCP\Share_Backend {
}
return false;
}
public function generateTarget($itemSource, $shareWith, $exclude = null) {
if(!self::$event) {
self::$event = OC_Calendar_Object::find($itemSource);
}
return self::$event['summary'] .= ' (' . OC_Calendar_App::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner(self::$event['id']) . ')';;
}
public function formatItems($items, $format, $parameters = null) {
$events = array();
if ($format == self::FORMAT_EVENT) {

View File

@ -7,7 +7,7 @@
<td width="20px">
<?php if($_['calendar']['permissions'] & OCP\Share::PERMISSION_SHARE) { ?>
<a href="#" class="share" data-item-type="calendar" data-item="<?php echo $_['calendar']['id']; ?>"
data-possible-permissions="<?php echo $_['calendar']['permissions'] ?>"
data-possible-permissions="<?php echo $_['calendar']['permissions'] ?>"
title="<?php echo $l->t('Share Calendar') ?>" class="action"><img class="svg action" src="<?php echo (!$_['shared']) ? OCP\Util::imagePath('core', 'actions/share.svg') : OCP\Util::imagePath('core', 'actions/shared.svg') ?>"></a>
<?php } ?>
</td>

View File

@ -222,7 +222,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="end" name="end">
<?php
if($_['repeat_end'] == '') $_['repeat_end'] = 'never';
echo OCP\html_select_options($_['repeat_end_options'], $_['repeat_end']);
echo OCP\html_select_options($_['repeat_end_options'], $_['repeat_end']);
?>
</select>
</td>

View File

@ -37,11 +37,11 @@ if(is_array($sharedwithByEvent)) {
data-share-type="<?php echo $sharee['share_type']; ?>">
<?php echo $sharee['share_with'] . ' (' . ($sharee['share_type'] == OCP\Share::SHARE_TYPE_USER ? 'user' : 'group'). ')'; ?>
<span class="shareactions">
<input class="update" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_UPDATE?'checked="checked"':'')?>
<input class="update" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_UPDATE?'checked="checked"':'')?>
title="<?php echo $l->t('Editable'); ?>">
<input class="share" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_SHARE?'checked="checked"':'')?>
<input class="share" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_SHARE?'checked="checked"':'')?>
title="<?php echo $l->t('Shareable'); ?>">
<input class="delete" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_DELETE?'checked="checked"':'')?>
<input class="delete" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_DELETE?'checked="checked"':'')?>
title="<?php echo $l->t('Deletable'); ?>">
<img src="<?php echo OCP\Util::imagePath('core', 'actions/delete.svg'); ?>" class="svg action delete"
title="<?php echo $l->t('Unshare'); ?>">
@ -63,11 +63,11 @@ if(is_array($sharedwithByEvent)) {
data-share-type="<?php echo $sharee['share_type']; ?>">
<?php echo $sharee['share_with'] . ' (' . ($sharee['share_type'] == OCP\Share::SHARE_TYPE_USER ? 'user' : 'group'). ')'; ?>
<span class="shareactions">
<input class="update" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_UPDATE?'checked="checked"':'')?>
<input class="update" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_UPDATE?'checked="checked"':'')?>
title="<?php echo $l->t('Editable'); ?>">
<input class="share" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_SHARE?'checked="checked"':'')?>
<input class="share" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_SHARE?'checked="checked"':'')?>
title="<?php echo $l->t('Shareable'); ?>">
<input class="delete" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_DELETE?'checked="checked"':'')?>
<input class="delete" type="checkbox" <?php echo ($sharee['permissions'] & OCP\Share::PERMISSION_DELETE?'checked="checked"':'')?>
title="<?php echo $l->t('Deletable'); ?>">
<img src="<?php echo OCP\Util::imagePath('core', 'actions/delete.svg'); ?>" class="svg action delete"
title="<?php echo $l->t('Unshare'); ?>">

View File

@ -217,7 +217,7 @@
<select id="end" name="end">
<?php
if($_['repeat_end'] == '') $_['repeat_end'] = 'never';
echo OCP\html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']);
echo OCP\html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']);
?>
</select>
</td>

View File

@ -22,10 +22,10 @@ class Test_Calendar_Calendars extends UnitTestCase {
$calId2=OC_Calendar_Calendar::addCalendar($uid,'test');
$this->assertNotEqual($calId1, $calId2);
$all=OC_Calendar_Calendar::allCalendars($uid);
$this->assertEqual(count($all),2);
$this->assertEqual($all[1]['id'],$calId2);
$this->assertEqual($all[1]['displayname'],'test');
$this->assertEqual($all[1]['uri'],'test1');