diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index f53eb288b7..a637e62aad 100755 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -17,6 +17,6 @@ switch($view){ OC_JSON::error(array('message'=>'unexspected parameter: ' . $view)); exit; } -OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'currentview', $view); +OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', $view); OC_JSON::success(); ?> diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index a2fa48edf8..376149b57c 100755 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -22,12 +22,12 @@ $end = $_POST['end']; $allday = $_POST['allday']; if (!$end){ - $duration = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'duration', '60'); + $duration = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'duration', '60'); $end = $start + ($duration * 60); } $start = new DateTime('@'.$start); $end = new DateTime('@'.$end); -$timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); +$timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $start->setTimezone(new DateTimeZone($timezone)); $end->setTimezone(new DateTimeZone($timezone)); diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php index 3fe89c5bc5..dfc8b304b6 100755 --- a/apps/calendar/ajax/settings/getfirstday.php +++ b/apps/calendar/ajax/settings/getfirstday.php @@ -7,6 +7,6 @@ */ OC_JSON::checkLoggedIn(); -$firstday = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo'); +$firstday = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo'); OC_JSON::encodedPrint(array('firstday' => $firstday)); ?> diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php index a5a71670ca..be01807bbb 100755 --- a/apps/calendar/ajax/settings/gettimezonedetection.php +++ b/apps/calendar/ajax/settings/gettimezonedetection.php @@ -8,4 +8,4 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -OC_JSON::success(array('detection' => OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file +OC_JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index 9b86c305e4..19aa778472 100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -17,11 +17,11 @@ $lng = $_GET['long']; $timezone = OC_Geo::timezone($lat, $lng); -if($timezone == OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone')){ +if($timezone == OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone')){ OC_JSON::success(); exit; } -OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone); +OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone); $message = array('message'=> $l->t('New Timezone:') . $timezone); OC_JSON::success($message); ?> \ No newline at end of file diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php index 232a51733b..0c6ab69536 100755 --- a/apps/calendar/ajax/settings/setfirstday.php +++ b/apps/calendar/ajax/settings/setfirstday.php @@ -8,7 +8,7 @@ OC_JSON::checkLoggedIn(); if(isset($_POST["firstday"])){ - OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]); + OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]); OC_JSON::success(); }else{ OC_JSON::error(); diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php index 428cb4220a..d648545d9c 100755 --- a/apps/calendar/ajax/settings/settimeformat.php +++ b/apps/calendar/ajax/settings/settimeformat.php @@ -8,7 +8,7 @@ OC_JSON::checkLoggedIn(); if(isset($_POST["timeformat"])){ - OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); + OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); OC_JSON::success(); }else{ OC_JSON::error(); diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index efc23c0f97..abe14bd0ec 100755 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -18,7 +18,7 @@ OC_JSON::checkAppEnabled('calendar'); // Get data if( isset( $_POST['timezone'] ) ){ $timezone=$_POST['timezone']; - OC_Preferences::setValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone ); + OCP\Config::setUserValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone ); OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') ))); }else{ OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') ))); diff --git a/apps/calendar/ajax/settings/timeformat.php b/apps/calendar/ajax/settings/timeformat.php index cec0939481..dbcfcb29b4 100755 --- a/apps/calendar/ajax/settings/timeformat.php +++ b/apps/calendar/ajax/settings/timeformat.php @@ -7,6 +7,6 @@ */ OC_JSON::checkLoggedIn(); -$timeformat = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24"); +$timeformat = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24"); OC_JSON::encodedPrint(array("timeformat" => $timeformat)); ?> diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php index 17bd740bee..8cb375183b 100755 --- a/apps/calendar/ajax/settings/timezonedetection.php +++ b/apps/calendar/ajax/settings/timezonedetection.php @@ -10,9 +10,9 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); if(array_key_exists('timezonedetection', $_POST)){ if($_POST['timezonedetection'] == 'on'){ - OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true'); + OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true'); }else{ - OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false'); + OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false'); } OC_JSON::success(); }else{ diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 0a77bdbf2b..dcc7e25e3e 100755 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -29,21 +29,21 @@ OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources)); $categories = OC_Calendar_App::getCategoryOptions(); //Fix currentview for fullcalendar -if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){ - OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek"); +if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){ + OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek"); } -if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){ - OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "month"); +if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){ + OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "month"); } -if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){ - OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "list"); +if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){ + OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "list"); } OCP\Util::addscript('3rdparty/fullcalendar', 'fullcalendar'); OCP\Util::addStyle('3rdparty/fullcalendar', 'fullcalendar'); OCP\Util::addscript('3rdparty/timepicker', 'jquery.ui.timepicker'); OCP\Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker'); -if(OC_Preferences::getValue(OCP\USER::getUser(), "calendar", "timezone") == null || OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true'){ +if(OCP\Config::getUserValue(OCP\USER::getUser(), "calendar", "timezone") == null || OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true'){ OCP\Util::addscript('calendar', 'geo'); } OCP\Util::addscript('calendar', 'calendar'); diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 7a52bf08dc..f3e9bea86a 100755 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -9,7 +9,7 @@ * This class manages our app actions */ OC_Calendar_App::$l10n = new OC_L10N('calendar'); -OC_Calendar_App::$tz = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); +OC_Calendar_App::$tz = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); class OC_Calendar_App{ const CALENDAR = 'calendar'; const EVENT = 'event'; diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index d8e9d5fb94..018bf5beff 100755 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -761,7 +761,7 @@ class OC_Calendar_Object{ $vevent->setDateTime('DTSTART', $start, Sabre_VObject_Property_DateTime::DATE); $vevent->setDateTime('DTEND', $end, Sabre_VObject_Property_DateTime::DATE); }else{ - $timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); + $timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $timezone = new DateTimeZone($timezone); $start = new DateTime($from.' '.$fromtime, $timezone); $end = new DateTime($to.' '.$totime, $timezone); diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index 3291e50524..03516b3b70 100755 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -12,7 +12,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ }else{ $searchquery[] = $query; } - $user_timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); + $user_timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $l = new OC_l10n('calendar'); foreach($calendars as $calendar){ $objects = OC_Calendar_Object::all($calendar['id']); diff --git a/apps/calendar/settings.php b/apps/calendar/settings.php index d6195108a2..981df9ffaf 100755 --- a/apps/calendar/settings.php +++ b/apps/calendar/settings.php @@ -7,7 +7,7 @@ */ $tmpl = new OC_Template( 'calendar', 'settings'); -$timezone=OC_Preferences::getValue(OCP\USER::getUser(),'calendar','timezone',''); +$timezone=OCP\Config::getUserValue(OCP\USER::getUser(),'calendar','timezone',''); $tmpl->assign('timezone',$timezone); $tmpl->assign('timezones',DateTimeZone::listIdentifiers()); diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 4285dc0f83..7e767e3673 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -1,13 +1,13 @@