X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FHelper%2FUserPreferences%2FUpdatePositions.pm;fp=SL%2FHelper%2FUserPreferences%2FUpdatePositions.pm;h=ae06285219af592db138bab313eac2ec954de373;hp=0000000000000000000000000000000000000000;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/SL/Helper/UserPreferences/UpdatePositions.pm b/SL/Helper/UserPreferences/UpdatePositions.pm new file mode 100644 index 000000000..ae0628521 --- /dev/null +++ b/SL/Helper/UserPreferences/UpdatePositions.pm @@ -0,0 +1,68 @@ +package SL::Helper::UserPreferences::UpdatePositions; + +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_show_update_button { + !!$_[0]->user_prefs->get('show_update_button'); +} + +sub store_show_update_button { + $_[0]->user_prefs->store('show_update_button', $_[1]); +} + +sub init_user_prefs { + SL::Helper::UserPreferences->new( + namespace => $_[0]->namespace, + ) +} + +# read only stuff +sub namespace { 'UpdatePositions' } +sub version { 1 } + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +SL::Helper::UserPreferences::UpdatePositions - preferences intended +to store user settings for displaying an update button for the postions +of document forms to update the positions (parts) from master data. + +=head1 SYNOPSIS + + use SL::Helper::UserPreferences::UpdatePositions; + my $prefs = SL::Helper::UserPreferences::UpdatePositions->new(); + + $prefs->store_show_update_button(1); + my $value = $prefs->get_show_update_button; + +=head1 DESCRIPTION + +This module manages storing the user's choise for displaying an update button +in the positions area in forms (new order controller). + +=head1 BUGS + +None yet :) + +=head1 AUTHOR + +Bernd Bleßmann Ebernd@kivitendo-premium.deE + +=cut