add some information about repeating events caching on personal settings page
This commit is contained in:
parent
08a3a4f185
commit
3c9be43aa4
|
@ -7,5 +7,9 @@
|
||||||
*/
|
*/
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
OC_Calendar_Repeat::cleancalendar(OCP\USER::getUser());
|
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
|
||||||
OC_Calendar_Repeat::generatecalendar(OCP\USER::getUser());
|
foreach($calendars as $calendar){
|
||||||
|
OC_Calendar_Repeat::cleancalendar($calendar['id']);
|
||||||
|
OC_Calendar_Repeat::generatecalendar($calendar['id']);
|
||||||
|
}
|
||||||
|
OCP\JSON::success();
|
|
@ -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')));
|
||||||
|
}
|
|
@ -45,6 +45,23 @@ $(document).ready(function(){
|
||||||
$('#firstday').chosen();
|
$('#firstday').chosen();
|
||||||
});
|
});
|
||||||
$('#cleancalendarcache').click(function(){
|
$('#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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue