X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5570a18e7da5c73191f82c5f71c08eeb7ec6dccb..6ecf138db5fceea08d68dbcd539344797cd43939:/bin/mozilla/am.pl diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 347084d04..432eb7b9d 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -42,6 +42,7 @@ use SL::AM; use SL::CA; use SL::Form; use SL::Helper::Flash; +use SL::Helper::UserPreferences; use SL::User; use SL::USTVA; use SL::Iconv; @@ -84,7 +85,6 @@ sub add_account { $form->{callback} = "am.pl?action=list_account" unless $form->{callback}; &account_header; - &form_footer; $main::lxdebug->leave_sub(); } @@ -344,21 +344,6 @@ sub account_header { $main::lxdebug->leave_sub(); } -sub form_footer { - $::lxdebug->enter_sub; - $::auth->assert('config'); - - print $::form->parse_html_template('am/form_footer', { - show_save => !$::form->{id} - || ($::form->{id} && $::form->{orphaned}) - || ($::form->{type} eq "account" && !$::form->{new_chart_valid}), - show_delete => $::form->{id} && $::form->{orphaned}, - show_save_as_new => $::form->{id} && $::form->{type} eq "account", - }); - - $::lxdebug->leave_sub; -} - sub save_account { $main::lxdebug->enter_sub(); @@ -589,6 +574,7 @@ sub config { my $form = $main::form; my %myconfig = %main::myconfig; my $locale = $main::locale; + my $defaults = SL::DB::Default->get; _build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); _build_cfg_options('timeformat', qw(hh:mm hh:mm:ss)); @@ -659,14 +645,30 @@ sub config { }; } + my $user_prefs = SL::Helper::UserPreferences->new( + namespace => 'TopQuickSearch', + ); + my $prefs_val; + my @quick_search_modules; + if ($user_prefs) { + $prefs_val = $user_prefs->get('quick_search_modules'); + @quick_search_modules = split ',', $prefs_val; + } + + my $enabled_quick_search = [ SL::Controller::TopQuickSearch->new->available_modules ]; + $form->{enabled_quick_searchmodules} = \@{$enabled_quick_search}; + $form->{default_quick_searchmodules} = \@quick_search_modules; + + $form->{displayable_name_specs_by_module} = AM->displayable_name_specs_by_module(); + $myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); $form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); $form->{todo_cfg} = { TODO->get_user_config('login' => $::myconfig{login}) }; + $::request->{layout}->use_javascript("jquery.multiselect2side.js"); $form->{title} = $locale->text('Edit Preferences for #1', $::myconfig{login}); setup_am_config_action_bar(); - $form->header(); $form->{full_signature} = $form->create_email_signature(); @@ -687,6 +689,11 @@ sub save_preferences { TODO->save_user_config('login' => $::myconfig{login}, %{ $form->{todo_cfg} || { } }); + if ($form->{quick_search_modules}) { + my $user_prefs = SL::Helper::UserPreferences->new( namespace => 'TopQuickSearch',); + my $quick_search_modules = join ',', @{$form->{quick_search_modules}}; + $user_prefs->store('quick_search_modules', $quick_search_modules); + } if (AM->save_preferences($form)) { if ($::auth->can_change_password() && defined $form->{new_password} @@ -1397,8 +1404,6 @@ sub setup_am_edit_account_action_bar { action => [ t8('Save'), submit => [ '#form', { action => "save_account" } ], - disabled => $::form->{id} && !$::form->{orphaned} ? t8('The object is in use and cannot be changed.') - : undef, accesskey => 'enter', ],