Revision 2fe6237c
Von Werner Hahn vor etwa 6 Jahren hinzugefügt
SL/Controller/TopQuickSearch.pm | ||
---|---|---|
6 | 6 |
use SL::ClientJS; |
7 | 7 |
use SL::JSON; |
8 | 8 |
use SL::Locale::String qw(t8); |
9 |
use SL::Helper::UserPreferences; |
|
9 | 10 |
|
10 | 11 |
use Rose::Object::MakeMethods::Generic ( |
11 | 12 |
'scalar --get_set_init' => [ qw(module js) ], |
... | ... | |
65 | 66 |
} |
66 | 67 |
|
67 | 68 |
sub enabled_modules { |
68 |
my %enabled_names = map { |
|
69 |
$_ => 1 |
|
70 |
} @{ $::instance_conf->get_quick_search_modules }; |
|
69 |
my $user_prefs = SL::Helper::UserPreferences->new( |
|
70 |
namespace => 'TopQuickSearch', |
|
71 |
); |
|
72 |
|
|
73 |
my %enabled_names; |
|
74 |
if ($user_prefs) { |
|
75 |
my $prefs_val = $user_prefs->get('quick_search_modules'); |
|
76 |
my @quick_search_modules = split ',', $prefs_val; |
|
77 |
|
|
78 |
%enabled_names = map { |
|
79 |
$_ => 1 |
|
80 |
} @quick_search_modules ; |
|
81 |
} else { |
|
82 |
%enabled_names = map { |
|
83 |
$_ => 1 |
|
84 |
} @{ $::instance_conf->get_quick_search_modules }; |
|
85 |
} |
|
71 | 86 |
|
72 | 87 |
grep { |
73 | 88 |
$enabled_names{$_->name} |
SL/Form.pm | ||
---|---|---|
434 | 434 |
jquery jquery-ui jquery.cookie jquery.checkall jquery.download |
435 | 435 |
jquery/jquery.form jquery/fixes client_js |
436 | 436 |
jquery/jquery.tooltipster.min |
437 |
jquery.multiselect2side |
|
437 | 438 |
common part_selection |
438 | 439 |
), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); |
439 | 440 |
|
bin/mozilla/am.pl | ||
---|---|---|
42 | 42 |
use SL::CA; |
43 | 43 |
use SL::Form; |
44 | 44 |
use SL::Helper::Flash; |
45 |
use SL::Helper::UserPreferences; |
|
45 | 46 |
use SL::User; |
46 | 47 |
use SL::USTVA; |
47 | 48 |
use SL::Iconv; |
... | ... | |
573 | 574 |
my $form = $main::form; |
574 | 575 |
my %myconfig = %main::myconfig; |
575 | 576 |
my $locale = $main::locale; |
577 |
my $defaults = SL::DB::Default->get; |
|
576 | 578 |
|
577 | 579 |
_build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); |
578 | 580 |
_build_cfg_options('timeformat', qw(hh:mm hh:mm:ss)); |
... | ... | |
643 | 645 |
}; |
644 | 646 |
} |
645 | 647 |
|
648 |
my $user_prefs = SL::Helper::UserPreferences->new( |
|
649 |
namespace => 'TopQuickSearch', |
|
650 |
); |
|
651 |
my $prefs_val; |
|
652 |
my @quick_search_modules; |
|
653 |
if ($user_prefs) { |
|
654 |
$prefs_val = $user_prefs->get('quick_search_modules'); |
|
655 |
@quick_search_modules = split ',', $prefs_val; |
|
656 |
} |
|
657 |
|
|
658 |
my $enabled_quick_search = [ SL::Controller::TopQuickSearch->new->available_modules ]; |
|
659 |
$form->{ENABLED_QUICK_SEARCHMODULES} = \@{$enabled_quick_search}; |
|
660 |
$form->{DEFAULT_QUICK_SEARCHMODULES} = \@quick_search_modules; |
|
661 |
|
|
646 | 662 |
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); |
647 | 663 |
$form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); |
648 | 664 |
$form->{todo_cfg} = { TODO->get_user_config('login' => $::myconfig{login}) }; |
... | ... | |
650 | 666 |
$form->{title} = $locale->text('Edit Preferences for #1', $::myconfig{login}); |
651 | 667 |
|
652 | 668 |
setup_am_config_action_bar(); |
653 |
|
|
654 | 669 |
$form->header(); |
655 | 670 |
|
656 | 671 |
$form->{full_signature} = $form->create_email_signature(); |
... | ... | |
671 | 686 |
|
672 | 687 |
TODO->save_user_config('login' => $::myconfig{login}, %{ $form->{todo_cfg} || { } }); |
673 | 688 |
|
689 |
my $user_prefs = SL::Helper::UserPreferences->new( |
|
690 |
namespace => 'TopQuickSearch', |
|
691 |
); |
|
692 |
my $quick_search_modules = join ',', @{$form->{quick_search_modules}}; |
|
693 |
$user_prefs->store('quick_search_modules', $quick_search_modules); |
|
694 |
|
|
674 | 695 |
if (AM->save_preferences($form)) { |
675 | 696 |
if ($::auth->can_change_password() |
676 | 697 |
&& defined $form->{new_password} |
locale/de/all | ||
---|---|---|
2472 | 2472 |
'Query parameters' => 'Abfrageparameter', |
2473 | 2473 |
'Queue' => 'Warteschlange', |
2474 | 2474 |
'Quick Search' => 'Schnellsuche', |
2475 |
'Quick Searches that will be shown in the header for this user' => 'Schnellsuchen, die in der Kopfzeile gezeigt werden sollen', |
|
2475 | 2476 |
'Quick Searches that will be shown in the header in this client' => 'Schnellsuchen, die in der Kopfzeile in diesem Mandanten gezeigt werden sollen', |
2476 | 2477 |
'Quotation' => 'Angebot', |
2477 | 2478 |
'Quotation Date' => 'Angebotsdatum', |
templates/webpages/am/config.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE LxERP %] |
3 |
[%- USE HTML %][%- USE L %] |
|
3 |
[%- USE HTML %] |
|
4 |
[%- USE L %] |
|
5 |
[% USE Dumper %] |
|
4 | 6 |
<h1>[% title %]</h1> |
5 | 7 |
|
6 | 8 |
<form method="post" action="am.pl" name="Form" id="form"> |
... | ... | |
161 | 163 |
[% L.input_tag('form_cvars_nr_cols', MYCONFIG.form_cvars_nr_cols || 3, size = 5) %] |
162 | 164 |
</td> |
163 | 165 |
</tr> |
164 |
|
|
166 |
<tr> |
|
167 |
<th align="right">[% 'Quick Searches that will be shown in the header for this user' | $T8 %]</th> |
|
168 |
<td colspan=2> |
|
169 |
<div class="clearfix"> |
|
170 |
[% L.select_tag("quick_search_modules[]", |
|
171 |
ENABLED_QUICK_SEARCHMODULES, |
|
172 |
value_key = "name", |
|
173 |
title_key = "description_config", |
|
174 |
id = "quick_searches", |
|
175 |
multiple = 1, |
|
176 |
size = ENABLED_QUICK_SEARCHMODULES.size, |
|
177 |
default = DEFAULT_QUICK_SEARCHMODULES) %] |
|
178 |
[% # L.multiselect2side("quick_searches", labelsx=LxERP.t8("All modules"), labeldx=LxERP.t8("Enabled modules")) %] |
|
179 |
</div> |
|
180 |
</td> |
|
181 |
</tr> |
|
165 | 182 |
</table> |
166 | 183 |
</div> |
167 | 184 |
|
Auch abrufbar als: Unified diff
TopQuickSearch für den Benutzer konfigurierbar gemacht.
Ü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.