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

(-)a/C4/Log.pm (+9 lines)
Lines 76-81 sub logaction { Link Here
76
    $usernumber ||= 0;
76
    $usernumber ||= 0;
77
    $interface //= C4::Context->interface;
77
    $interface //= C4::Context->interface;
78
78
79
    if ( ref($infos) && ref($infos) !~ /HASH|ARRAY/ && $infos->isa('Koha::Object') ) {
80
        $infos = $infos->get_from_storage if $infos->in_storage;
81
        $infos = Dumper( $infos->unblessed );
82
83
        if ( $infos->isa('Koha::Item') && $modulename eq 'CATALOGUING' && $actionname eq 'MODIFY' ) {
84
            $infos = "item " . $infos;
85
        }
86
    }
87
79
    my $dbh = C4::Context->dbh;
88
    my $dbh = C4::Context->dbh;
80
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (now(),?,?,?,?,?,?)");
89
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (now(),?,?,?,?,?,?)");
81
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos,$interface);
90
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos,$interface);
(-)a/C4/Reserves.pm (-6 / +5 lines)
Lines 46-52 use Koha::Old::Hold; Link Here
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::Plugins;
47
use Koha::Plugins;
48
48
49
use Data::Dumper qw( Dumper );
50
use List::MoreUtils qw( any );
49
use List::MoreUtils qw( any );
51
50
52
=head1 NAME
51
=head1 NAME
Lines 261-267 sub AddReserve { Link Here
261
    )->store();
260
    )->store();
262
    $hold->set_waiting() if $found && $found eq 'W';
261
    $hold->set_waiting() if $found && $found eq 'W';
263
262
264
    logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) )
263
    logaction( 'HOLDS', 'CREATE', $hold->id, $hold )
265
        if C4::Context->preference('HoldsLog');
264
        if C4::Context->preference('HoldsLog');
266
265
267
    my $reserve_id = $hold->id();
266
    my $reserve_id = $hold->id();
Lines 1053-1066 sub ModReserve { Link Here
1053
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1052
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1054
    }
1053
    }
1055
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1054
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1056
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1055
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1057
            if C4::Context->preference('HoldsLog');
1056
            if C4::Context->preference('HoldsLog');
1058
1057
1059
        # The only column that can be updated for a found hold is the expiration date
1058
        # The only column that can be updated for a found hold is the expiration date
1060
        $hold->expirationdate(dt_from_string($date))->store();
1059
        $hold->expirationdate(dt_from_string($date))->store();
1061
    }
1060
    }
1062
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1061
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1063
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1062
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1064
            if C4::Context->preference('HoldsLog');
1063
            if C4::Context->preference('HoldsLog');
1065
1064
1066
        my $properties = {
1065
        my $properties = {
Lines 1122-1128 sub ModReserveFill { Link Here
1122
        }
1121
        }
1123
    );
1122
    );
1124
1123
1125
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1124
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1126
        if C4::Context->preference('HoldsLog');
1125
        if C4::Context->preference('HoldsLog');
1127
1126
1128
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
1127
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
Lines 1250-1256 sub ModReserveAffect { Link Here
1250
    });
1249
    });
1251
    $std->execute($hold->reserve_id);
1250
    $std->execute($hold->reserve_id);
1252
1251
1253
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->get_from_storage->unblessed) )
1252
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1254
        if C4::Context->preference('HoldsLog');
1253
        if C4::Context->preference('HoldsLog');
1255
1254
1256
    return;
1255
    return;
(-)a/Koha/Hold.pm (-5 / +4 lines)
Lines 20-26 package Koha::Hold; Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use Data::Dumper qw( Dumper );
24
use List::MoreUtils qw( any );
23
use List::MoreUtils qw( any );
25
24
26
use C4::Context;
25
use C4::Context;
Lines 113-119 sub suspend_hold { Link Here
113
    $self->suspend_until($date);
112
    $self->suspend_until($date);
114
    $self->store();
113
    $self->store();
115
114
116
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, Dumper( $self->unblessed ) )
115
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, $self )
117
        if C4::Context->preference('HoldsLog');
116
        if C4::Context->preference('HoldsLog');
118
117
119
    return $self;
118
    return $self;
Lines 133-139 sub resume { Link Here
133
132
134
    $self->store();
133
    $self->store();
135
134
136
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, Dumper($self->unblessed) )
135
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, $self )
137
        if C4::Context->preference('HoldsLog');
136
        if C4::Context->preference('HoldsLog');
138
137
139
    return $self;
138
    return $self;
Lines 150-156 sub delete { Link Here
150
149
151
    my $deleted = $self->SUPER::delete($self);
150
    my $deleted = $self->SUPER::delete($self);
152
151
153
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, Dumper($self->unblessed) )
152
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, $self )
154
        if C4::Context->preference('HoldsLog');
153
        if C4::Context->preference('HoldsLog');
155
154
156
    return $deleted;
155
    return $deleted;
Lines 568-574 sub cancel { Link Here
568
                );
567
                );
569
            }
568
            }
570
569
571
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, Dumper($self->unblessed) )
570
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self )
572
                if C4::Context->preference('HoldsLog');
571
                if C4::Context->preference('HoldsLog');
573
        }
572
        }
574
    );
573
    );
(-)a/Koha/Item.pm (-3 / +1 lines)
Lines 20-26 package Koha::Item; Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use List::MoreUtils qw( any );
22
use List::MoreUtils qw( any );
23
use Data::Dumper qw( Dumper );
24
23
25
use Koha::Database;
24
use Koha::Database;
26
use Koha::DateUtils qw( dt_from_string output_pref );
25
use Koha::DateUtils qw( dt_from_string output_pref );
Lines 205-211 sub store { Link Here
205
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
204
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
206
        $action eq 'create'
205
        $action eq 'create'
207
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
206
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
208
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper( $self->unblessed ) );
207
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, $self );
209
    }
208
    }
210
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
209
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
211
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
210
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
212
- 

Return to bug 28692