mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-17 12:01:20 +02:00
Admin - add filter for periodic runs
- Store & display exec results for periodic runs
This commit is contained in:
@ -38,6 +38,7 @@ class admin_cmds
|
||||
|
||||
if (!$rows) return array();
|
||||
|
||||
$async = new Api\Asyncservice();
|
||||
foreach($rows as &$row)
|
||||
{
|
||||
try {
|
||||
@ -47,10 +48,31 @@ class admin_cmds
|
||||
catch (Exception $e) {
|
||||
$row['title'] = $e->getMessage();
|
||||
}
|
||||
$row['data'] = !($data = json_php_unserialize($row['data'])) ? '' :
|
||||
json_encode($data+(empty($row['rrule'])?array():array('rrule' => $row['rrule'])),
|
||||
JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
|
||||
|
||||
if(method_exists($cmd, 'summary'))
|
||||
{
|
||||
$row['data'] = $cmd->summary();
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['data'] = !($data = json_php_unserialize($row['data'])) ? '' :
|
||||
json_encode($data+(empty($row['rrule'])?array():array('rrule' => $row['rrule'])),
|
||||
JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
if($row['rrule'])
|
||||
{
|
||||
$rrule = calendar_rrule::event2rrule(calendar_rrule::parseRrule($row['rrule'],true)+array(
|
||||
'start' => time(),
|
||||
'tzid'=> Api\DateTime::$server_timezone->getName()
|
||||
));
|
||||
$row['rrule'] = ''.$rrule;
|
||||
}
|
||||
if(!$row['scheduled'] && $cmd && $cmd->async_job_id)
|
||||
{
|
||||
$job = $async->read($cmd->async_job_id);
|
||||
|
||||
$row['scheduled'] = $job ? $job[$cmd->async_job_id]['next'] : null;
|
||||
}
|
||||
if ($row['status'] == admin_cmd::scheduled)
|
||||
{
|
||||
$row['class'] = 'AllowDelete';
|
||||
@ -98,7 +120,12 @@ class admin_cmds
|
||||
}
|
||||
unset($cmd);
|
||||
}
|
||||
$periodic = array(
|
||||
0 => 'no',
|
||||
1 => 'yes'
|
||||
);
|
||||
$tpl->exec('admin.admin_cmds.index',$content,array(
|
||||
'periodic' => $periodic,
|
||||
'status' => admin_cmd::$stati,
|
||||
'remote_id' => admin_cmd::remote_sites(),
|
||||
),array(),$content);
|
||||
|
Reference in New Issue
Block a user