mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
* Calendar: added purge interval of half a year
This commit is contained in:
parent
56ccefd994
commit
3ccd187698
@ -2350,15 +2350,14 @@ class calendar_boupdate extends calendar_bo
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Delete events that are more than $age years old
|
||||
*
|
||||
* Purges old events from the database
|
||||
*
|
||||
* @param int $age How many years old the event must be before it is deleted
|
||||
*/
|
||||
* Delete events that are more than $age years old
|
||||
*
|
||||
* Purges old events from the database
|
||||
*
|
||||
* @param int|float $age How many years old the event must be before it is deleted
|
||||
*/
|
||||
function purge($age)
|
||||
{
|
||||
$time = strtotime("-$age years", time());
|
||||
$this->so->purge($time);
|
||||
$this->so->purge(time() - 365*24*3600*(float)$age);
|
||||
}
|
||||
}
|
||||
|
@ -572,18 +572,20 @@ class calendar_hooks
|
||||
}
|
||||
|
||||
// Not part of the class, since config hooks are still using the old style
|
||||
function calendar_purge_old($config) {
|
||||
function calendar_purge_old($config)
|
||||
{
|
||||
$id = 'calendar_purge';
|
||||
|
||||
// Cancel old purge
|
||||
ExecMethod('phpgwapi.asyncservice.cancel_timer', $id);
|
||||
|
||||
if((int)$config > 0) {
|
||||
if((int)$config > 0)
|
||||
{
|
||||
$result = ExecMethod2('phpgwapi.asyncservice.set_timer',
|
||||
array('month' => '*', 'day' => 1),
|
||||
$id,
|
||||
'calendar.calendar_boupdate.purge',
|
||||
(int)$config
|
||||
(float)$config
|
||||
);
|
||||
}
|
||||
if(!$result)
|
||||
|
@ -77,6 +77,7 @@
|
||||
<td>
|
||||
<select name="newsettings[calendar_purge_old]">
|
||||
<option value="0ff">{lang_No_automatic_purging}</option>
|
||||
<option value=".5"{selected_calendar_purge_old_.5}>0.5 {lang_years}</option>
|
||||
<option value="1"{selected_calendar_purge_old_1}>1 {lang_year}</option>
|
||||
<option value="2"{selected_calendar_purge_old_2}>2 {lang_years}</option>
|
||||
<option value="3"{selected_calendar_purge_old_3}>3 {lang_years}</option>
|
||||
|
Loading…
Reference in New Issue
Block a user