*Users can now see and restore their 'deleted' but held events, if deletion prevention is turned on. There is now a config setting to allow users to purge their own 'deleted' events.

This commit is contained in:
Nathan Gray 2010-11-22 16:19:28 +00:00
parent 6476c7af39
commit 7358243aa1
4 changed files with 14 additions and 4 deletions

View File

@ -723,7 +723,7 @@ class calendar_ui
// Add in deleted for admins
$config = config::read('phpgwapi');
if($config['calendar_delete_history'] && $GLOBALS['egw_info']['user']['apps']['admin']) {
if($config['calendar_delete_history']) {
$options .= '<option value="deleted"'.($this->filter == 'deleted' ? ' selected="selected"' : '').' title="'.lang('Show events that have been deleted').'">'.lang('Deleted').'</options>'."\n";
}

View File

@ -1470,11 +1470,15 @@ function replace_eTemplate_onsubmit()
// Allow admins to restore deleted events
$config = config::read('phpgwapi');
if($config['calendar_delete_history'] && $event['deleted'] && $GLOBALS['egw_info']['user']['apps']['admin'])
if($config['calendar_delete_history'] && $event['deleted'] )
{
$content['deleted'] = $preserv['deleted'] = null;
$etpl->set_cell_attribute('button[save]', 'label', 'Recover');
$etpl->set_cell_attribute('button[apply]', 'disabled', true);
if($GLOBALS['egw_info']['user']['apps']['admin'] || $config['calendar_delete_history'] != 'user_purge')
{
$readonlys['button[delete]'] = true;
}
}
// Setup history tab

View File

@ -173,9 +173,14 @@ class calendar_uilist extends calendar_ui
}
// Add in deleted for admins
$config = config::read('phpgwapi');
if($config['calendar_delete_history'] && $GLOBALS['egw_info']['user']['apps']['admin'])
if($config['calendar_delete_history'])
{
$sel_options['action']['undelete'] = array('label' => 'Un-Delete', 'title' => 'Recover this event');
if(!$GLOBALS['egw_info']['user']['apps']['admin'] && $config['calendar_delete_history'] != 'user_purge')
{
unset($sel_options['action']['delete']);
$content['nm']['no_delete'] = true;
}
}
foreach($this->bo->verbose_status as $key => $value)
{
@ -351,7 +356,7 @@ class calendar_uilist extends calendar_ui
{
$readonlys['view['.$event['id'].']'] = !($readonlys['edit['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_EDIT,$event));
// Delete disabled for other applications
$readonlys['delete['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_DELETE,$event) || !is_numeric($event['id']);
$readonlys['delete['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_DELETE,$event) || !is_numeric($event['id']) || $params['no_delete'];
// Filemanager disabled for other applications
$readonlys['filemanager['.$event['id'].']'] = !is_numeric($event['id']);

View File

@ -65,6 +65,7 @@
<select name="newsettings[calendar_delete_history]">
<option value="">{lang_No}</option>
<option value="history"{selected_calendar_delete_history_history}>{lang_Yes,_only_admins_can_purge_deleted_items}</option>
<option value="user_purge"{selected_calendar_delete_history_user_purge}>{lang_Yes,_users_can_purge_their_deleted_items}</option>
</select>
</td>
</tr>