* Infolog/Edit:Add an implicit user preference in order to remember the last chosen of infolog's type

This commit is contained in:
Hadi Nategh 2014-07-03 13:44:04 +00:00
parent d5cb4112b5
commit eeb375de39
2 changed files with 7 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class infolog_hooks
), ),
'add' => array( 'add' => array(
'menuaction' => 'infolog.infolog_ui.edit', 'menuaction' => 'infolog.infolog_ui.edit',
'type' => 'task' 'type' => $GLOBALS['egw_info']['user']['preferences']['preferred_type']
), ),
'add_app' => 'action', 'add_app' => 'action',
'add_id' => 'action_id', 'add_id' => 'action_id',

View File

@ -1699,6 +1699,8 @@ class infolog_ui
} }
else else
{ {
$GLOBALS['egw']->preferences->add('infolog','preferred_type',$content['info_type']);
$GLOBALS['egw']->preferences->save_repository(false,'user',false);
$content['msg'] = lang('InfoLog entry saved'); $content['msg'] = lang('InfoLog entry saved');
egw_framework::refresh_opener($content['msg'],'infolog',$info_id,$operation); egw_framework::refresh_opener($content['msg'],'infolog',$info_id,$operation);
} }
@ -1953,6 +1955,10 @@ class infolog_ui
{ {
$content['info_type'] = $type; $content['info_type'] = $type;
} }
else if ($type == '' && empty($content['info_type']) && isset($GLOBALS['egw_info']['user']['preferences']['infolog']['preferred_type']))
{
$content['info_type'] = $GLOBALS['egw_info']['user']['preferences']['infolog']['preferred_type'];
}
if (empty($content['info_status'])) $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; if (empty($content['info_status'])) $content['info_status'] = $this->bo->status['defaults'][$content['info_type']];
if (empty($content['info_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; if (empty($content['info_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%';
break; break;