Bugzilla – Attachment 173214 Details for
Bug 30955
Send a notice to new owner when transferring shared list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30955: (QA follow-up) Reduce database hits and clarify notice
Bug-30955-QA-follow-up-Reduce-database-hits-and-cl.patch (text/plain), 3.43 KB, created by
Martin Renvoize (ashimema)
on 2024-10-23 13:31:06 UTC
(
hide
)
Description:
Bug 30955: (QA follow-up) Reduce database hits and clarify notice
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-23 13:31:06 UTC
Size:
3.43 KB
patch
obsolete
>From a779b989ccbb4400634e7e3f3524a794257eae27 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 23 Oct 2024 14:26:39 +0100 >Subject: [PATCH] Bug 30955: (QA follow-up) Reduce database hits and clarify > notice > >This patch updates the library selection from using the new owners home >library to using the current sessions library in keeping with the >direction of travel in other bugs of this type in Koha currently. > >We also update the default notice text to clarify who sent the notice vs >who previously owned the list. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Virtualshelf.pm | 15 +++++++-------- > .../data/mysql/en/mandatory/sample_notices.yml | 5 +++-- > 2 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index 1cb82a1c5cb..2cea7e61e88 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -361,9 +361,10 @@ sub transfer_ownership { > unless $patron_id; > > ## before we change the owner, collect some details >- my $old_owner = Koha::Patrons->find( $self->owner ); >- my $new_owner = Koha::Patrons->find($patron_id); >- my $library = $new_owner->library->unblessed; >+ my $old_owner = Koha::Patrons->find( $self->owner ); >+ my $new_owner = Koha::Patrons->find($patron_id); >+ my $userenv = C4::Context->userenv; >+ my $branchcode = $userenv->{branch}; > > ## first we change the owner > $self->remove_share($patron_id) if $self->is_private; >@@ -373,16 +374,14 @@ sub transfer_ownership { > my $letter = C4::Letters::GetPreparedLetter( > module => 'lists', > letter_code => 'TRANSFER_OWNERSHIP', >- branchcode => $library->{branchcode}, >+ branchcode => $branchcode, > lang => $new_owner->lang || 'default', > objects => { > old_owner => $old_owner, >- new_owner => $new_owner, >+ owner => $new_owner, > shelf => $self, > }, >- tables => { >- 'branches' => $library->{branchcode}, >- }, >+ want_librarian => 1, > message_transport_type => 'email', > ); > >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index 3354e24b30e..c049eefb5a3 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -1314,10 +1314,11 @@ tables: > message_transport_type: email > lang: default > content: >- - "Dear [%- INCLUDE 'patron-title.inc' patron => new_owner -%],<br>" >+ - "Dear [%- INCLUDE 'patron-title.inc' patron => owner -%],<br>" > - "<br>" >- - "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>" >+ - "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>" > - "<br>" >+ - "[% IF old_owner %]The list was previously owned by [%- INCLUDE 'patron-title.inc' patron => old_owner -%].<br><br>[% END %]" > - "Thank you<br>" > - "<br>" > >-- >2.47.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30955
:
168970
|
169252
|
169267
|
170748
|
170826
|
172443
|
172445
|
173213
|
173214
|
173215
|
173216
|
173254
|
173255