зеркало из https://github.com/nextcloud/server.git
added transition function from 'old' calendar to fullcalendar (fixed currentview bug)
This commit is contained in:
Родитель
085001fa24
Коммит
a1eda425ed
|
@ -7,10 +7,9 @@
|
|||
*/
|
||||
|
||||
require_once ("../../../lib/base.php");
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$currentview = $_GET["v"];
|
||||
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
|
||||
OC_JSON::success();
|
||||
?>
|
||||
|
|
|
@ -19,6 +19,17 @@ $eventSources = array();
|
|||
foreach($calendars as $calendar){
|
||||
$eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar);
|
||||
}
|
||||
//Fix currentview for fullcalendar
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){
|
||||
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "agendaWeek");
|
||||
}
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){
|
||||
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "month");
|
||||
}
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){
|
||||
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "list");
|
||||
}
|
||||
|
||||
OC_Util::addScript('3rdparty/fullcalendar', 'fullcalendar');
|
||||
OC_Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
|
||||
OC_Util::addScript('calendar', 'calendar');
|
||||
|
|
Загрузка…
Ссылка в новой задаче