7686a7cd56c4c3034519c152b1fbd66769345596
[kivitendo-erp.git] / SL / Helper / UserPreferences / TimeRecording.pm
1 package SL::Helper::UserPreferences::TimeRecording;
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_use_duration {
16   !!$_[0]->user_prefs->get('use_duration');
17 }
18
19 sub store_use_duration {
20   $_[0]->user_prefs->store('use_duration', $_[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     { 'TimeRecording' }
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::TimeRecording - preferences intended
44 to store user settings for using the time recording functionality.
45
46 =head1 SYNOPSIS
47
48   use SL::Helper::UserPreferences::TimeRecording;
49   my $prefs = SL::Helper::UserPreferences::TimeRecording->new();
50
51   $prefs->store_use_duration(1);
52   my $value = $prefs->get_use_duration;
53
54 =head1 DESCRIPTION
55
56 This module manages storing the user's choise for settings for
57 the time recording controller.
58 For now it can be choosen if an entry is done by entering start and
59 end time or a date and a duration.
60
61 =head1 BUGS
62
63 None yet :)
64
65 =head1 AUTHOR
66
67 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>
68
69 =cut