From 1400cd159863374542f455c0aee5c6d2c07ae4fc Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 1 May 2020 16:28:25 +0000 Subject: [PATCH] Bug 10910: (follow-up) Move the suggestions note with the other non-blocking notes To test: - Add a credit to the patron's account - Make sure they got a pending suggestion - Try to delete - Verify you notes for both as list items Signed-off-by: Katrin Fischer Signed-off-by: Victor Grousset/tuxayo --- .../prog/en/modules/members/deletemem.tt | 10 +++++----- members/deletemem.pl | 17 +++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) 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 e27af5288a..23c59cd49b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt @@ -37,7 +37,7 @@ [% ELSIF op == 'delete_confirm' and patron %] [%# TODO add "patron does not exist" unless patron %]
- [% IF ItemsOnHold or credits %] + [% IF ItemsOnHold or credits or pending_suggestions > 0 %]
    [% IF ItemsOnHold %]
  • Patron has [% ItemsOnHold | html %] hold(s). Deleting patron cancels all their holds.
  • @@ -45,12 +45,12 @@ [% IF credits %]
  • Patron has a [% credits | $Price %] credit.
  • [% END %] -
      + [% IF pending_suggestions > 0 %] +
    • Patron has [% pending_suggestions | html %] pending suggestions.
    • + [% END %] +
    [% END %]

    Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]? This cannot be undone.

    - [% IF pending_suggestions > 0 %] -

    Note that this patron has [% pending_suggestions %] pending suggestions.

    - [% END %]
    diff --git a/members/deletemem.pl b/members/deletemem.pl index bd8a043bd6..8593a76885 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -89,6 +89,15 @@ my $dbh = C4::Context->dbh; my $is_guarantor = $patron->guarantee_relationships->count; my $countholds = $dbh->selectrow_array("SELECT COUNT(*) FROM reserves WHERE borrowernumber=?", undef, $member); +# Add warning if patron has pending suggestions +$template->param( + pending_suggestions => scalar @{ + C4::Suggestions::SearchSuggestion( + { suggestedby => $member, STATUS => 'ASKED' } + ) + } +); + $template->param( patron => $patron, ItemsOnIssues => $countissues, @@ -104,14 +113,6 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { 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