View | Details | Raw Unified | Return to bug 13894
Collapse All | Expand All

(-)a/C4/Utils/DataTables/Members.pm (-1 / +1 lines)
Lines 37-43 sub search { Link Here
37
        borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode,
37
        borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode,
38
        borrowers.country, cardnumber, borrowers.dateexpiry,
38
        borrowers.country, cardnumber, borrowers.dateexpiry,
39
        borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
39
        borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
40
        borrowers.userid, borrowers.dateofbirth,
40
        borrowers.userid, borrowers.dateofbirth, borrowers.categorycode,
41
        categories.description AS category_description, categories.category_type,
41
        categories.description AS category_description, categories.category_type,
42
        branches.branchname";
42
        branches.branchname";
43
    my $from = "FROM borrowers
43
    my $from = "FROM borrowers
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-12 / +48 lines)
Lines 6-11 Link Here
6
    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Confirm holds</title>
6
    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Confirm holds</title>
7
[% END %]
7
[% END %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
9
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'calendar.inc' %]
11
[% INCLUDE 'calendar.inc' %]
10
<script type="text/javascript">
12
<script type="text/javascript">
11
    // <![CDATA[
13
    // <![CDATA[
Lines 24-29 $(document).ready(function() { Link Here
24
    [% IF AutoResumeSuspendedHolds %]
26
    [% IF AutoResumeSuspendedHolds %]
25
        $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
27
        $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
26
    [% END %]
28
    [% END %]
29
30
    var table = $("#table_borrowers").dataTable($.extend(true, {}, dataTablesDefaults, {
31
        "aoColumnDefs": [
32
            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
33
        ],
34
        "aaSorting": [[ 2, "asc" ]],
35
        "sDom": "t",
36
        "iDisplayLength": -1
37
    }));
38
    $(table).find('tbody tr').filter(':has(:radio:checked)').end().click(function(event) {
39
        $('#table_borrowers tbody tr').removeClass('selected');
40
        $(this).addClass('selected');
41
        if (event.target.type !== 'radio') {
42
            $(':radio', this).attr('checked', 'true')
43
        }
44
    });
45
27
});
46
});
28
47
29
function check() {
48
function check() {
Lines 144-150 function checkMultiHold() { Link Here
144
163
145
    $('#hold-request-form').preventDoubleFormSubmit();
164
    $('#hold-request-form').preventDoubleFormSubmit();
146
165
147
[% UNLESS ( borrowernumber || borrower_list || noitems ) %]
166
[% UNLESS ( borrowernumber || borrowers || noitems ) %]
148
    [% IF ( CircAutocompl ) %]
167
    [% IF ( CircAutocompl ) %]
149
    $( "#patron" ).autocomplete({
168
    $( "#patron" ).autocomplete({
150
        source: "/cgi-bin/koha/circ/ysearch.pl",
169
        source: "/cgi-bin/koha/circ/ysearch.pl",
Lines 218-224 function checkMultiHold() { Link Here
218
      <div class="dialog alert"><h3>Patron not found</h3><p>No patron with this name, please, try another</p> </div>
237
      <div class="dialog alert"><h3>Patron not found</h3><p>No patron with this name, please, try another</p> </div>
219
    [% END %]
238
    [% END %]
220
    <form  id="holds_patronsearch" action="request.pl?biblionumber=[% biblionumber %]" method="post">
239
    <form  id="holds_patronsearch" action="request.pl?biblionumber=[% biblionumber %]" method="post">
221
        [% UNLESS borrower_list %]
240
        [% UNLESS borrowers %]
222
            <fieldset class="brief">
241
            <fieldset class="brief">
223
                <label for="patron">Patron: </label>
242
                <label for="patron">Patron: </label>
224
                <div class="hint">Enter patron card number or partial name:</div>
243
                <div class="hint">Enter patron card number or partial name:</div>
Lines 228-243 function checkMultiHold() { Link Here
228
            </fieldset>
247
            </fieldset>
229
        [% ELSE %]
248
        [% ELSE %]
230
          <fieldset>
249
          <fieldset>
231
            <select size="7" name="borrowernumber">
250
            <table id="table_borrowers">
232
            [% FOREACH borrower IN borrower_list %]
251
                <thead>
233
                <option value="[% borrower.borrowernumber %]">
252
                    <tr>
234
[% borrower.surname -%], [% borrower.firstname -%]
253
                        <th></th>
235
 ... ( [% borrower.cardnumber -%] - [% borrower.categorycode -%] - [% borrower.branchcode %]
254
                        <th>Name</th>
236
) ... [% borrower.address %]
255
                        <th>Cardnumber</th>
237
                </option>
256
                        <th>Category</th>
238
            [% END %]
257
                        <th>Library</th>
239
            </select>
258
                        <th>Address</th>
240
            <input type="hidden" name="biblionumber" value="[% biblionumber %]" /><fieldset class="action"><input type="submit" value="Select" /></fieldset></fieldset>
259
                    </tr>
260
                </thead>
261
                <tbody>
262
                    [% FOREACH borrower IN borrowers %]
263
                    <tr>
264
                        <td><input type="radio" name="borrowernumber" value="[% borrower.borrowernumber %]" /></td>
265
                        <td>[% borrower.surname %], [% borrower.firstname %]</td>
266
                        <td>[% borrower.cardnumber %]</td>
267
                        <td>[% borrower.categorycode %]</td>
268
                        <td>[% borrower.branchcode %]</td>
269
                        <td>[% borrower.address %]</td>
270
                    </tr>
271
                    [% END %]
272
                </tbody>
273
            </table>
274
            <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
275
            <fieldset class="action"><input type="submit" value="Select" /></fieldset>
276
          </fieldset>
241
277
242
        [% END %]
278
        [% END %]
243
        [% IF ( multi_hold ) %]
279
        [% IF ( multi_hold ) %]
(-)a/reserve/request.pl (-11 / +19 lines)
Lines 40-45 use C4::Items; Link Here
40
use C4::Koha;
40
use C4::Koha;
41
use C4::Circulation;
41
use C4::Circulation;
42
use C4::Dates qw/format_date/;
42
use C4::Dates qw/format_date/;
43
use C4::Utils::DataTables::Members;
43
use C4::Members;
44
use C4::Members;
44
use C4::Search;		# enabled_staff_search_views
45
use C4::Search;		# enabled_staff_search_views
45
use Koha::DateUtils;
46
use Koha::DateUtils;
Lines 102-118 if ( $action eq 'move' ) { Link Here
102
}
103
}
103
104
104
if ($findborrower) {
105
if ($findborrower) {
105
    my $borrowers = Search($findborrower, 'cardnumber');
106
    my $borrower = C4::Members::GetMember( cardnumber => $findborrower );
106
107
    if ( $borrower ) {
107
    if ($borrowers && @$borrowers) {
108
        $borrowernumber_hold = $borrower->{borrowernumber};
108
        if ( @$borrowers == 1 ) {
109
            $borrowernumber_hold = $borrowers->[0]->{'borrowernumber'};
110
        }
111
        else {
112
            $template->param( borrower_list => sort_borrowerlist($borrowers));
113
        }
114
    } else {
109
    } else {
115
        $messageborrower = "'$findborrower'";
110
        my $dt_params = { iDisplayLength => -1 };
111
        my $results = C4::Utils::DataTables::Members::search(
112
            {
113
                searchmember => $findborrower,
114
                dt_params => $dt_params,
115
            }
116
        );
117
        my $borrowers = $results->{patrons};
118
        if ( scalar @$borrowers == 1 ) {
119
            $borrowernumber_hold = $borrower->[0]->{borrowernumber};
120
        } elsif ( @$borrowers ) {
121
            $template->param( borrowers => $borrowers );
122
        } else {
123
            $messageborrower = "'$findborrower'";
124
        }
116
    }
125
    }
117
}
126
}
118
127
119
- 

Return to bug 13894