Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 549bce5b

Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt

  • ID 549bce5bbdd958e4e9302a777ee223fc79f0211e
  • Vorgänger 0c73b206
  • Nachfolger 4db13ebb

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.

Unterschiede anzeigen:

SL/AM.pm
53 53
use SL::DB;
54 54
use SL::GenericTranslations;
55 55
use SL::Helper::UserPreferences::PositionsScrollbar;
56
use SL::Helper::UserPreferences::PartPickerSearch;
56 57

  
57 58
use strict;
58 59

  
......
532 533
  SL::Helper::UserPreferences::PositionsScrollbar->new()->get_height();
533 534
}
534 535

  
536
sub purchase_search_makemodel {
537
  SL::Helper::UserPreferences::PartPickerSearch->new()->get_purchase_search_makemodel();
538
}
539

  
540
sub sales_search_customer_partnumber {
541
  SL::Helper::UserPreferences::PartPickerSearch->new()->get_sales_search_customer_partnumber();
542
}
543

  
535 544
sub save_preferences {
536 545
  $main::lxdebug->enter_sub();
537 546

  
......
560 569
  if (exists $form->{positions_scrollbar_height}) {
561 570
    SL::Helper::UserPreferences::PositionsScrollbar->new()->store_height($form->{positions_scrollbar_height})
562 571
  }
572
  if (exists $form->{purchase_search_makemodel}) {
573
    SL::Helper::UserPreferences::PartPickerSearch->new()->store_purchase_search_makemodel($form->{purchase_search_makemodel})
574
  }
575
  if (exists $form->{sales_search_customer_partnumber}) {
576
    SL::Helper::UserPreferences::PartPickerSearch->new()->store_sales_search_customer_partnumber($form->{sales_search_customer_partnumber})
577
  }
563 578

  
564 579
  $main::lxdebug->leave_sub();
565 580

  
SL/Helper/UserPreferences/PartPickerSearch.pm
1
package SL::Helper::UserPreferences::PartPickerSearch;
2

  
3
use strict;
4
use parent qw(Rose::Object);
5

  
6
use Carp;
7
use List::MoreUtils qw(none);
8

  
9
use SL::Helper::UserPreferences;
10

  
11
use Rose::Object::MakeMethods::Generic (
12
  'scalar --get_set_init' => [ qw(user_prefs) ],
13
);
14

  
15
sub get_sales_search_customer_partnumber {
16
  !!$_[0]->user_prefs->get('sales_search_customer_partnumber');
17
}
18

  
19
sub get_purchase_search_makemodel {
20
  !!$_[0]->user_prefs->get('purchase_search_makemodel');
21
}
22

  
23
sub store_sales_search_customer_partnumber {
24
  $_[0]->user_prefs->store('sales_search_customer_partnumber', $_[1]);
25
}
26

  
27
sub store_purchase_search_makemodel {
28
  $_[0]->user_prefs->store('purchase_search_makemodel', $_[1]);
29
}
30

  
31
sub init_user_prefs {
32
  SL::Helper::UserPreferences->new(
33
    namespace => $_[0]->namespace,
34
  )
35
}
36

  
37
# read only stuff
38
sub namespace     { 'PartPickerSearch' }
39
sub version       { 1 }
40

  
41
1;
42

  
43
__END__
44

  
45
=pod
46

  
47
=encoding utf-8
48

  
49
=head1 NAME
50

  
51
SL::Helper::UserPreferences::PartPickerSearch - preferences intended
52
to store user settings for the behavior of a partpicker search.
53

  
54
=head1 SYNOPSIS
55

  
56
  use SL::Helper::UserPreferences::PartPickerSearch;
57
  my $prefs = SL::Helper::UserPreferences::PartPickerSearch->new();
58

  
59
  $prefs->store_purchase_search_makemodel(1);
60
  my $value = $prefs->get_purchase_search_makemodel;
61

  
62
=head1 DESCRIPTION
63

  
64
This module manages storing the settings for the part picker to search for
65
customer/vendor partnumber in sales/purchase forms (new order controller).
66

  
67
=head1 BUGS
68

  
69
None yet :)
70

  
71
=head1 AUTHOR
72

  
73
Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>
74

  
75
=cut
bin/mozilla/am.pl
661 661

  
662 662
  $form->{displayable_name_specs_by_module} = AM->displayable_name_specs_by_module();
663 663
  $form->{positions_scrollbar_height}       = AM->positions_scrollbar_height();
664
  $form->{purchase_search_makemodel}        = AM->purchase_search_makemodel();
665
  $form->{sales_search_customer_partnumber} = AM->sales_search_customer_partnumber();
664 666

  
665 667
  $myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details}));
666 668
  $form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password();
locale/de/all
2774 2774
  'Search AR Aging'             => 'Offene Forderungen',
2775 2775
  'Search bank transactions'    => 'Filter für Bankbuchungen',
2776 2776
  'Search contacts'             => 'Personensuche',
2777
  'Search parts by customer partnumber in sales order forms' => 'Artikel nach Kunden-Art.-Nr. in Verkaufsbelegen suchen',
2778
  'Search parts by vendor partnumber (model) in purchase order forms' => 'Artikel nach Lieferanten-Art.-Nr. in Einkaufsbelegen suchen',
2777 2779
  'Search term'                 => 'Suchbegriff',
2778 2780
  'Searchable'                  => 'Durchsuchbar',
2779 2781
  'Secondary sorting'           => 'Untersortierung',
locale/en/all
2774 2774
  'Search AR Aging'             => '',
2775 2775
  'Search bank transactions'    => '',
2776 2776
  'Search contacts'             => '',
2777
  'Search parts by customer partnumber in sales order forms' => '',
2778
  'Search parts by vendor partnumber (model) in purchase order forms' => '',
2777 2779
  'Search term'                 => '',
2778 2780
  'Searchable'                  => '',
2779 2781
  'Secondary sorting'           => '',
templates/webpages/am/config.html
154 154
        [% L.input_tag('positions_scrollbar_height',  positions_scrollbar_height, size = 5) %]
155 155
      </td>
156 156
     </tr>
157
     <tr>
158
      <th align="right">[% 'Search parts by vendor partnumber (model) in purchase order forms' | $T8 %]</th>
159
      <td>
160
        [% L.yes_no_tag('purchase_search_makemodel', purchase_search_makemodel) %]
161
      </td>
162
     </tr>
163
     <tr>
164
      <th align="right">[% 'Search parts by customer partnumber in sales order forms' | $T8 %]</th>
165
      <td>
166
        [% L.yes_no_tag('sales_search_customer_partnumber', sales_search_customer_partnumber) %]
167
      </td>
168
     </tr>
157 169
     [%- END -%]
158 170

  
159 171
     <tr>

Auch abrufbar als: Unified diff