Merge branch 'b-3.6.1' into mebil
[kivitendo-erp.git] / SL / Helper / UserPreferences / UpdatePositions.pm
1 package SL::Helper::UserPreferences::UpdatePositions;
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_show_update_button {
16   !!$_[0]->user_prefs->get('show_update_button');
17 }
18
19 sub store_show_update_button {
20   $_[0]->user_prefs->store('show_update_button', $_[1]);
21 }
22
23 sub init_user_prefs {
24   SL::Helper::UserPreferences->new(
25     namespace => $_[0]->namespace,
26   )
27 }
28
29 # read only stuff
30 sub namespace     { 'UpdatePositions' }
31 sub version       { 1 }
32
33 1;
34
35 __END__
36
37 =pod
38
39 =encoding utf-8
40
41 =head1 NAME
42
43 SL::Helper::UserPreferences::UpdatePositions - preferences intended
44 to store user settings for displaying an update button for the postions
45 of document forms to update the positions (parts) from master data.
46
47 =head1 SYNOPSIS
48
49   use SL::Helper::UserPreferences::UpdatePositions;
50   my $prefs = SL::Helper::UserPreferences::UpdatePositions->new();
51
52   $prefs->store_show_update_button(1);
53   my $value = $prefs->get_show_update_button;
54
55 =head1 DESCRIPTION
56
57 This module manages storing the user's choise for displaying an update button
58 in the positions area in forms (new order controller).
59
60 =head1 BUGS
61
62 None yet :)
63
64 =head1 AUTHOR
65
66 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>
67
68 =cut