From eeb375de39a33bc022c6a1e2d3c0dbd29fb59708 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 3 Jul 2014 13:44:04 +0000 Subject: [PATCH] * Infolog/Edit:Add an implicit user preference in order to remember the last chosen of infolog's type --- infolog/inc/class.infolog_hooks.inc.php | 2 +- infolog/inc/class.infolog_ui.inc.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_hooks.inc.php b/infolog/inc/class.infolog_hooks.inc.php index 58f88527a1..ff5d02bf70 100644 --- a/infolog/inc/class.infolog_hooks.inc.php +++ b/infolog/inc/class.infolog_hooks.inc.php @@ -63,7 +63,7 @@ class infolog_hooks ), 'add' => array( 'menuaction' => 'infolog.infolog_ui.edit', - 'type' => 'task' + 'type' => $GLOBALS['egw_info']['user']['preferences']['preferred_type'] ), 'add_app' => 'action', 'add_id' => 'action_id', diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index d27069b687..3aff0f3837 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -1699,6 +1699,8 @@ class infolog_ui } 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'); egw_framework::refresh_opener($content['msg'],'infolog',$info_id,$operation); } @@ -1953,6 +1955,10 @@ class infolog_ui { $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_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; break;