namespace => 'TopQuickSearch',
);
- my %enabled_names;
+ my @quick_search_modules;
if (my $prefs_val = $user_prefs->get('quick_search_modules')) {
- my @quick_search_modules = split ',', $prefs_val;
-
- %enabled_names = map {
- $_ => 1
- } @quick_search_modules ;
+ @quick_search_modules = split ',', $prefs_val;
} else {
- %enabled_names = map {
- $_ => 1
- } @{ $::instance_conf->get_quick_search_modules };
+ @quick_search_modules = @{ $::instance_conf->get_quick_search_modules };
}
+ my %enabled_names = map { $_ => 1 } @quick_search_modules;
+
grep {
$enabled_names{$_->name}
} $_[0]->available_modules
jquery jquery-ui jquery.cookie jquery.checkall jquery.download
jquery/jquery.form jquery/fixes client_js
jquery/jquery.tooltipster.min
- jquery.multiselect2side
common part_selection
), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}");
}
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->{enabled_quick_searchmodules} = \@{$enabled_quick_search};
+ $form->{default_quick_searchmodules} = \@quick_search_modules;
$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();
TODO->save_user_config('login' => $::myconfig{login}, %{ $form->{todo_cfg} || { } });
- 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 ($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}
[%- USE LxERP %]
[%- USE HTML %]
[%- USE L %]
-[% USE Dumper %]
+
<h1>[% title %]</h1>
<form method="post" action="am.pl" name="Form" id="form">
<td colspan=2>
<div class="clearfix">
[% L.select_tag("quick_search_modules[]",
- ENABLED_QUICK_SEARCHMODULES,
+ enabled_quick_searchmodules,
value_key = "name",
title_key = "description_config",
id = "quick_searches",
multiple = 1,
with_empty = 1
- size = ENABLED_QUICK_SEARCHMODULES.size,
- default = DEFAULT_QUICK_SEARCHMODULES) %]
- [% # L.multiselect2side("quick_searches", labelsx=LxERP.t8("All modules"), labeldx=LxERP.t8("Enabled modules")) %]
+ size = enabled_quick_searchmodules.size,
+ default = default_quick_searchmodules) %]
</div>
</td>
</tr>