X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FTopQuickSearch.pm;h=4c65ba27d3e1f5b68e686a48a1d115824fd65672;hb=5142828d6dea553b3e54e936a2f1af368170f660;hp=7a014302126652ee3870e04eba64429716bcfa63;hpb=1c8c106733572b39dccbb45066d28d4553d31587;p=kivitendo-erp.git diff --git a/SL/Controller/TopQuickSearch.pm b/SL/Controller/TopQuickSearch.pm index 7a0143021..4c65ba27d 100644 --- a/SL/Controller/TopQuickSearch.pm +++ b/SL/Controller/TopQuickSearch.pm @@ -6,6 +6,7 @@ use parent qw(SL::Controller::Base); use SL::ClientJS; use SL::JSON; use SL::Locale::String qw(t8); +use SL::Helper::UserPreferences; use Rose::Object::MakeMethods::Generic ( 'scalar --get_set_init' => [ qw(module js) ], @@ -16,6 +17,7 @@ my @available_modules = ( 'SL::Controller::TopQuickSearch::Part', 'SL::Controller::TopQuickSearch::Service', 'SL::Controller::TopQuickSearch::Assembly', + 'SL::Controller::TopQuickSearch::Assortment', 'SL::Controller::TopQuickSearch::Contact', 'SL::Controller::TopQuickSearch::SalesQuotation', 'SL::Controller::TopQuickSearch::SalesOrder', @@ -64,9 +66,18 @@ sub available_modules { } sub enabled_modules { - my %enabled_names = map { - $_ => 1 - } @{ $::instance_conf->get_quick_search_modules }; + my $user_prefs = SL::Helper::UserPreferences->new( + namespace => 'TopQuickSearch', + ); + + my @quick_search_modules; + if (my $prefs_val = $user_prefs->get('quick_search_modules')) { + @quick_search_modules = split ',', $prefs_val; + } else { + @quick_search_modules = @{ $::instance_conf->get_quick_search_modules }; + } + + my %enabled_names = map { $_ => 1 } @quick_search_modules; grep { $enabled_names{$_->name}