Bugzilla – Attachment 125580 Details for
Bug 15812
Checkout search with too many results (single character search) causes poor performance or timeout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15812: Use patron search in place of circ search
Bug-15812-Use-patron-search-in-place-of-circ-searc.patch (text/plain), 58.26 KB, created by
Martin Renvoize (ashimema)
on 2021-10-01 09:00:08 UTC
(
hide
)
Description:
Bug 15812: Use patron search in place of circ search
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-01 09:00:08 UTC
Size:
58.26 KB
patch
obsolete
>From 36ecd5f0a70b27d5fdcd2ab7b8e87345e449d5b5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 24 Sep 2021 00:05:30 +0000 >Subject: [PATCH] Bug 15812: Use patron search in place of circ search > >The 'Checkout' search hijacks some of the DataTables searching code used for 'Search patrons' >Rather than try to implement the search again on another page, we can simply send the user >to the patron search if the cardnumber is not found > >Additionally, this patch adds a 'Check out' button to the patron search results to allow >going to checkotus directly > >To test: >1 - Apply patch >2 - Perform a 'Checkout' search from the header >3 - Note that: > For a cardnumber, you are redirected directly to checkouts page for the borrower > For a search with one result, you are redirected directly to the checkout page for the borrower > For a search with many results, you are redirected to the patron search results > and there is a 'Checkout' button under the cardnumber >4 - Confirm circulation page works as expected (i.e. checkout to a patron) > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: George Williams <george@nekls.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/circulation.pl | 21 +- > .../prog/en/modules/circ/circulation.tt | 611 +++++++++--------- > .../prog/en/modules/members/member.tt | 3 +- > .../modules/members/tables/members_results.tt | 2 +- > members/member.pl | 6 +- > 5 files changed, 306 insertions(+), 337 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 7988782577..f0f68fee11 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -224,25 +224,8 @@ if ($findborrower) { > if ( $patron ) { > $borrowernumber = $patron->borrowernumber; > } else { >- my $dt_params = { iDisplayLength => -1 }; >- my $results = C4::Utils::DataTables::Members::search( >- { >- searchmember => $findborrower, >- searchtype => $searchtype, >- dt_params => $dt_params, >- } >- ); >- my $borrowers = $results->{patrons}; >- if ( scalar @$borrowers == 1 ) { >- $borrowernumber = $borrowers->[0]->{borrowernumber}; >- $query->param( 'borrowernumber', $borrowernumber ); >- $query->param( 'barcode', '' ); >- } elsif ( @$borrowers ) { >- $template->param( borrowers => $borrowers ); >- } else { >- $query->param( 'findborrower', '' ); >- $message = "'$findborrower'"; >- } >+ print $query->redirect( "/cgi-bin/koha/members/member.pl?quicksearch=1&circsearch=1&searchmember=" . $findborrower ); >+ exit; > } > } > >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 4a563b6c92..f39f1be732 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -561,386 +561,370 @@ > <h4>No patron matched <span class="ex">[% message | html %]</span></h4> > [% END %] > >- [% IF ( borrowers ) %] >+ <!-- BARCODE ENTRY --> > >- [% INCLUDE 'patron-toolbar.inc' %] >- <fieldset id="circ_circulation_selectborrower"> >- <legend>Patron selection</legend> >- [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %] >- </fieldset> >- >- [% ELSE %] >- >- <!-- BARCODE ENTRY --> >+ [% IF patron %] > >- [% IF patron %] >+ [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %] >+ <div class="dialog alert"> >+ <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect. >+ </div> >+ [% END %] > >- [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %] >- <div class="dialog alert"> >- <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect. >- </div> >- [% END %] >+ <div class="row"> >+ [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%] >+ <div class="col-sm-6"> >+ <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> >+ <input type="hidden" name="restoreduedatespec" /> >+ [% IF ( issue ) %] >+ <fieldset id="circ_circulation_issue" class="lastchecked"> >+ [% ELSE %] >+ <fieldset id="circ_circulation_issue"> >+ [% END %] > >- <div class="row"> >- [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%] >- <div class="col-sm-6"> >- <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> >- <input type="hidden" name="restoreduedatespec" /> >- [% IF ( issue ) %] >- <fieldset id="circ_circulation_issue" class="lastchecked"> >- [% ELSE %] >- <fieldset id="circ_circulation_issue"> >- [% END %] >+ [% IF ( DisplayClearScreenButton ) %] >+ <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span> >+ <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span> >+ [% END %] > >- [% IF ( DisplayClearScreenButton ) %] >- <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span> >- <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span> >- [% END %] >+ [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] > >- [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] >+ <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label> > >- <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label> >+ [% IF Koha.Preference('itemBarcodeFallbackSearch') %] >+ <div class="hint">Enter item barcode or keyword:</div> >+ [% ELSE %] >+ <div class="hint">Enter item barcode:</div> >+ [% END %] > >- [% IF Koha.Preference('itemBarcodeFallbackSearch') %] >- <div class="hint">Enter item barcode or keyword:</div> >- [% ELSE %] >- <div class="hint">Enter item barcode:</div> >- [% END %] >+ [% IF NEEDSCONFIRMATION %] >+ <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" /> >+ [% ELSE %] >+ <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> >+ [% END %] > >- [% IF NEEDSCONFIRMATION %] >- <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" /> >- [% ELSE %] >- <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> >- [% END %] >+ <button type="submit" class="btn btn-default">Check out</button> > >- <button type="submit" class="btn btn-default">Check out</button> >+ <div id="show-circ-settings"> >+ <a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a> >+ </div> > >- <div id="show-circ-settings"> >- <a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a> >- </div> >+ <div class="circ-settings"> > >- <div class="circ-settings"> >+ [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %] >+ [% IF ( SpecifyDueDate ) %] >+ <div id="specify-due-date" class="circ-setting"> >+ <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div> >+ [% IF ( duedatespec ) %] >+ <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" /> >+ [% ELSE %] >+ <input type="text" size="20" id="duedatespec" name="duedatespec" value="" /> >+ [% END %] >+ <label for="stickyduedate"> Remember for session:</label> >+ [% IF ( stickyduedate ) %] >+ <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" /> >+ [% END %] >+ </div> >+ [% END %] >+ [% END %] > >- [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %] >- [% IF ( SpecifyDueDate ) %] >- <div id="specify-due-date" class="circ-setting"> >- <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div> >- [% IF ( duedatespec ) %] >- <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" /> >- [% ELSE %] >- <input type="text" size="20" id="duedatespec" name="duedatespec" value="" /> >- [% END %] >- <label for="stickyduedate"> Remember for session:</label> >- [% IF ( stickyduedate ) %] >- <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" /> >+ [% UNLESS ( noissues ) %] >+ <div id="set-automatic-renewal" class="circ-setting"> >+ [% IF NEEDSCONFIRMATION %] >+ [% IF auto_renew %] >+ [% IF patron.autorenew_checkouts %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >+ title="Patron has opted out of auto-renewal"/> > [% ELSE %] >- <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" /> >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" /> > [% END %] >- </div> >+ [% ELSE %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" /> >+ [% END %] >+ [% ELSE %] >+ [% IF ( auto_renew && patron.autorenew_checkouts ) %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" /> >+ [% ELSIF patron.autorenew_checkouts %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" /> >+ [% ELSE %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >+ title="Patron has opted out of auto-renewal"/> >+ [% END %] > [% END %] >- [% END %] > >- [% UNLESS ( noissues ) %] >- <div id="set-automatic-renewal" class="circ-setting"> >+ <label for="auto_renew">Automatic renewal</label> >+ </div> >+ [% IF Koha.Preference('decreaseLoanHighHolds') %] >+ <div id="set_high_holds_overrride" class="circ-setting"> > [% IF NEEDSCONFIRMATION %] >- [% IF auto_renew %] >- [% IF patron.autorenew_checkouts %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >- title="Patron has opted out of auto-renewal"/> >- [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" /> >- [% END %] >+ [% IF override_high_holds %] >+ <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/> > [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" /> >+ <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/> > [% END %] > [% ELSE %] >- [% IF ( auto_renew && patron.autorenew_checkouts ) %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" /> >- [% ELSIF patron.autorenew_checkouts %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" /> >+ [% IF override_high_holds %] >+ <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" /> > [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >- title="Patron has opted out of auto-renewal"/> >+ <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" /> > [% END %] > [% END %] >- >- <label for="auto_renew">Automatic renewal</label> >+ <label for="override_high_holds">Don't decrease checkout length based on holds</label> > </div> >- [% IF Koha.Preference('decreaseLoanHighHolds') %] >- <div id="set_high_holds_overrride" class="circ-setting"> >- [% IF NEEDSCONFIRMATION %] >- [% IF override_high_holds %] >- <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/> >- [% ELSE %] >- <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/> >- [% END %] >- [% ELSE %] >- [% IF override_high_holds %] >- <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" /> >- [% END %] >- [% END %] >- <label for="override_high_holds">Don't decrease checkout length based on holds</label> >- </div> >- [% END %] > [% END %] >+ [% END %] > >- [% IF Koha.Preference('OnSiteCheckouts') %] >- <div id="onsite_checkout-select" class="circ-setting"> >- [% IF noissues %] >- <div class="onsite-checkout-only"> >- <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label> >- <input type="text" name="duedatespec" id="duedatespec" /> >- <input type="hidden" name="onsite_checkout" checked="checked" value="1" /> >- </div> >+ [% IF Koha.Preference('OnSiteCheckouts') %] >+ <div id="onsite_checkout-select" class="circ-setting"> >+ [% IF noissues %] >+ <div class="onsite-checkout-only"> >+ <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label> >+ <input type="text" name="duedatespec" id="duedatespec" /> >+ <input type="hidden" name="onsite_checkout" checked="checked" value="1" /> >+ </div> >+ [% ELSE %] >+ [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %] >+ <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label> > [% ELSE %] >- [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %] >- <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label> >- [% ELSE %] >- <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label> >- [% END %] >+ <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label> > [% END %] >- </div> >- [% END %] >- >- </div> <!-- /.circ-settings --> >- >- <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /> >- <input type="hidden" name="branch" value="[% branch | html %]" /> >- <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" /> >- [% IF ( CHARGES ) %] >- <input type="hidden" name="charges" value="yes" /> >+ [% END %] >+ </div> > [% END %] >- </fieldset> <!-- /#circ_circulation_issue --> >- >- [% IF ( issue ) %] >- <div class="lastchecked"> >- <p><strong>Checked out: </strong>[% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates as_due_date => 1 %]</p> >- </div> >- [% END %] >- </form> <!-- /#mainform --> >- </div> <!-- /.col-sm-6 --> > >- [% END #/IF !noissues %] >+ </div> <!-- /.circ-settings --> > >- [% IF ( noissues ) %] >- [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >- <div class="col-sm-6"> >- [% ELSE %] >- <div> >- [% END %] >- [% ELSE %] >- <div class="col-sm-6"> >- [% END %] >+ <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /> >+ <input type="hidden" name="branch" value="[% branch | html %]" /> >+ <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" /> >+ [% IF ( CHARGES ) %] >+ <input type="hidden" name="charges" value="yes" /> >+ [% END %] >+ </fieldset> <!-- /#circ_circulation_issue --> > >- [% IF ( noissues ) %] >- [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >- <div id="circmessages" class="circmessage attention"> >- [% ELSE %] >- <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4> >- <div id="circmessages" class="circmessage warning"> >- [% END %] >- <h3> >- Cannot check out! >- [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >- <span class="circ-hlt">Only on-site checkouts are allowed</span> >+ [% IF ( issue ) %] >+ <div class="lastchecked"> >+ <p><strong>Checked out: </strong>[% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates as_due_date => 1 %]</p> >+ </div> > [% END %] >- </h3> >- [% ELSE %] >- <div id="circmessages" class="circmessage attention"> >- [% END %] >- >- [% INCLUDE 'patron_messages.inc' %] >+ </form> <!-- /#mainform --> >+ </div> <!-- /.col-sm-6 --> > >- </div> <!-- /#circmessages --> >- </div> <!-- /div or div.col-sm-6 --> >- </div> <!-- /.row --> >+ [% END #/IF !noissues %] > >- <div id="patronlists" class="toptabs"> >- <ul> >- <li> >- [% IF ( issuecount ) %] >- <a href="#checkouts">[% issuecount | html %] Checkout(s)</a> >+ [% IF ( noissues ) %] >+ [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >+ <div class="col-sm-6"> > [% ELSE %] >- <a href="#checkouts">0 Checkouts</a> >+ <div> > [% END %] >- </li> >- >- [% IF relatives_issues_count %] >- <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li> >+ [% ELSE %] >+ <div class="col-sm-6"> > [% END %] > >- <li> >- [% IF ( holds_count ) %] >- <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a> >+ [% IF ( noissues ) %] >+ [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >+ <div id="circmessages" class="circmessage attention"> > [% ELSE %] >- <a href="#reserves" id="holds-tab">0 Holds</a> >+ <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4> >+ <div id="circmessages" class="circmessage warning"> > [% END %] >- </li> >- >- [% IF Koha.Preference('ArticleRequests') %] >- <li> >- <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a> >- </li> >+ <h3> >+ Cannot check out! >+ [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] >+ <span class="circ-hlt">Only on-site checkouts are allowed</span> >+ [% END %] >+ </h3> >+ [% ELSE %] >+ <div id="circmessages" class="circmessage attention"> > [% END %] > >- [% IF Koha.Preference('ClaimReturnedLostValue') %] >- <li> >- [% IF ( patron.return_claims.count ) %] >- <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- [% IF patron.return_claims.resolved.count == 0 %] >- <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% ELSE %] >- <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% END %] >- [% IF patron.return_claims.unresolved.count == 0 %] >- <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% ELSE %] >- <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% END %] >- </a> >- [% ELSE %] >- <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span> >- <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span> >- </a> >- [% END %] >- </li> >+ [% INCLUDE 'patron_messages.inc' %] >+ >+ </div> <!-- /#circmessages --> >+ </div> <!-- /div or div.col-sm-6 --> >+ </div> <!-- /.row --> >+ >+ <div id="patronlists" class="toptabs"> >+ <ul> >+ <li> >+ [% IF ( issuecount ) %] >+ <a href="#checkouts">[% issuecount | html %] Checkout(s)</a> >+ [% ELSE %] >+ <a href="#checkouts">0 Checkouts</a> > [% END %] >+ </li> > >- <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li> >+ [% IF relatives_issues_count %] >+ <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li> >+ [% END %] > >- [% SET enrollments = patron.get_club_enrollments(1) %] >- [% SET enrollable = patron.get_enrollable_clubs(0,1) %] >- [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] >- <li> >- <a id="clubs-tab-link" href="#clubs-tab"> >- Clubs ([% enrollments.count | html %]/[% enrollable.count | html %]) >- </a> >- </li> >+ <li> >+ [% IF ( holds_count ) %] >+ <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a> >+ [% ELSE %] >+ <a href="#reserves" id="holds-tab">0 Holds</a> > [% END %] >- </ul> >+ </li> > >- <!-- SUMMARY : TODAY & PREVIOUS ISSUES --> >+ [% IF Koha.Preference('ArticleRequests') %] >+ <li> >+ <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a> >+ </li> >+ [% END %] > >- [% INCLUDE "checkouts-table.inc" %] >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ <li> >+ [% IF ( patron.return_claims.count ) %] >+ <a href="#return-claims" id="return-claims-tab"> >+ Claim(s) >+ [% IF patron.return_claims.resolved.count == 0 %] >+ <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >+ [% ELSE %] >+ <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >+ [% END %] >+ [% IF patron.return_claims.unresolved.count == 0 %] >+ <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >+ [% ELSE %] >+ <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >+ [% END %] >+ </a> >+ [% ELSE %] >+ <a href="#return-claims" id="return-claims-tab"> >+ Claim(s) >+ <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span> >+ <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span> >+ </a> >+ [% END %] >+ </li> >+ [% END %] > >- [% INCLUDE "relatives-issues-table.inc" %] >+ <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li> > >+ [% SET enrollments = patron.get_club_enrollments(1) %] >+ [% SET enrollable = patron.get_enrollable_clubs(0,1) %] > [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] >- <div id="clubs-tab"> >- Loading... >- </div> <!-- /#clubs-tab --> >+ <li> >+ <a id="clubs-tab-link" href="#clubs-tab"> >+ Clubs ([% enrollments.count | html %]/[% enrollable.count | html %]) >+ </a> >+ </li> > [% END %] >+ </ul> > >- [% INCLUDE borrower_debarments.inc %] >+ <!-- SUMMARY : TODAY & PREVIOUS ISSUES --> > >- <div id="reserves"> >- [% IF ( holds_count ) %] >- <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post"> >- <input type="hidden" name="from" value="circ" /> >- <table id="holds-table" style="width: 100% !Important;"> >- <thead> >- <tr> >- <th>Hold date</th> >- <th>Title</th> >- <th>Call number</th> >- <th>Barcode</th> >- <th>Pickup at</th> >- <th>Expiration</th> >- <th>Priority</th> >- <th>Cancel?</th> >- <th>Suspend?</th> >- <th>Status</th> >- </tr> >- </thead> >- </table> >- >- <fieldset class="action"> >- <input type="submit" class="cancel" name="submit" value="Cancel marked holds" /> >- >- [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >- [% IF hold_cancellation %] >- <select name="cancellation-reason"> >- <option value="">No reason given</option> >- [% FOREACH reason IN hold_cancellation %] >- <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> >- [% END %] >- </select> >- [% END %] >- </fieldset> >- </form> >+ [% INCLUDE "checkouts-table.inc" %] > >- [% IF Koha.Preference('SuspendHoldsIntranet') %] >- <fieldset class="action"> >- <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >- <input type="hidden" name="from" value="circ" /> >- <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >- <input type="submit" value="Suspend all holds" /> >- >- [% IF Koha.Preference('AutoResumeSuspendedHolds') %] >- <label for="suspend_until">until</label> >- <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/> >- <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span> >- [% END %] >- </form> >- </fieldset> >- >- <fieldset class="action"> >- <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >- <input type="hidden" name="from" value="circ" /> >- <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >- <input type="hidden" name="suspend" value="0" /> >- <input type="submit" value="Resume all suspended holds" /> >- </form> >- </fieldset> >- [% END # /IF SuspendHoldsIntranet %] >- >- [% ELSE # IF holds_count %] >- <p>Patron has nothing on hold.</p> >- [% END # /IF holds_count %] >- </div> <!-- /#reserves --> >+ [% INCLUDE "relatives-issues-table.inc" %] > >- [% IF Koha.Preference('ClaimReturnedLostValue') %] >- [% INCLUDE 'patron-return-claims.inc' %] >- [% END %] >+ [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] >+ <div id="clubs-tab"> >+ Loading... >+ </div> <!-- /#clubs-tab --> >+ [% END %] > >- [% IF Koha.Preference('ArticleRequests') %] >- [% INCLUDE 'patron-article-requests.inc' %] >- [% END %] >+ [% INCLUDE borrower_debarments.inc %] >+ >+ <div id="reserves"> >+ [% IF ( holds_count ) %] >+ <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post"> >+ <input type="hidden" name="from" value="circ" /> >+ <table id="holds-table" style="width: 100% !Important;"> >+ <thead> >+ <tr> >+ <th>Hold date</th> >+ <th>Title</th> >+ <th>Call number</th> >+ <th>Barcode</th> >+ <th>Pickup at</th> >+ <th>Expiration</th> >+ <th>Priority</th> >+ <th>Cancel?</th> >+ <th>Suspend?</th> >+ <th>Status</th> >+ </tr> >+ </thead> >+ </table> >+ >+ <fieldset class="action"> >+ <input type="submit" class="cancel" name="submit" value="Cancel marked holds" /> >+ >+ [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >+ [% IF hold_cancellation %] >+ <select name="cancellation-reason"> >+ <option value="">No reason given</option> >+ [% FOREACH reason IN hold_cancellation %] >+ <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> >+ [% END %] >+ </select> >+ [% END %] >+ </fieldset> >+ </form> >+ >+ [% IF Koha.Preference('SuspendHoldsIntranet') %] >+ <fieldset class="action"> >+ <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >+ <input type="hidden" name="from" value="circ" /> >+ <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >+ <input type="submit" value="Suspend all holds" /> >+ >+ [% IF Koha.Preference('AutoResumeSuspendedHolds') %] >+ <label for="suspend_until">until</label> >+ <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/> >+ <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span> >+ [% END %] >+ </form> >+ </fieldset> >+ >+ <fieldset class="action"> >+ <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >+ <input type="hidden" name="from" value="circ" /> >+ <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >+ <input type="hidden" name="suspend" value="0" /> >+ <input type="submit" value="Resume all suspended holds" /> >+ </form> >+ </fieldset> >+ [% END # /IF SuspendHoldsIntranet %] >+ >+ [% ELSE # IF holds_count %] >+ <p>Patron has nothing on hold.</p> >+ [% END # /IF holds_count %] >+ </div> <!-- /#reserves --> >+ >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ [% INCLUDE 'patron-return-claims.inc' %] >+ [% END %] > >- </div> <!-- /#patronlists --> >- [% ELSIF borrowernumber # IF patron %] >- <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div> >- [% END # /IF patron %] >+ [% IF Koha.Preference('ArticleRequests') %] >+ [% INCLUDE 'patron-article-requests.inc' %] >+ [% END %] > >- [% END #/IF borrowers %] >+ </div> <!-- /#patronlists --> >+ [% ELSIF borrowernumber # IF patron %] >+ <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div> >+ [% END # /IF patron %] > > </div> <!-- /.col-sm-10.col-sm-push-2 --> > > [% IF Koha.Preference('CircSidebar') %] >- [% UNLESS ( borrowers ) %] >- [% IF not( borrowernumber and patron ) %] >- <div class="col-sm-2 col-sm-pull-10"> >- <aside> >- [% INCLUDE 'circ-nav.inc' %] >- </aside> >- </div> <!-- /.col-sm-2.col-sm-pull-10 --> >- [% END %] >+ [% IF not( borrowernumber and patron ) %] >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'circ-nav.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> > [% END %] > [% END %] > >- [% UNLESS ( borrowers ) %] >- [% IF borrowernumber and patron %] >- <div class="col-sm-2 col-sm-pull-10"> >- <aside> >- [% INCLUDE 'circ-menu.inc' %] >- </aside> >- </div> <!-- /.col-sm-2 col-sm-pull-10 --> >- [% END %] >+ [% IF borrowernumber and patron %] >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'circ-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2 col-sm-pull-10 --> > [% END %] > > </div> <!-- /.row --> >@@ -993,7 +977,6 @@ > [% Asset.js("js/pages/circulation.js") | $raw %] > [% Asset.js("js/checkouts.js") | $raw %] > [% Asset.js("js/holds.js") | $raw %] >- [% Asset.js("js/circ-patron-search-results.js") | $raw %] > <script> > columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %] > columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %] >@@ -1006,7 +989,7 @@ > Cookies.remove("holdfor", { path: '/' }); > [% END %] > >- [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %] >+ [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %] > > // On-site checkout > function toggle_onsite_checkout(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index f3c14cc6fc..7aba65031e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -451,7 +451,8 @@ > // redirect if there is only 1 result. > if ( json.aaData.length == 1 ) { > var borrowernumber = json.aaData[0].borrowernumber; >- document.location.href="/cgi-bin/koha/members/moremember.pl?borrowernumber="+borrowernumber; >+ var redirect_to = [% UNLESS circsearch %]"members/moremember"[% ELSE %]"circ/circulation"[% END %]; >+ document.location.href="/cgi-bin/koha/"+redirect_to+".pl?borrowernumber="+borrowernumber; > return false; > } > fnCallback(json); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >index fe04778abd..5392572a62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >@@ -16,7 +16,7 @@ > "<input type='checkbox' id='check[% data.borrowernumber | html %]' class='selection' name='borrowernumber' value='[% data.borrowernumber | html %]' />", > [% END %] > "dt_cardnumber": >- "<label for='check[% data.borrowernumber | html %]'>[% data.cardnumber | html | $To %]</label>", >+ "<label for='check[% data.borrowernumber | html %]'>[% data.cardnumber | html | $To %]</br><a class='btn' href='/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% data.borrowernumber | html %]'>Check out</a></label>", > "dt_name": > "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br /><div class='address'><ul>[%~ INCLUDE 'display-address-style' patron=data no_line_break=1 | $To ~%][% IF data.email %]<li>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a></li>[% END %]</ul></div>", > "dt_dateofbirth": >diff --git a/members/member.pl b/members/member.pl >index 4b4578cf47..b6ce83fb7a 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -43,8 +43,9 @@ my $theme = $input->param('theme') || "default"; > > my $searchmember = $input->param('searchmember'); > my $quicksearch = $input->param('quicksearch') // 0; >+my $circsearch = $input->param('circsearch') // 0; > >-if ( $quicksearch and $searchmember ) { >+if ( $quicksearch and $searchmember && !$circsearch ) { > my $branchcode; > if ( C4::Context::only_my_library ) { > my $userenv = C4::Context->userenv; >@@ -66,7 +67,7 @@ my $searchfieldstype = $input->param('searchfieldstype') || 'standard'; > > $template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ); > >-my $view = $input->request_method() eq "GET" ? "show_form" : "show_results"; >+my $view = $input->request_method() eq "GET" && !$circsearch ? "show_form" : "show_results"; > > $template->param( > patron_lists => [ GetPatronLists() ], >@@ -77,6 +78,7 @@ $template->param( > searchfieldstype => $searchfieldstype, > PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, > view => $view, >+ circsearch => $circsearch, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.20.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 15812
:
125224
|
125234
|
125413
|
125489
|
125490
|
125580
|
125582
|
125583
|
125597
|
125604
|
125621
|
125622
|
125623
|
125624
|
125957
|
125958
|
125959
|
125960