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

(-)a/C4/Log.pm (+11 lines)
Lines 68-73 number is set to 0, which is the same as the superlibrarian's number. Link Here
68
sub logaction {
68
sub logaction {
69
    my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_;
69
    my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_;
70
70
71
    # Do special transformations if $info came as below-known object:
72
    my $varname;
73
    if ( ref $infos eq 'Koha::Hold' ) {
74
        $varname = 'hold';
75
    } elsif ( ref $infos eq 'Koha::Item' ) {
76
        $varname = 'item';
77
    }
78
    if ($varname) {
79
        $infos = Data::Dumper->new( [ $infos->unblessed ], [$varname] )->Indent(0)->Sortkeys(1)->Dump;
80
    }
81
71
    # Get ID of logged in user.  if called from a batch job,
82
    # Get ID of logged in user.  if called from a batch job,
72
    # no user session exists and C4::Context->userenv() returns
83
    # no user session exists and C4::Context->userenv() returns
73
    # the scalar '0'.
84
    # the scalar '0'.
(-)a/C4/Reserves.pm (-4 / +4 lines)
Lines 261-267 sub AddReserve { Link Here
261
    )->store();
261
    )->store();
262
    $hold->set_waiting() if $found && $found eq 'W';
262
    $hold->set_waiting() if $found && $found eq 'W';
263
263
264
    logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) )
264
    logaction( 'HOLDS', 'CREATE', $hold->id, $hold )
265
        if C4::Context->preference('HoldsLog');
265
        if C4::Context->preference('HoldsLog');
266
266
267
    my $reserve_id = $hold->id();
267
    my $reserve_id = $hold->id();
Lines 1060-1066 sub ModReserve { Link Here
1060
        $hold->expirationdate(dt_from_string($date))->store();
1060
        $hold->expirationdate(dt_from_string($date))->store();
1061
    }
1061
    }
1062
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1062
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1063
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1063
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1064
            if C4::Context->preference('HoldsLog');
1064
            if C4::Context->preference('HoldsLog');
1065
1065
1066
        my $properties = {
1066
        my $properties = {
Lines 1122-1128 sub ModReserveFill { Link Here
1122
        }
1122
        }
1123
    );
1123
    );
1124
1124
1125
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1125
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1126
        if C4::Context->preference('HoldsLog');
1126
        if C4::Context->preference('HoldsLog');
1127
1127
1128
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
1128
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
Lines 1250-1256 sub ModReserveAffect { Link Here
1250
    });
1250
    });
1251
    $std->execute($hold->reserve_id);
1251
    $std->execute($hold->reserve_id);
1252
1252
1253
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->get_from_storage->unblessed) )
1253
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold->get_from_storage )
1254
        if C4::Context->preference('HoldsLog');
1254
        if C4::Context->preference('HoldsLog');
1255
1255
1256
    return;
1256
    return;
(-)a/Koha/Hold.pm (-4 / +4 lines)
Lines 113-119 sub suspend_hold { Link Here
113
    $self->suspend_until($date);
113
    $self->suspend_until($date);
114
    $self->store();
114
    $self->store();
115
115
116
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, Dumper( $self->unblessed ) )
116
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, $self )
117
        if C4::Context->preference('HoldsLog');
117
        if C4::Context->preference('HoldsLog');
118
118
119
    return $self;
119
    return $self;
Lines 133-139 sub resume { Link Here
133
133
134
    $self->store();
134
    $self->store();
135
135
136
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, Dumper($self->unblessed) )
136
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, $self )
137
        if C4::Context->preference('HoldsLog');
137
        if C4::Context->preference('HoldsLog');
138
138
139
    return $self;
139
    return $self;
Lines 150-156 sub delete { Link Here
150
150
151
    my $deleted = $self->SUPER::delete($self);
151
    my $deleted = $self->SUPER::delete($self);
152
152
153
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, Dumper($self->unblessed) )
153
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, $self )
154
        if C4::Context->preference('HoldsLog');
154
        if C4::Context->preference('HoldsLog');
155
155
156
    return $deleted;
156
    return $deleted;
Lines 568-574 sub cancel { Link Here
568
                );
568
                );
569
            }
569
            }
570
570
571
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, Dumper($self->unblessed) )
571
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self )
572
                if C4::Context->preference('HoldsLog');
572
                if C4::Context->preference('HoldsLog');
573
        }
573
        }
574
    );
574
    );
(-)a/Koha/Item.pm (-2 / +1 lines)
Lines 202-208 sub store { Link Here
202
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
202
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
203
        $action eq 'create'
203
        $action eq 'create'
204
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
204
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
205
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper( $self->unblessed ) );
205
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, $self );
206
    }
206
    }
207
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
207
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
208
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
208
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
209
- 

Return to bug 28692