From 8946fe2d7f7ea7f4bacd46b47945bebac1d9ab8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 28 Jun 2019 16:24:08 +0200 Subject: [PATCH] UserPreferences-Helper f. Scrollbar-Einstellungen in Belegen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hier kann die Höhe des scrollbaren Postitionsbereichs im neuen Auftrags-Controller abgelegt werden. --- .../UserPreferences/PositionsScrollbar.pm | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 SL/Helper/UserPreferences/PositionsScrollbar.pm diff --git a/SL/Helper/UserPreferences/PositionsScrollbar.pm b/SL/Helper/UserPreferences/PositionsScrollbar.pm new file mode 100644 index 000000000..9d0a338f9 --- /dev/null +++ b/SL/Helper/UserPreferences/PositionsScrollbar.pm @@ -0,0 +1,69 @@ +package SL::Helper::UserPreferences::PositionsScrollbar; + +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_height { + my $value = $_[0]->user_prefs->get('height'); + return !defined($value) ? 25 : $value; +} + +sub store_height { + $_[0]->user_prefs->store('height', $_[1]); +} + +sub init_user_prefs { + SL::Helper::UserPreferences->new( + namespace => $_[0]->namespace, + ) +} + +# read only stuff +sub namespace { 'PositionsScrollbar' } +sub version { 1 } + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +SL::Helper::UserPreferences::PositionsScrollbar - preferences intended +to store user settings for displaying a scrollbar for the postions area +of document forms (it's height). + +=head1 SYNOPSIS + + use SL::Helper::UserPreferences::PositionsScrollbar; + my $prefs = SL::Helper::UserPreferences::PositionsScrollbar->new(); + + $prefs->store_height(75); + my $value = $prefs->get_height; + +=head1 DESCRIPTION + +This module manages storing the height for displaying the scrollbar in the +positions area in forms (new order controller). + +=head1 BUGS + +None yet :) + +=head1 AUTHOR + +Bernd Bleßmann Ebernd@kivitendo-premium.deE + +=cut -- 2.20.1