X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FTopQuickSearch.pm;h=d6ce6e1fc2af389e4d1d9079a71f2d10e57a8b7d;hb=bc89ebf428c7bde2205b31c5c9abb66879e673e4;hp=c3ad7f37abcc898b32630d244ba64230b82c0045;hpb=65de6f61582fbd9e93c4a06cb11daab66ff4f308;p=kivitendo-erp.git diff --git a/SL/Controller/TopQuickSearch.pm b/SL/Controller/TopQuickSearch.pm index c3ad7f37a..d6ce6e1fc 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) ], @@ -20,8 +21,10 @@ my @available_modules = ( 'SL::Controller::TopQuickSearch::Contact', 'SL::Controller::TopQuickSearch::SalesQuotation', 'SL::Controller::TopQuickSearch::SalesOrder', + 'SL::Controller::TopQuickSearch::SalesDeliveryOrder', 'SL::Controller::TopQuickSearch::RequestForQuotation', 'SL::Controller::TopQuickSearch::PurchaseOrder', + 'SL::Controller::TopQuickSearch::PurchaseDeliveryOrder', 'SL::Controller::TopQuickSearch::GLTransaction', 'SL::Controller::TopQuickSearch::Customer', 'SL::Controller::TopQuickSearch::Vendor', @@ -65,9 +68,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}