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

(-)a/C4/Log.pm (+11 lines)
Lines 69-74 number is set to 0, which is the same as the superlibrarian's number. Link Here
69
sub logaction {
69
sub logaction {
70
    my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_;
70
    my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_;
71
71
72
    # Do special transformations if $info came as below-known object:
73
    my $varname;
74
    if ( ref $infos eq 'Koha::Hold' ) {
75
        $varname = 'hold';
76
    } elsif ( ref $infos eq 'Koha::Item' ) {
77
        $varname = 'item';
78
    }
79
    if ($varname) {
80
        $infos = Data::Dumper->new( [ $infos->unblessed ], [$varname] )->Indent(0)->Sortkeys(1)->Dump;
81
    }
82
72
    # Get ID of logged in user.  if called from a batch job,
83
    # Get ID of logged in user.  if called from a batch job,
73
    # no user session exists and C4::Context->userenv() returns
84
    # no user session exists and C4::Context->userenv() returns
74
    # the scalar '0'.
85
    # the scalar '0'.
(-)a/C4/Reserves.pm (-4 / +4 lines)
Lines 257-263 sub AddReserve { Link Here
257
    )->store();
257
    )->store();
258
    $hold->set_waiting() if $found && $found eq 'W';
258
    $hold->set_waiting() if $found && $found eq 'W';
259
259
260
    logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) )
260
    logaction( 'HOLDS', 'CREATE', $hold->id, $hold )
261
        if C4::Context->preference('HoldsLog');
261
        if C4::Context->preference('HoldsLog');
262
262
263
    my $reserve_id = $hold->id();
263
    my $reserve_id = $hold->id();
Lines 1046-1052 sub ModReserve { Link Here
1046
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1046
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1047
    }
1047
    }
1048
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1048
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1049
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1049
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1050
            if C4::Context->preference('HoldsLog');
1050
            if C4::Context->preference('HoldsLog');
1051
1051
1052
        my $properties = {
1052
        my $properties = {
Lines 1108-1114 sub ModReserveFill { Link Here
1108
        }
1108
        }
1109
    );
1109
    );
1110
1110
1111
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1111
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1112
        if C4::Context->preference('HoldsLog');
1112
        if C4::Context->preference('HoldsLog');
1113
1113
1114
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
1114
    # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
Lines 1236-1242 sub ModReserveAffect { Link Here
1236
    });
1236
    });
1237
    $std->execute($hold->reserve_id);
1237
    $std->execute($hold->reserve_id);
1238
1238
1239
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->get_from_storage->unblessed) )
1239
    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold->get_from_storage )
1240
        if C4::Context->preference('HoldsLog');
1240
        if C4::Context->preference('HoldsLog');
1241
1241
1242
    return;
1242
    return;
(-)a/Koha/Hold.pm (-4 / +4 lines)
Lines 114-120 sub suspend_hold { Link Here
114
    $self->suspend_until($date);
114
    $self->suspend_until($date);
115
    $self->store();
115
    $self->store();
116
116
117
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, Dumper( $self->unblessed ) )
117
    logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, $self )
118
        if C4::Context->preference('HoldsLog');
118
        if C4::Context->preference('HoldsLog');
119
119
120
    return $self;
120
    return $self;
Lines 134-140 sub resume { Link Here
134
134
135
    $self->store();
135
    $self->store();
136
136
137
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, Dumper($self->unblessed) )
137
    logaction( 'HOLDS', 'RESUME', $self->reserve_id, $self )
138
        if C4::Context->preference('HoldsLog');
138
        if C4::Context->preference('HoldsLog');
139
139
140
    return $self;
140
    return $self;
Lines 151-157 sub delete { Link Here
151
151
152
    my $deleted = $self->SUPER::delete($self);
152
    my $deleted = $self->SUPER::delete($self);
153
153
154
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, Dumper($self->unblessed) )
154
    logaction( 'HOLDS', 'DELETE', $self->reserve_id, $self )
155
        if C4::Context->preference('HoldsLog');
155
        if C4::Context->preference('HoldsLog');
156
156
157
    return $deleted;
157
    return $deleted;
Lines 569-575 sub cancel { Link Here
569
                );
569
                );
570
            }
570
            }
571
571
572
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, Dumper($self->unblessed) )
572
            C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self )
573
                if C4::Context->preference('HoldsLog');
573
                if C4::Context->preference('HoldsLog');
574
        }
574
        }
575
    );
575
    );
(-)a/Koha/Item.pm (-2 / +1 lines)
Lines 203-209 sub store { Link Here
203
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
203
    if ( $log_action && C4::Context->preference("CataloguingLog") ) {
204
        $action eq 'create'
204
        $action eq 'create'
205
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
205
          ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
206
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper( $self->unblessed ) );
206
          : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . $self );
207
    }
207
    }
208
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
208
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
209
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
209
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
210
- 

Return to bug 28692