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

(-)a/Koha/Virtualshelf.pm (-8 / +7 lines)
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
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-3 / +3 lines)
Lines 1314-1323 tables: Link Here
1314
          message_transport_type: email
1314
          message_transport_type: email
1315
          lang: default
1315
          lang: default
1316
          content:
1316
          content:
1317
            - "Dear [%- INCLUDE 'patron-title.inc' patron => new_owner -%],<br>"
1317
            - "Dear [%- INCLUDE 'patron-title.inc' patron => owner -%],<br>"
1318
            - "<br>"
1318
            - "<br>"
1319
            - "A public list, titled <em>[% shelf.shelfname | html %]</em>, has been transferred to you[% IF ( old_owner ) %] by [%- INCLUDE 'patron-title.inc' patron => old_owner%][% IF ( old_owner.email ) %] <em>([% old_owner.email | html %])</em>[% END %][% END %].<br>"
1319
            - "A public list, titled <em>[% shelf.shelfname | html %]</em>, has been transferred to you[% IF ( librarian ) %] by [%- INCLUDE 'patron-title.inc' patron => librarian %][% END %].<br>"
1320
            - "<br>"
1320
            - "<br>"
1321
            - "[% IF old_owner %]The list was previously owned by [%- INCLUDE 'patron-title.inc' patron => old_owner -%].<br><br>[% END %]"
1321
            - "Thank you<br>"
1322
            - "Thank you<br>"
1322
            - "<br>"
1323
            - "<br>"
1323
1324
1324
- 

Return to bug 30955