Add action to list view for admins to recover events from list view (egw.stylite.de bug #8140)

This commit is contained in:
Nathan Gray 2010-08-24 16:59:13 +00:00
parent 8d1f813be6
commit 9b62e51e2d

View File

@ -171,6 +171,12 @@ class calendar_uilist extends calendar_ui
if($GLOBALS['egw_info']['apps']['timesheet']) {
$sel_options['action']['timesheet-add'] = array('label' => 'Create timesheet', 'title' => 'Create a timesheet entry from this event');
}
// Add in deleted for admins
$config = config::read('phpgwapi');
if($config['calendar_delete_history'] && $GLOBALS['egw_info']['user']['apps']['admin'])
{
$sel_options['action']['undelete'] = array('label' => 'Un-Delete', 'title' => 'Recover this event');
}
foreach($this->bo->verbose_status as $key => $value)
{
if($key == 'G') continue;
@ -524,6 +530,20 @@ class calendar_uilist extends calendar_ui
$failure++;
}
break;
case 'undelete':
$action_msg = lang('recovered');
if ($id && ($event = $this->bo->read($id, $recur_date)) && $this->bo->check_perms(EGW_ACL_EDIT,$id) &&
is_array($event) && $event['deleted'])
{
$event['deleted'] = false;
if($this->bo->save($event))
{
$success++;
break;
}
}
$failure++;
break;
case 'status':
if($id && $event = $this->bo->read($id, $recur_date))
{