From 780a1bb62e98a3d5131221f58c06eda432470aa2 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 16 Jan 2013 09:38:28 -0800 Subject: [PATCH] bug 9406: ensure confirmation of patron renewal is displayed When renewing a patron from the patron details page, ensure that the "Patron's account has been renewed until XXX" is actually displayed. This patch introduces a was_renewed CGI and template parameter to clarify the intent of the relevent template sections. To test: - Before applying the patch, renew a patron from the patron details page and verify that you don't see the renewal confirmation. - After applying the patch, renew the patron from the details page and verify that the "Patron's account has been renewed until XXX" message shows up. - Renew the patron from the checkout page and verify that the confirmation message shows up. Signed-off-by: Galen Charlton Signed-off-by: Jonathan Druart --- circ/circulation.pl | 3 +-- koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- .../intranet-tmpl/prog/en/modules/members/moremember-brief.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 4 ++-- members/moremember.pl | 8 +------- members/setstatus.pl | 4 ++-- 7 files changed, 9 insertions(+), 16 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 91fd1a2..6050bc4 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -132,7 +132,6 @@ my $issueconfirmed = $query->param('issueconfirmed'); my $cancelreserve = $query->param('cancelreserve'); my $organisation = $query->param('organisations'); my $print = $query->param('print') || q{}; -my $newexpiry = $query->param('dateexpiry'); my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice # Check if stickyduedate is turned off @@ -676,7 +675,7 @@ $template->param( surname => $borrower->{'surname'}, showname => $borrower->{'showname'}, category_type => $borrower->{'category_type'}, - dateexpiry => format_date($newexpiry), + was_renewed => $query->param('was_renewed') ? 1 : 0, expiry => format_date($borrower->{'dateexpiry'}), categorycode => $borrower->{'categorycode'}, categoryname => $borrower->{description}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 91d179e..04fe8c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -125,7 +125,7 @@ function export_barcodes() {
  • Print summary
  • Print slip
  • Search to hold
  • - [% IF ( CAN_user_borrowers ) %]
  • Renew account
  • [% END %] + [% IF ( CAN_user_borrowers ) %]
  • Renew patron
  • [% END %] [% IF ( CAN_user_permissions ) %] [% IF ( CAN_user_staffaccess ) %]
  • Set permissions
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 9c045cd..f63df12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -303,7 +303,7 @@ function validate1(date) { -[% IF ( dateexpiry ) %]
    Patron's account has been renewed until [% dateexpiry %]
    [% END %] +[% IF ( was_renewed ) %]
    Patron's account has been renewed until [% expiry %]
    [% END %] [% IF additional_materials %]
    Note about the accompanying materials:
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index d983996..c9fb845 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -76,7 +76,7 @@
  • Category: [% description %] ([% categorycode %])
  • Registration date: [% dateenrolled %]
  • Expiration date: - [% IF ( reregistration ) %] + [% IF ( was_renewed ) %] [% dateexpiry %] [% ELSE %] [% dateexpiry %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index bbb5cab..205e0b9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -168,7 +168,7 @@ function validate1(date) { [% IF ( unknowuser ) %]
    This patron does not exist.
    [% ELSE %] - [% IF ( reregistration ) %]
    Patron's account has been renewed until [% dateexpiry %]
    [% END %] + [% IF ( was_renewed ) %]
    Patron's account has been renewed until [% dateexpiry %]
    [% END %] [% IF ( flagged ) %]
      @@ -343,7 +343,7 @@ function validate1(date) {
    • Registration date: [% dateenrolled %]
    • Expiration date: - [% IF ( reregistration ) %] + [% IF ( was_renewed ) %] [% dateexpiry %] [% ELSE %] [% dateexpiry %] diff --git a/members/moremember.pl b/members/moremember.pl index 3928286..3885a35 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -119,7 +119,6 @@ my $borrowernumber = $input->param('borrowernumber'); #start the page and read in includes my $data = GetMember( 'borrowernumber' => $borrowernumber ); -my $reregistration = $input->param('reregistration'); if ( not defined $data ) { $template->param (unknowuser => 1); @@ -127,11 +126,6 @@ if ( not defined $data ) { exit; } -# re-reregistration function to automatic calcul of date expiry -if ( $reregistration eq 'y' ) { - $data->{'dateexpiry'} = ExtendMemberSubscriptionTo( $borrowernumber ); -} - my $category_type = $data->{'category_type'}; ### $category_type @@ -414,7 +408,7 @@ $template->param( borrowernumber => $borrowernumber, othernames => $data->{'othernames'}, categoryname => $data->{'description'}, - reregistration => $reregistration, + was_renewed => $input->param('was_renewed') ? 1 : 0, branch => $branch, todaysdate => C4::Dates->today(), totalprice => sprintf("%.2f", $totalprice), diff --git a/members/setstatus.pl b/members/setstatus.pl index 914c36e..d08bad1 100755 --- a/members/setstatus.pl +++ b/members/setstatus.pl @@ -58,13 +58,13 @@ if ( $reregistration eq 'y' ) { if($destination eq "circ"){ if($dateexpiry){ - print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber&dateexpiry=$dateexpiry"); + print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber&was_renewed=1"); } else { print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber"); } } else { if($dateexpiry){ - print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&dateexpiry=$dateexpiry"); + print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1"); } else { print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); } -- 1.7.10.4