|
Lines 92-97
my $hold = $hold->suspend_hold( $suspend_until );
Link Here
|
| 92 |
sub suspend_hold { |
92 |
sub suspend_hold { |
| 93 |
my ( $self, $date ) = @_; |
93 |
my ( $self, $date ) = @_; |
| 94 |
|
94 |
|
|
|
95 |
my $original = C4::Context->preference('HoldsLog') ? $self->unblessed : undef; |
| 96 |
|
| 95 |
$date &&= dt_from_string($date)->truncate( to => 'day' )->datetime; |
97 |
$date &&= dt_from_string($date)->truncate( to => 'day' )->datetime; |
| 96 |
|
98 |
|
| 97 |
if ( $self->is_found ) { # We can't suspend found holds |
99 |
if ( $self->is_found ) { # We can't suspend found holds |
|
Lines 126-132
sub suspend_hold {
Link Here
|
| 126 |
} |
128 |
} |
| 127 |
); |
129 |
); |
| 128 |
|
130 |
|
| 129 |
logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, $self ) |
131 |
logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, $self, undef, $original ) |
| 130 |
if C4::Context->preference('HoldsLog'); |
132 |
if C4::Context->preference('HoldsLog'); |
| 131 |
|
133 |
|
| 132 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
134 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
|
Lines 147-152
my $hold = $hold->resume();
Link Here
|
| 147 |
sub resume { |
149 |
sub resume { |
| 148 |
my ( $self ) = @_; |
150 |
my ( $self ) = @_; |
| 149 |
|
151 |
|
|
|
152 |
my $original = C4::Context->preference('HoldsLog') ? $self->unblessed : undef; |
| 153 |
|
| 150 |
$self->suspend(0); |
154 |
$self->suspend(0); |
| 151 |
$self->suspend_until( undef ); |
155 |
$self->suspend_until( undef ); |
| 152 |
|
156 |
|
|
Lines 160-166
sub resume {
Link Here
|
| 160 |
} |
164 |
} |
| 161 |
); |
165 |
); |
| 162 |
|
166 |
|
| 163 |
logaction( 'HOLDS', 'RESUME', $self->reserve_id, $self ) |
167 |
logaction( 'HOLDS', 'RESUME', $self->reserve_id, $self, undef, $original ) |
| 164 |
if C4::Context->preference('HoldsLog'); |
168 |
if C4::Context->preference('HoldsLog'); |
| 165 |
|
169 |
|
| 166 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
170 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
|
Lines 697-702
sub cancel {
Link Here
|
| 697 |
|
701 |
|
| 698 |
my $autofill_next = $params->{autofill} && $self->itemnumber && $self->found && $self->found eq 'W'; |
702 |
my $autofill_next = $params->{autofill} && $self->itemnumber && $self->found && $self->found eq 'W'; |
| 699 |
|
703 |
|
|
|
704 |
my $original = C4::Context->preference('HoldsLog') ? $self->unblessed : undef; |
| 705 |
|
| 700 |
$self->_result->result_source->schema->txn_do( |
706 |
$self->_result->result_source->schema->txn_do( |
| 701 |
sub { |
707 |
sub { |
| 702 |
my $patron = $self->patron; |
708 |
my $patron = $self->patron; |
|
Lines 784-790
sub cancel {
Link Here
|
| 784 |
); |
790 |
); |
| 785 |
} |
791 |
} |
| 786 |
|
792 |
|
| 787 |
C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self ) |
793 |
C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self, undef, $original ) |
| 788 |
if C4::Context->preference('HoldsLog'); |
794 |
if C4::Context->preference('HoldsLog'); |
| 789 |
|
795 |
|
| 790 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
796 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
|
Lines 824-829
sub fill {
Link Here
|
| 824 |
sub { |
830 |
sub { |
| 825 |
my $patron = $self->patron; |
831 |
my $patron = $self->patron; |
| 826 |
|
832 |
|
|
|
833 |
my $original = C4::Context->preference('HoldsLog') ? $self->unblessed : undef; |
| 834 |
|
| 827 |
$self->set( |
835 |
$self->set( |
| 828 |
{ |
836 |
{ |
| 829 |
found => 'F', |
837 |
found => 'F', |
|
Lines 868-874
sub fill {
Link Here
|
| 868 |
} |
876 |
} |
| 869 |
} |
877 |
} |
| 870 |
|
878 |
|
| 871 |
C4::Log::logaction( 'HOLDS', 'FILL', $self->id, $self ) |
879 |
C4::Log::logaction( 'HOLDS', 'FILL', $self->id, $self, undef, $original ) |
| 872 |
if C4::Context->preference('HoldsLog'); |
880 |
if C4::Context->preference('HoldsLog'); |
| 873 |
|
881 |
|
| 874 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
882 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
| 875 |
- |
|
|