Bugzilla – Attachment 37330 Details for
Bug 13894
SQLHelper replacement - C4::Members::Search - reserve.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13894: Make reserve.pl not using C4::Members::Search
PASSED-QA-Bug-13894-Make-reservepl-not-using-C4Mem.patch (text/plain), 7.41 KB, created by
Kyle M Hall (khall)
on 2015-03-27 15:36:14 UTC
(
hide
)
Description:
[PASSED QA] Bug 13894: Make reserve.pl not using C4::Members::Search
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-27 15:36:14 UTC
Size:
7.41 KB
patch
obsolete
>From 6cc9dd9398d3525466b6edc153aedc3db7aef21d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 23 Mar 2015 14:43:24 +0100 >Subject: [PATCH] [PASSED QA] Bug 13894: Make reserve.pl not using C4::Members::Search > >Important note: This will modify the UI. >The patron list will now be displayed in a table (instead of a select). > >Test plan: >1/ Place a hold on a record >2/ Search for a patron >3/ Select a patron and submit >4/ The hold workflow should continue as previously > >No behavior changes should be observed. > >Works as expected. >Signed-off-by: Marc Veron <veron@veron.ch> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Utils/DataTables/Members.pm | 2 +- > .../prog/en/modules/reserve/request.tt | 60 ++++++++++++++++---- > reserve/request.pl | 29 ++++++--- > 3 files changed, 68 insertions(+), 23 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index c9ad109..767fc46 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -37,7 +37,7 @@ sub search { > borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode, > borrowers.country, cardnumber, borrowers.dateexpiry, > borrowers.borrowernotes, borrowers.branchcode, borrowers.email, >- borrowers.userid, borrowers.dateofbirth, >+ borrowers.userid, borrowers.dateofbirth, borrowers.categorycode, > categories.description AS category_description, categories.category_type, > branches.branchname"; > my $from = "FROM borrowers >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index db044b5..04023d3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -6,6 +6,8 @@ > <title>Koha › Circulation › Holds › Confirm holds</title> > [% END %] > [% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] > [% INCLUDE 'calendar.inc' %] > <script type="text/javascript"> > // <![CDATA[ >@@ -24,6 +26,23 @@ $(document).ready(function() { > [% IF AutoResumeSuspendedHolds %] > $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1); > [% END %] >+ >+ var table = $("#table_borrowers").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aaSorting": [[ 2, "asc" ]], >+ "sDom": "t", >+ "iDisplayLength": -1 >+ })); >+ $(table).find('tbody tr').filter(':has(:radio:checked)').end().click(function(event) { >+ $('#table_borrowers tbody tr').removeClass('selected'); >+ $(this).addClass('selected'); >+ if (event.target.type !== 'radio') { >+ $(':radio', this).attr('checked', 'true') >+ } >+ }); >+ > }); > > function check() { >@@ -144,7 +163,7 @@ function checkMultiHold() { > > $('#hold-request-form').preventDoubleFormSubmit(); > >-[% UNLESS ( borrowernumber || borrower_list || noitems ) %] >+[% UNLESS ( borrowernumber || borrowers || noitems ) %] > [% IF ( CircAutocompl ) %] > $( "#patron" ).autocomplete({ > source: "/cgi-bin/koha/circ/ysearch.pl", >@@ -218,7 +237,7 @@ function checkMultiHold() { > <div class="dialog alert"><h3>Patron not found</h3><p>No patron with this name, please, try another</p> </div> > [% END %] > <form id="holds_patronsearch" action="request.pl?biblionumber=[% biblionumber %]" method="post"> >- [% UNLESS borrower_list %] >+ [% UNLESS borrowers %] > <fieldset class="brief"> > <label for="patron">Patron: </label> > <div class="hint">Enter patron card number or partial name:</div> >@@ -228,16 +247,33 @@ function checkMultiHold() { > </fieldset> > [% ELSE %] > <fieldset> >- <select size="7" name="borrowernumber"> >- [% FOREACH borrower IN borrower_list %] >- <option value="[% borrower.borrowernumber %]"> >-[% borrower.surname -%], [% borrower.firstname -%] >- ... ( [% borrower.cardnumber -%] - [% borrower.categorycode -%] - [% borrower.branchcode %] >-) ... [% borrower.address %] >- </option> >- [% END %] >- </select> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /><fieldset class="action"><input type="submit" value="Select" /></fieldset></fieldset> >+ <table id="table_borrowers"> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Name</th> >+ <th>Cardnumber</th> >+ <th>Category</th> >+ <th>Library</th> >+ <th>Address</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH borrower IN borrowers %] >+ <tr> >+ <td><input type="radio" name="borrowernumber" value="[% borrower.borrowernumber %]" /></td> >+ <td>[% borrower.surname %], [% borrower.firstname %]</td> >+ <td>[% borrower.cardnumber %]</td> >+ <td>[% borrower.categorycode %]</td> >+ <td>[% borrower.branchcode %]</td> >+ <td>[% borrower.address %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ <fieldset class="action"><input type="submit" value="Select" /></fieldset> >+ </fieldset> > > [% END %] > [% IF ( multi_hold ) %] >diff --git a/reserve/request.pl b/reserve/request.pl >index b4b749e..7d9c5e6 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -40,6 +40,7 @@ use C4::Items; > use C4::Koha; > use C4::Circulation; > use C4::Dates qw/format_date/; >+use C4::Utils::DataTables::Members; > use C4::Members; > use C4::Search; # enabled_staff_search_views > use Koha::DateUtils; >@@ -102,17 +103,25 @@ if ( $action eq 'move' ) { > } > > if ($findborrower) { >- my $borrowers = Search($findborrower, 'cardnumber'); >- >- if ($borrowers && @$borrowers) { >- if ( @$borrowers == 1 ) { >- $borrowernumber_hold = $borrowers->[0]->{'borrowernumber'}; >- } >- else { >- $template->param( borrower_list => sort_borrowerlist($borrowers)); >- } >+ my $borrower = C4::Members::GetMember( cardnumber => $findborrower ); >+ if ( $borrower ) { >+ $borrowernumber_hold = $borrower->{borrowernumber}; > } else { >- $messageborrower = "'$findborrower'"; >+ my $dt_params = { iDisplayLength => -1 }; >+ my $results = C4::Utils::DataTables::Members::search( >+ { >+ searchmember => $findborrower, >+ dt_params => $dt_params, >+ } >+ ); >+ my $borrowers = $results->{patrons}; >+ if ( scalar @$borrowers == 1 ) { >+ $borrowernumber_hold = $borrower->[0]->{borrowernumber}; >+ } elsif ( @$borrowers ) { >+ $template->param( borrowers => $borrowers ); >+ } else { >+ $messageborrower = "'$findborrower'"; >+ } > } > } > >-- >1.7.2.5
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 13894
:
37124
|
37171
| 37330 |
37361