Bugzilla – Attachment 170011 Details for
Bug 37562
Duplicate patron check when user cannot see patron leads to a blank popup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37562: Add patron title to duplicate patron warning and don't show popup if cannot see patron
Bug-37562-Add-patron-title-to-duplicate-patron-war.patch (text/plain), 4.65 KB, created by
Nick Clemens (kidclamp)
on 2024-08-02 17:47:14 UTC
(
hide
)
Description:
Bug 37562: Add patron title to duplicate patron warning and don't show popup if cannot see patron
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-08-02 17:47:14 UTC
Size:
4.65 KB
patch
obsolete
>From 08f47ac74eb09364fa00f3cae0b59eea9192ec1c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 2 Aug 2024 17:42:54 +0000 >Subject: [PATCH] Bug 37562: Add patron title to duplicate patron warning and > don't show popup if cannot see patron > >This patch passes the suspected duplicate to the template and uses patron title to display very brief info. >If the user cannot view the patron there is no longer a link tot he brief popup and they will only see >'A patron from library X" > >There is a FIXME asking if we should use search_limited - I believe we should check all branches, so the staff can ask the patron if they >have an exising account in a consortium depending on rules about multiple cards > >To test: > 1 - Edit a user to grant catalogue and all borrower permissions except 'view_borrower_infos_from_any_libraries' > 2 - Find a patron from a different library and note surname and firstname > 3 - Login as the patron above > 4 - Enter a new patron with the same surname and firstname > 5 - See the 'Duplicate patron' warning > 6 - Click to view the patron > 7 - No info is listed > 8 - Apply patch > 9 - Reload and resubmit - or fill out form again >10 - Note that you see 'A patron from library XXX' and no popup link >11 - Add view_borrower_infos_from_any_libraries to the staff >12 - Repeat the duplication and confirm the warning now has patron name and the popup link is visible and works >--- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 5 ++++- > members/memberentry.pl | 5 ++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index cb026038342..1a689db665f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -143,7 +143,10 @@ legend.collapsed i.fa.fa-caret-down::before { > [% IF ( check_member ) %] > <div class="dialog alert"> > <h3>Duplicate patron record?</h3> >- <p><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p> >+ <p>[%- INCLUDE 'patron-title.inc' patron => check_patron hide_patron_infos_if_needed => 1 -%]</p> >+ [% IF logged_in_user.can_see_patron_infos( check_patron ) %] >+ <p><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p> >+ [% END %] > <a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&borrowernumber=[% check_member | uri %]" class="btn btn-default" id="duplicate"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> It is a duplicate. Edit existing record </a> > <button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button> > </div> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index f6472346917..9a995325819 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -82,6 +82,7 @@ my $check_member = $input->param('check_member'); > my $nodouble = $input->param('nodouble'); > my $duplicate = $input->param('duplicate'); > my $quickadd = $input->param('quickadd'); >+my $check_patron; > > $nodouble = 1 if ($op eq 'edit_form' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're > # modifying an existing patron, it ipso facto >@@ -250,7 +251,8 @@ if ( ( $op eq 'cud-insert' ) and !$nodouble ) { > my $patrons = Koha::Patrons->search($conditions); # FIXME Should be search_limited? > if ( $patrons->count > 0) { > $nodouble = 0; >- $check_member = $patrons->next->borrowernumber; >+ $check_patron = $patrons->next; >+ $check_member = $check_patron->borrowernumber; > } > } > >@@ -789,6 +791,7 @@ $template->param( > BorrowerMandatoryField => C4::Context->preference("BorrowerMandatoryField"),#field to test with javascript > destination => $destination,#to know where u come from and where u must go in redirect > check_member => $check_member,#to know if the borrower already exist(=>1) or not (=>0) >+ check_patron => $check_patron > ); > > $template->param( >-- >2.39.2
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 37562
:
170011
|
170020
|
170323
|
170324