Über UserPreferences, allerdings wird die Mandantenkonfiguration (quick_search_modules) nicht
berücksichtigt. Der Benutzer hat alle Schnellsuchen zur Verfügung.
Das L.multiselect2side macht Probleme deswegen auskommeniert. Wenn aktiv wird das
Emailsignaturfeld m Tab "Persönliche Einstellungen" doppelt angezeigt,
beide Felder und Links (Signatur bearbeiten und volle Signatur prüfen) sind sichtbar.
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) ],
}
sub enabled_modules {
- my %enabled_names = map {
- $_ => 1
- } @{ $::instance_conf->get_quick_search_modules };
+ my $user_prefs = SL::Helper::UserPreferences->new(
+ namespace => 'TopQuickSearch',
+ );
+
+ my %enabled_names;
+ if ($user_prefs) {
+ my $prefs_val = $user_prefs->get('quick_search_modules');
+ my @quick_search_modules = split ',', $prefs_val;
+
+ %enabled_names = map {
+ $_ => 1
+ } @quick_search_modules ;
+ } else {
+ %enabled_names = map {
+ $_ => 1
+ } @{ $::instance_conf->get_quick_search_modules };
+ }
grep {
$enabled_names{$_->name}
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}");
use SL::CA;
use SL::Form;
use SL::Helper::Flash;
+use SL::Helper::UserPreferences;
use SL::User;
use SL::USTVA;
use SL::Iconv;
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));
};
}
+ 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;
+
$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}) };
$form->{title} = $locale->text('Edit Preferences for #1', $::myconfig{login});
setup_am_config_action_bar();
-
$form->header();
$form->{full_signature} = $form->create_email_signature();
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 (AM->save_preferences($form)) {
if ($::auth->can_change_password()
&& defined $form->{new_password}
'Query parameters' => 'Abfrageparameter',
'Queue' => 'Warteschlange',
'Quick Search' => 'Schnellsuche',
+ 'Quick Searches that will be shown in the header for this user' => 'Schnellsuchen, die in der Kopfzeile gezeigt werden sollen',
'Quick Searches that will be shown in the header in this client' => 'Schnellsuchen, die in der Kopfzeile in diesem Mandanten gezeigt werden sollen',
'Quotation' => 'Angebot',
'Quotation Date' => 'Angebotsdatum',
[%- USE T8 %]
[%- USE LxERP %]
-[%- USE HTML %][%- USE L %]
+[%- USE HTML %]
+[%- USE L %]
+[% USE Dumper %]
<h1>[% title %]</h1>
<form method="post" action="am.pl" name="Form" id="form">
[% L.input_tag('form_cvars_nr_cols', MYCONFIG.form_cvars_nr_cols || 3, size = 5) %]
</td>
</tr>
-
+ <tr>
+ <th align="right">[% 'Quick Searches that will be shown in the header for this user' | $T8 %]</th>
+ <td colspan=2>
+ <div class="clearfix">
+ [% L.select_tag("quick_search_modules[]",
+ ENABLED_QUICK_SEARCHMODULES,
+ value_key = "name",
+ title_key = "description_config",
+ id = "quick_searches",
+ multiple = 1,
+ size = ENABLED_QUICK_SEARCHMODULES.size,
+ default = DEFAULT_QUICK_SEARCHMODULES) %]
+ [% # L.multiselect2side("quick_searches", labelsx=LxERP.t8("All modules"), labeldx=LxERP.t8("Enabled modules")) %]
+ </div>
+ </td>
+ </tr>
</table>
</div>