From: Bernd Bleßmann Date: Fri, 19 Jul 2019 13:45:46 +0000 (+0200) Subject: UserPreferences-Helper f. Part-Picker-Such-Einstellungen in Belegen X-Git-Tag: release-3.5.6.1~548 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=549bce5bbdd958e4e9302a777ee223fc79f0211e;p=kivitendo-erp.git UserPreferences-Helper f. Part-Picker-Such-Einstellungen in Belegen Hier kann der Benutzer einstellen, ob in Verkauf auch nach Kunden-Artikle-Nr. und im Einkauf nach Lieferanten-Artikel-Nr. gesucht werden soll. --- diff --git a/SL/AM.pm b/SL/AM.pm index a98101724..a2ae7d59c 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -53,6 +53,7 @@ use SL::DB::Vendor; use SL::DB; use SL::GenericTranslations; use SL::Helper::UserPreferences::PositionsScrollbar; +use SL::Helper::UserPreferences::PartPickerSearch; use strict; @@ -532,6 +533,14 @@ sub positions_scrollbar_height { SL::Helper::UserPreferences::PositionsScrollbar->new()->get_height(); } +sub purchase_search_makemodel { + SL::Helper::UserPreferences::PartPickerSearch->new()->get_purchase_search_makemodel(); +} + +sub sales_search_customer_partnumber { + SL::Helper::UserPreferences::PartPickerSearch->new()->get_sales_search_customer_partnumber(); +} + sub save_preferences { $main::lxdebug->enter_sub(); @@ -560,6 +569,12 @@ sub save_preferences { if (exists $form->{positions_scrollbar_height}) { SL::Helper::UserPreferences::PositionsScrollbar->new()->store_height($form->{positions_scrollbar_height}) } + if (exists $form->{purchase_search_makemodel}) { + SL::Helper::UserPreferences::PartPickerSearch->new()->store_purchase_search_makemodel($form->{purchase_search_makemodel}) + } + if (exists $form->{sales_search_customer_partnumber}) { + SL::Helper::UserPreferences::PartPickerSearch->new()->store_sales_search_customer_partnumber($form->{sales_search_customer_partnumber}) + } $main::lxdebug->leave_sub(); diff --git a/SL/Helper/UserPreferences/PartPickerSearch.pm b/SL/Helper/UserPreferences/PartPickerSearch.pm new file mode 100644 index 000000000..7d4821d0c --- /dev/null +++ b/SL/Helper/UserPreferences/PartPickerSearch.pm @@ -0,0 +1,75 @@ +package SL::Helper::UserPreferences::PartPickerSearch; + +use strict; +use parent qw(Rose::Object); + +use Carp; +use List::MoreUtils qw(none); + +use SL::Helper::UserPreferences; + +use Rose::Object::MakeMethods::Generic ( + 'scalar --get_set_init' => [ qw(user_prefs) ], +); + +sub get_sales_search_customer_partnumber { + !!$_[0]->user_prefs->get('sales_search_customer_partnumber'); +} + +sub get_purchase_search_makemodel { + !!$_[0]->user_prefs->get('purchase_search_makemodel'); +} + +sub store_sales_search_customer_partnumber { + $_[0]->user_prefs->store('sales_search_customer_partnumber', $_[1]); +} + +sub store_purchase_search_makemodel { + $_[0]->user_prefs->store('purchase_search_makemodel', $_[1]); +} + +sub init_user_prefs { + SL::Helper::UserPreferences->new( + namespace => $_[0]->namespace, + ) +} + +# read only stuff +sub namespace { 'PartPickerSearch' } +sub version { 1 } + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +SL::Helper::UserPreferences::PartPickerSearch - preferences intended +to store user settings for the behavior of a partpicker search. + +=head1 SYNOPSIS + + use SL::Helper::UserPreferences::PartPickerSearch; + my $prefs = SL::Helper::UserPreferences::PartPickerSearch->new(); + + $prefs->store_purchase_search_makemodel(1); + my $value = $prefs->get_purchase_search_makemodel; + +=head1 DESCRIPTION + +This module manages storing the settings for the part picker to search for +customer/vendor partnumber in sales/purchase forms (new order controller). + +=head1 BUGS + +None yet :) + +=head1 AUTHOR + +Bernd Bleßmann Ebernd@kivitendo-premium.deE + +=cut diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index fa7f092af..f2987b61f 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -661,6 +661,8 @@ sub config { $form->{displayable_name_specs_by_module} = AM->displayable_name_specs_by_module(); $form->{positions_scrollbar_height} = AM->positions_scrollbar_height(); + $form->{purchase_search_makemodel} = AM->purchase_search_makemodel(); + $form->{sales_search_customer_partnumber} = AM->sales_search_customer_partnumber(); $myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); $form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); diff --git a/locale/de/all b/locale/de/all index 771d5c84a..59e6c764f 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2774,6 +2774,8 @@ $self->{texts} = { 'Search AR Aging' => 'Offene Forderungen', 'Search bank transactions' => 'Filter für Bankbuchungen', 'Search contacts' => 'Personensuche', + 'Search parts by customer partnumber in sales order forms' => 'Artikel nach Kunden-Art.-Nr. in Verkaufsbelegen suchen', + 'Search parts by vendor partnumber (model) in purchase order forms' => 'Artikel nach Lieferanten-Art.-Nr. in Einkaufsbelegen suchen', 'Search term' => 'Suchbegriff', 'Searchable' => 'Durchsuchbar', 'Secondary sorting' => 'Untersortierung', diff --git a/locale/en/all b/locale/en/all index acabd2484..303ce94c5 100644 --- a/locale/en/all +++ b/locale/en/all @@ -2774,6 +2774,8 @@ $self->{texts} = { 'Search AR Aging' => '', 'Search bank transactions' => '', 'Search contacts' => '', + 'Search parts by customer partnumber in sales order forms' => '', + 'Search parts by vendor partnumber (model) in purchase order forms' => '', 'Search term' => '', 'Searchable' => '', 'Secondary sorting' => '', diff --git a/templates/webpages/am/config.html b/templates/webpages/am/config.html index 6f5dea74b..06c58f120 100644 --- a/templates/webpages/am/config.html +++ b/templates/webpages/am/config.html @@ -154,6 +154,18 @@ [% L.input_tag('positions_scrollbar_height', positions_scrollbar_height, size = 5) %] + + [% 'Search parts by vendor partnumber (model) in purchase order forms' | $T8 %] + + [% L.yes_no_tag('purchase_search_makemodel', purchase_search_makemodel) %] + + + + [% 'Search parts by customer partnumber in sales order forms' | $T8 %] + + [% L.yes_no_tag('sales_search_customer_partnumber', sales_search_customer_partnumber) %] + + [%- END -%]