From 482caa04f951c02a9a66f1f6866b79ad4edd5b29 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 29 May 2012 13:34:27 +0200 Subject: [PATCH] add button to clear calendar's cache --- apps/calendar/ajax/cache/rescan.php | 11 +++++++++++ apps/calendar/appinfo/app.php | 1 + apps/calendar/js/settings.js | 3 +++ apps/calendar/templates/settings.php | 6 +++++- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/calendar/ajax/cache/rescan.php diff --git a/apps/calendar/ajax/cache/rescan.php b/apps/calendar/ajax/cache/rescan.php new file mode 100644 index 00000000000..1355179b957 --- /dev/null +++ b/apps/calendar/ajax/cache/rescan.php @@ -0,0 +1,11 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); +OC_Calendar_Repeat::cleancalendar(OCP\USER::getUser()); +OC_Calendar_Repeat::generatecalendar(OCP\USER::getUser()); \ No newline at end of file diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index b02fc602c6b..73480522eaf 100644 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -5,6 +5,7 @@ OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php'; OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php'; OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php'; +OC::$CLASSPATH['OC_Calendar_Repeat'] = 'apps/calendar/lib/repeat.php'; OC::$CLASSPATH['OC_Calendar_Share'] = 'apps/calendar/lib/share.php'; OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php'; OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'); diff --git a/apps/calendar/js/settings.js b/apps/calendar/js/settings.js index c768a47a797..f42e024d083 100644 --- a/apps/calendar/js/settings.js +++ b/apps/calendar/js/settings.js @@ -44,4 +44,7 @@ $(document).ready(function(){ $('#' + jsondata.firstday).attr('selected',true); $('#firstday').chosen(); }); + $('#cleancalendarcache').click(function(){ + $.getJSON(OC.filePath('calendar', 'ajax/cache', 'rescan.php')); + }); }); diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 12117750ca5..40cef079593 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -1,7 +1,7 @@ - * Copyright (c) 2011 Georg Ehrke + * Copyright (c) 2012 Georg Ehrke * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -44,6 +44,10 @@ + + + + t('Calendar CalDAV syncing address:');?> -- 2.39.5