Bugzilla – Attachment 104094 Details for
Bug 10910
Add a warn when deleting a patron with pending suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10910: Add a warning when deleting a patron with pending suggestions
Bug-10910-Add-a-warning-when-deleting-a-patron-wit.patch (text/plain), 2.58 KB, created by
Victor Grousset/tuxayo
on 2020-05-01 13:55:45 UTC
(
hide
)
Description:
Bug 10910: Add a warning when deleting a patron with pending suggestions
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2020-05-01 13:55:45 UTC
Size:
2.58 KB
patch
obsolete
>From f2b015b01c8028760d4b180ac6d5a3a8af57435a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 5 May 2019 09:42:45 -0500 >Subject: [PATCH] Bug 10910: Add a warning when deleting a patron with pending > suggestions > >Test plan: >From the OPAC, add a suggestion >From the staff interface, try to delete the patron who created the >suggestion >=> You get a warning message > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../intranet-tmpl/prog/en/modules/members/deletemem.tt | 4 +++- > members/deletemem.pl | 10 ++++++++++ > 2 files changed, 13 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt >index 776de69ba4..e27af5288a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt >@@ -48,7 +48,9 @@ > <ul> > [% END %] > <h3>Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]? This cannot be undone.</h3> >- >+ [% IF pending_suggestions > 0 %] >+ <h3>Note that this patron has [% pending_suggestions %] pending suggestions.</h3> >+ [% END %] > <form action="/cgi-bin/koha/members/deletemem.pl"> > <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" /> > <input type="hidden" name="member" value="[% patron.borrowernumber | html %]"/> >diff --git a/members/deletemem.pl b/members/deletemem.pl >index 12eac49339..bd8a043bd6 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -28,6 +28,7 @@ use C4::Context; > use C4::Output; > use C4::Auth; > use C4::Members; >+use C4::Suggestions qw( SearchSuggestion ); > use Koha::Patrons; > use Koha::Token; > use Koha::Patron::Categories; >@@ -102,6 +103,15 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { > op => 'delete_confirm', > csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), > ); >+ >+ # Add warning if patron has pending suggestions >+ $template->param( >+ pending_suggestions => scalar @{ >+ C4::Suggestions::SearchSuggestion( >+ { suggestedby => $member, STATUS => 'ASKED' } >+ ) >+ } >+ ); > } elsif ( $op eq 'delete_confirmed' ) { > output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' ) > unless Koha::Token->new->check_csrf( { >-- >2.26.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 10910
:
89360
|
103903
|
104094
|
104128
|
104129
|
104237
|
104238
|
105752
|
105753