mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:07 +01:00
Backport 31777 - Add action to list view for admins to recover events from list view (egw.stylite.de bug #8140)
This commit is contained in:
parent
1b76adb9fe
commit
9074f4f438
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user