Lines 361-369
sub transfer_ownership {
Link Here
|
361 |
unless $patron_id; |
361 |
unless $patron_id; |
362 |
|
362 |
|
363 |
## before we change the owner, collect some details |
363 |
## before we change the owner, collect some details |
364 |
my $old_owner = Koha::Patrons->find( $self->owner ); |
364 |
my $old_owner = Koha::Patrons->find( $self->owner ); |
365 |
my $new_owner = Koha::Patrons->find($patron_id); |
365 |
my $new_owner = Koha::Patrons->find($patron_id); |
366 |
my $library = $new_owner->library->unblessed; |
366 |
my $userenv = C4::Context->userenv; |
|
|
367 |
my $branchcode = $userenv->{branch}; |
367 |
|
368 |
|
368 |
## first we change the owner |
369 |
## first we change the owner |
369 |
$self->remove_share($patron_id) if $self->is_private; |
370 |
$self->remove_share($patron_id) if $self->is_private; |
Lines 373-388
sub transfer_ownership {
Link Here
|
373 |
my $letter = C4::Letters::GetPreparedLetter( |
374 |
my $letter = C4::Letters::GetPreparedLetter( |
374 |
module => 'lists', |
375 |
module => 'lists', |
375 |
letter_code => 'TRANSFER_OWNERSHIP', |
376 |
letter_code => 'TRANSFER_OWNERSHIP', |
376 |
branchcode => $library->{branchcode}, |
377 |
branchcode => $branchcode, |
377 |
lang => $new_owner->lang || 'default', |
378 |
lang => $new_owner->lang || 'default', |
378 |
objects => { |
379 |
objects => { |
379 |
old_owner => $old_owner, |
380 |
old_owner => $old_owner, |
380 |
new_owner => $new_owner, |
381 |
owner => $new_owner, |
381 |
shelf => $self, |
382 |
shelf => $self, |
382 |
}, |
383 |
}, |
383 |
tables => { |
384 |
want_librarian => 1, |
384 |
'branches' => $library->{branchcode}, |
|
|
385 |
}, |
386 |
message_transport_type => 'email', |
385 |
message_transport_type => 'email', |
387 |
); |
386 |
); |
388 |
|
387 |
|