diff --git a/preferences/inc/class.uisettings.inc.php b/preferences/inc/class.uisettings.inc.php index 4a180b5e23..c6846caefd 100755 --- a/preferences/inc/class.uisettings.inc.php +++ b/preferences/inc/class.uisettings.inc.php @@ -28,9 +28,30 @@ { /* Don't use a global variable for this ... */ define('HAS_ADMIN_RIGHTS',1); + + if ((int) $_GET['account_id']) + { + $GLOBALS['egw']->preferences->account_id = (int) $_GET['account_id']; + $GLOBALS['egw']->preferences->read_repository(); + } } } + + /** + * add nation ACL tab to Admin >> Edit user + */ + function edit_user() + { + global $menuData; + + $menuData[] = array( + 'description' => 'Preferences', + 'url' => '/index.php', + 'extradata' => 'menuaction=preferences.uisettings.index&appname=preferences' + ); + } + function index() { // make preferences called via sidebox menu of an app, to behave like a part of that app @@ -62,6 +83,10 @@ 'menuaction' => 'preferences.uisettings.index', 'appname' => $_GET['appname'], ); + if ($this->is_admin() && (int) $_GET['account_id']) + { + $link_params['account_id'] = (int) $_GET['account_id']; + } } $user = get_var('user',Array('POST')); $forced = get_var('forced',Array('POST')); @@ -259,8 +284,9 @@ } } - $GLOBALS['egw_info']['flags']['app_header'] = $_GET['appname'] == 'preferences' ? - lang('Preferences') : lang('%1 - Preferences',$GLOBALS['egw_info']['apps'][$_GET['appname']]['title']); + $GLOBALS['egw_info']['flags']['app_header'] = ($this->is_admin() && (int) $_GET['account_id'] ? + $GLOBALS['egw']->common->grab_owner_name((int) $_GET['account_id']).': ' : '').($_GET['appname'] == 'preferences' ? + lang('Common preferences') : lang('%1 - Preferences',$GLOBALS['egw_info']['apps'][$_GET['appname']]['title'])); $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); @@ -271,8 +297,14 @@ } if($this->is_admin()) { + if ((int) $_GET['account_id']) + { + echo '
'."\n".ExecMethod('admin.uimenuclass.createHTMLCode','edit_user')."\n | \n".
+ ' '. + lang('Common preferences')." \n"; + } $tabs[] = array( - 'label' => lang('Your preferences'), + 'label' => (int) $_GET['account_id'] ? $GLOBALS['egw']->common->grab_owner_name($_GET['account_id']) : lang('Your preferences'), 'link' => $GLOBALS['egw']->link($pref_link,$link_params+array('type'=>'user')), ); $tabs[] = array( @@ -305,6 +337,10 @@ } $this->t->pfp('phpgw_body','preferences'); + if($this->is_admin() && (int) $_GET['account_id']) + { + echo "\n |
'; print_r($GLOBALS['egw']->preferences->data); echo "\n"; $GLOBALS['egw']->common->egw_footer(); diff --git a/preferences/setup/setup.inc.php b/preferences/setup/setup.inc.php index bc6e51ab1f..caeff4e170 100755 --- a/preferences/setup/setup.inc.php +++ b/preferences/setup/setup.inc.php @@ -23,6 +23,7 @@ $setup_info['preferences']['hooks'][] = 'config'; $setup_info['preferences']['hooks'][] = 'preferences'; $setup_info['preferences']['hooks'][] = 'settings'; + $setup_info['preferences']['hooks']['edit_user'] = 'preferences.uisettings.edit_user'; /* Dependencies for this app to work */ $setup_info['preferences']['depends'][] = array( diff --git a/preferences/templates/default/preferences.tpl b/preferences/templates/default/preferences.tpl index 71b160a0c5..4617cd2730 100644 --- a/preferences/templates/default/preferences.tpl +++ b/preferences/templates/default/preferences.tpl @@ -1,4 +1,3 @@ -