]> source.dussan.org Git - nextcloud-server.git/commitdiff
add some information about repeating events caching on personal settings page
authorGeorg Ehrke <dev@georgswebsite.de>
Mon, 11 Jun 2012 20:16:26 +0000 (22:16 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Mon, 11 Jun 2012 20:16:26 +0000 (22:16 +0200)
apps/calendar/ajax/cache/rescan.php
apps/calendar/ajax/cache/status.php
apps/calendar/js/settings.js

index 1355179b957d498984babe9063d7370e76df1873..3417f1ae4b40ed906a466015a2bbe678c506fbf9 100644 (file)
@@ -7,5 +7,9 @@
  */
 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
+$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
+foreach($calendars as $calendar){
+       OC_Calendar_Repeat::cleancalendar($calendar['id']);
+       OC_Calendar_Repeat::generatecalendar($calendar['id']);
+}
+OCP\JSON::success();
\ No newline at end of file
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d2806d478955ca4a077b86f7ed7313724056e77d 100644 (file)
@@ -0,0 +1,22 @@
+<?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');
+$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
+$allcached = true;
+foreach($calendars as $calendar){
+       if(!OC_Calendar_Repeat::is_calendar_cached($calendar['id'])){
+               $allcached = false;
+       }
+}
+$l = new OC_L10N('calendar');
+if(!$allcached){
+       OCP\JSON::error(array('message'=>'Not all calendars are completely cached', 'l10n'=>$l->t('Not all calendars are completely cached')));
+}else{
+       OCP\JSON::success(array('message'=>'Everything seems to be completely cached', 'l10n'=>$l->t('Everything seems to be completely cached')));
+}
\ No newline at end of file
index f42e024d0836528c9dd60a519247000e9549c046..eafd503c994dc8b8b79711048a7b914f3bdb7790 100644 (file)
@@ -45,6 +45,23 @@ $(document).ready(function(){
                $('#firstday').chosen();
        });
        $('#cleancalendarcache').click(function(){
-               $.getJSON(OC.filePath('calendar', 'ajax/cache', 'rescan.php'));
+               $.getJSON(OC.filePath('calendar', 'ajax/cache', 'rescan.php'), function(){
+                       calendarcachecheck();
+               });
        });
+       calendarcachecheck();
 });
+function calendarcachecheck(){
+       $.getJSON(OC.filePath('calendar', 'ajax/cache', 'status.php'), function(jsondata, status) {
+               $('#cleancalendarcache').attr('title', jsondata.l10n);
+               if(jsondata.status == 'success'){
+                       $('#cleancalendarcache').css('background', '#90EE90');
+                       $('#cleancalendarcache').css('color', '#333');
+                       $('#cleancalendarcache').css('text-shadow', '#fff 0 1px 0');
+               }else{
+                       $('#cleancalendarcache').css('background', '#DC143C');
+                       $('#cleancalendarcache').css('color', '#FFFFFF');
+                       $('#cleancalendarcache').css('text-shadow', '0px 0px 0px #fff, 0px 0px #fff');
+               }
+       });
+}
\ No newline at end of file