Lines 18-24
package Koha::Recall;
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
use C4::Letters; |
|
|
22 |
use C4::Members::Messaging; |
22 |
use Koha::Database; |
23 |
use Koha::Database; |
23 |
use Koha::DateUtils qw( dt_from_string ); |
24 |
use Koha::DateUtils qw( dt_from_string ); |
24 |
use Koha::Biblios; |
25 |
use Koha::Biblios; |
Lines 451-456
sub set_cancelled {
Link Here
|
451 |
my ( $self ) = @_; |
452 |
my ( $self ) = @_; |
452 |
$self->update({ status => 'cancelled', completed => 1, completed_date => dt_from_string }); |
453 |
$self->update({ status => 'cancelled', completed => 1, completed_date => dt_from_string }); |
453 |
C4::Log::logaction( 'RECALLS', 'CANCEL', $self->id, "Recall cancelled", 'INTRANET' ) if ( C4::Context->preference('RecallsLog') ); |
454 |
C4::Log::logaction( 'RECALLS', 'CANCEL', $self->id, "Recall cancelled", 'INTRANET' ) if ( C4::Context->preference('RecallsLog') ); |
|
|
455 |
|
456 |
# send notice to recaller to pick up item |
457 |
my $letter = C4::Letters::GetPreparedLetter( |
458 |
module => 'circulation', |
459 |
letter_code => 'RECALL_MANUAL_CANCEL', |
460 |
branchcode => $self->pickup_library_id, |
461 |
lang => $self->patron->lang, |
462 |
tables => { |
463 |
biblio => $self->biblio_id, |
464 |
borrowers => $self->patron_id, |
465 |
branches => $self->pickup_library_id, |
466 |
}, |
467 |
); |
468 |
|
469 |
my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' }); |
470 |
while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) { |
471 |
if ( $transport eq 'email' ){ |
472 |
C4::Message->enqueue($letter, $self->patron->unblessed, 'email'); |
473 |
} |
474 |
if ( $transport eq 'sms' ){ |
475 |
C4::Message->enqueue($letter, $self->patron->unblessed, 'sms'); |
476 |
} |
477 |
} |
478 |
|
454 |
return $self; |
479 |
return $self; |
455 |
} |
480 |
} |
456 |
|
481 |
|