View | Details | Raw Unified | Return to bug 14642
Collapse All | Expand All

(-)a/C4/Log.pm (+1 lines)
Lines 139-144 sub GetLogStatus { Link Here
139
    my %hash;
139
    my %hash;
140
    $hash{BorrowersLog}    = C4::Context->preference("BorrowersLog");
140
    $hash{BorrowersLog}    = C4::Context->preference("BorrowersLog");
141
    $hash{CataloguingLog}  = C4::Context->preference("CataloguingLog");
141
    $hash{CataloguingLog}  = C4::Context->preference("CataloguingLog");
142
    $hash{HoldsLog}        = C4::Context->preference("HoldsLog");
142
    $hash{IssueLog}        = C4::Context->preference("IssueLog");
143
    $hash{IssueLog}        = C4::Context->preference("IssueLog");
143
    $hash{ReturnLog}       = C4::Context->preference("ReturnLog");
144
    $hash{ReturnLog}       = C4::Context->preference("ReturnLog");
144
    $hash{SubscriptionLog} = C4::Context->preference("SubscriptionLog");
145
    $hash{SubscriptionLog} = C4::Context->preference("SubscriptionLog");
(-)a/C4/Reserves.pm (+13 lines)
Lines 34-39 use C4::Accounts; Link Here
34
use C4::Members::Messaging;
34
use C4::Members::Messaging;
35
use C4::Members qw();
35
use C4::Members qw();
36
use C4::Letters;
36
use C4::Letters;
37
use C4::Log;
37
38
38
use Koha::DateUtils;
39
use Koha::DateUtils;
39
use Koha::Calendar;
40
use Koha::Calendar;
Lines 46-51 use Koha::ItemTypes; Link Here
46
47
47
use List::MoreUtils qw( firstidx any );
48
use List::MoreUtils qw( firstidx any );
48
use Carp;
49
use Carp;
50
use Data::Dumper;
49
51
50
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
52
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
51
53
Lines 212-217 sub AddReserve { Link Here
212
            itemtype       => $itemtype,
214
            itemtype       => $itemtype,
213
        }
215
        }
214
    )->store();
216
    )->store();
217
218
    logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) )
219
        if C4::Context->preference('HoldsLog');
220
215
    my $reserve_id = $hold->id();
221
    my $reserve_id = $hold->id();
216
222
217
    # add a reserve fee if needed
223
    # add a reserve fee if needed
Lines 1070-1075 sub CancelReserve { Link Here
1070
1076
1071
    my $reserve = GetReserve( $reserve_id );
1077
    my $reserve = GetReserve( $reserve_id );
1072
    if ($reserve) {
1078
    if ($reserve) {
1079
1080
        my $hold = Koha::Holds->find( $reserve_id );
1081
        logaction( 'HOLDS', 'CANCEL', $hold->reserve_id, Dumper($hold->unblessed) )
1082
            if C4::Context->preference('HoldsLog');
1083
1073
        my $query = "
1084
        my $query = "
1074
            UPDATE reserves
1085
            UPDATE reserves
1075
            SET    cancellationdate = now(),
1086
            SET    cancellationdate = now(),
Lines 1166-1171 sub ModReserve { Link Here
1166
    }
1177
    }
1167
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1178
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1168
        my $hold = Koha::Holds->find($reserve_id);
1179
        my $hold = Koha::Holds->find($reserve_id);
1180
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1181
            if C4::Context->preference('HoldsLog');
1169
1182
1170
        $hold->set(
1183
        $hold->set(
1171
            {
1184
            {
(-)a/Koha/Hold.pm (+23 lines)
Lines 20-27 package Koha::Hold; Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Carp;
22
use Carp;
23
use Data::Dumper qw(Dumper);
23
24
24
use C4::Context qw(preference);
25
use C4::Context qw(preference);
26
use C4::Log;
25
27
26
use Koha::DateUtils qw(dt_from_string);
28
use Koha::DateUtils qw(dt_from_string);
27
use Koha::Patrons;
29
use Koha::Patrons;
Lines 62-67 sub suspend_hold { Link Here
62
64
63
    $self->store();
65
    $self->store();
64
66
67
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, Dumper($self->unblessed) )
68
        if C4::Context->preference('HoldsLog');
69
65
    return $self;
70
    return $self;
66
}
71
}
67
72
Lines 79-87 sub resume { Link Here
79
84
80
    $self->store();
85
    $self->store();
81
86
87
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, Dumper($self->unblessed) )
88
        if C4::Context->preference('HoldsLog');
89
82
    return $self;
90
    return $self;
83
}
91
}
84
92
93
=head3 delete
94
95
$hold->delete();
96
97
=cut
98
99
sub delete {
100
    my ( $self ) = @_;
101
102
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, Dumper($self->unblessed) )
103
        if C4::Context->preference('HoldsLog');
104
105
    return $self->SUPER::delete($self);
106
}
107
85
=head3 waiting_expires_on
108
=head3 waiting_expires_on
86
109
87
Returns a DateTime for the date a waiting holds expires on.
110
Returns a DateTime for the date a waiting holds expires on.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-2 / +6 lines)
Lines 23-28 Link Here
23
[%        CASE 'MEMBERS'      %]Patrons
23
[%        CASE 'MEMBERS'      %]Patrons
24
[%        CASE 'ACQUISITIONS' %]Acquisitions
24
[%        CASE 'ACQUISITIONS' %]Acquisitions
25
[%        CASE 'SERIAL'       %]Serials
25
[%        CASE 'SERIAL'       %]Serials
26
[%        CASE 'HOLDS'        %]Holds
26
[%        CASE 'CIRCULATION'  %]Circulation
27
[%        CASE 'CIRCULATION'  %]Circulation
27
[%        CASE 'LETTER'       %]Letter
28
[%        CASE 'LETTER'       %]Letter
28
[%        CASE 'FINES'        %]Fines
29
[%        CASE 'FINES'        %]Fines
Lines 41-46 Link Here
41
[%        CASE 'ISSUE'  %]Checkout
42
[%        CASE 'ISSUE'  %]Checkout
42
[%        CASE 'RETURN' %]Return
43
[%        CASE 'RETURN' %]Return
43
[%        CASE 'CREATE' %]Create
44
[%        CASE 'CREATE' %]Create
45
[%        CASE 'CANCEL' %]Cancel
46
[%        CASE 'RESUME' %]Resume
47
[%        CASE 'SUSPEND' %]Suspend
44
[%        CASE 'RENEW'  %]Renew
48
[%        CASE 'RENEW'  %]Renew
45
[%        CASE 'CHANGE PASS' %]Change password
49
[%        CASE 'CHANGE PASS' %]Change password
46
[%        CASE 'ADDCIRCMESSAGE' %]Add circulation message
50
[%        CASE 'ADDCIRCMESSAGE' %]Add circulation message
Lines 84-90 Link Here
84
                                    [% ELSE %]
88
                                    [% ELSE %]
85
                                        <option value="">All</option>
89
                                        <option value="">All</option>
86
                                    [% END %]
90
                                    [% END %]
87
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
91
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
88
                                        [% IF modules.grep(modx).size %]
92
                                        [% IF modules.grep(modx).size %]
89
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
93
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
90
                                        [% ELSE %]
94
                                        [% ELSE %]
Lines 102-108 Link Here
102
                                        <option value="">All</option>
106
                                        <option value="">All</option>
103
                                    [% END %]
107
                                    [% END %]
104
108
105
                                    [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'CHANGE PASS' 'Run' ] %]
109
                                    [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'CHANGE PASS' 'Run' ] %]
106
                                        [% IF actions.grep(actx).size %]
110
                                        [% IF actions.grep(actx).size %]
107
                                            <option value="[% actx %]" selected="selected">[% PROCESS translate_log_action action=actx %]</option>
111
                                            <option value="[% actx %]" selected="selected">[% PROCESS translate_log_action action=actx %]</option>
108
                                        [% ELSE %]
112
                                        [% ELSE %]
(-)a/opac/opac-reserve.pl (-3 / +2 lines)
Lines 18-25 Link Here
18
# You should have received a copy of the GNU General Public License
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
20
21
use strict;
21
use Modern::Perl;
22
use warnings;
22
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use C4::Auth;    # checkauth, getborrowernumber.
24
use C4::Auth;    # checkauth, getborrowernumber.
25
use C4::Koha;
25
use C4::Koha;
26
- 

Return to bug 14642