Bugzilla – Attachment 43006 Details for
Bug 14910
Renew a patron does not redirect to the correct module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14910: Redirect to the circulation module after a renew
Bug-14910-Redirect-to-the-circulation-module-after.patch (text/plain), 7.25 KB, created by
Magnus Enger
on 2015-10-01 12:05:01 UTC
(
hide
)
Description:
Bug 14910: Redirect to the circulation module after a renew
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2015-10-01 12:05:01 UTC
Size:
7.25 KB
patch
obsolete
>From c46dd3bacaf32477238e62b02378d565ea23b983 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 28 Sep 2015 10:58:16 +0100 >Subject: [PATCH] Bug 14910: Redirect to the circulation module after a renew > >iIf a patron is renewed from the circulation module, the librarian >should be redirected to the circulation module. >This works correctly if the renew is done from the patron module >(members). > >This is caused by a typo in the template: desintation vs destination. > >This patch also removes the cardnumber parameter to the setstatus.pl >script, it is not needed given that borrowernumber is always passed. > >This has a good side-effect, it will fix bug 14691. The cardnumber does >not exist anymore, so no need to escape it :) > >Test plan: >0/ Do not apply this patch >1/ Create a patron with a cardnumber with a quote (rm'me) and another >one without a quote (rmme) >2/ Go on the checkouts page (circ/circulation.pl) >3/ Renew the 2 patrons >=> With rm'me you are redirected to the circ module - ok >=> With rmme you are redirected to the member module - nok >4/ Go on the patron detail page (members/moremember.pl) >5/ Renew the 2 patrons >=> you are redirected to the member module - ok >6/ Delete the patrons >=> Nothing happend with rm'me, there is a JS error on the page - nok >=> rmme is deleted - ok > >7/ Apply the patch and recreate rmme >8/ Repeat 2, 3, 4, 5 >=> You are redirected to the correct module >9/ Delete the patrons >=> They are successfully deleted > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Followed the test plan, works as advertised. (I did have some problems >initially, but that was caused by me not using the interface in >English...) >--- > .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 4 ++-- > .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++-- > members/setstatus.pl | 17 ++++++++--------- > 3 files changed, 12 insertions(+), 13 deletions(-) > >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 70edbc0..318f690 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -107,7 +107,7 @@ function update_child() { > function confirm_reregistration() { > var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); > if (is_confirmed) { >- window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&desintation=[% destination %]&reregistration=y'; >+ window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y'; > } > } > function export_barcodes() { >@@ -161,7 +161,7 @@ function searchToHold(){ > <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button> > <ul class="dropdown-menu"> > [% IF ( CAN_user_borrowers ) %] >- <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li> >+ <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li> > [% ELSE %] > <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to renew patrons" id="renewpatron" href="#">Renew patron</a></li> > [% END %] >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 064e308..662051e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -720,7 +720,7 @@ No patron matched <span class="ex">[% message %]</span> > > [% IF ( warndeparture ) %] > <li><span class="circ-hlt">Expiration:</span> Patron's card will expire soon. >- Patron's card expires on [% expiry %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=circ&reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit Details</a> >+ Patron's card expires on [% expiry %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=circ&reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit Details</a> > > </li> > [% END %] >@@ -733,7 +733,7 @@ No patron matched <span class="ex">[% message %]</span> > > [% IF ( expired ) %] > <li><span class="circ-hlt">Expiration:</span> Patron's card has expired. >- [% IF ( expiry ) %]Patron's card expired on [% expiry %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=circ&reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit Details</a> >+ [% IF ( expiry ) %]Patron's card expired on [% expiry %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=circ&reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit Details</a> > > </li> > [% END %] >diff --git a/members/setstatus.pl b/members/setstatus.pl >index d91c189..69849aa 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -37,7 +37,6 @@ my $input = new CGI; > checkauth($input, 0, { borrowers => 1 }, 'intranet'); > > my $destination = $input->param("destination") || ''; >-my $cardnumber = $input->param("cardnumber"); > my $borrowernumber=$input->param('borrowernumber'); > my $status = $input->param('status'); > my $reregistration = $input->param('reregistration') || ''; >@@ -55,15 +54,15 @@ if ( $reregistration eq 'y' ) { > } > > if($destination eq "circ"){ >- if($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"); >- } >+ if($dateexpiry){ >+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1"); >+ } else { >+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); >+ } > } else { >- if($dateexpiry){ >+ if($dateexpiry){ > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1"); >- } else { >+ } else { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); >- } >+ } > } >-- >1.9.1
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 14910
:
42906
|
42937
|
42999
|
43006
|
43032