]> source.dussan.org Git - nextcloud-server.git/commitdiff
add button to clear calendar's cache
authorGeorg Ehrke <dev@georgswebsite.de>
Tue, 29 May 2012 11:34:27 +0000 (13:34 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Tue, 29 May 2012 11:34:27 +0000 (13:34 +0200)
apps/calendar/ajax/cache/rescan.php [new file with mode: 0644]
apps/calendar/appinfo/app.php
apps/calendar/js/settings.js
apps/calendar/templates/settings.php

diff --git a/apps/calendar/ajax/cache/rescan.php b/apps/calendar/ajax/cache/rescan.php
new file mode 100644 (file)
index 0000000..1355179
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+/**
+ * Copyright (c) 2012 Georg Ehrke <georg@ownCloud.com>
+ * 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
index b02fc602c6b33cf63c60380c398d5008575f0656..73480522eafa7d13f3ed4966322dd68f6268961f 100644 (file)
@@ -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');
index c768a47a797f36d38dee3c0385e4884356a7a3dc..f42e024d0836528c9dd60a519247000e9549c046 100644 (file)
@@ -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'));
+       });
 });
index 12117750ca55392beb3003553d17dc6bd01c10f2..40cef0795932a84b4d765b05d35751182d9dada3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
+ * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
  * This file is licensed under the Affero General Public License version 3 or
  * later.
  * See the COPYING-README file.
                 </select>
             </td></tr>
 
+            <tr><td><label for="" class="bold"><?php echo $l->t('Cache');?></label></td><td>
+                <input id="cleancalendarcache" type="button" class="button" value="<?php echo $l->t('Clear cache for repeating events');?>">
+            </td></tr>
+
         </table>
 
         <?php echo $l->t('Calendar CalDAV syncing address:');?>