|
Lines 163-180
Link Here
|
| 163 |
[% END %] |
163 |
[% END %] |
| 164 |
</ul> |
164 |
</ul> |
| 165 |
<div id="holds_patronsearch_pane"> |
165 |
<div id="holds_patronsearch_pane"> |
| 166 |
<form id="holds_patronsearch" action="request.pl" method="post"> |
166 |
<form id="holds_patronsearch" method="get"> |
| 167 |
<div class="hint">Enter patron card number or partial name:</div> |
167 |
<div class="hint">Enter patron card number or partial name:</div> |
| 168 |
<input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" /> |
168 |
<input type="text" size="40" id="patron" class="focus" autocomplete="off" /> |
| 169 |
<input type="submit" value="Search" /> |
169 |
<input type="submit" value="Search" /> |
| 170 |
[% FOREACH biblionumber IN biblionumbers %] |
170 |
[% FOREACH biblionumber IN biblionumbers %] |
| 171 |
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/> |
171 |
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/> |
| 172 |
[% END %] |
172 |
[% END %] |
| 173 |
|
|
|
| 174 |
</form> <!-- /#holds_patronsearch --> |
173 |
</form> <!-- /#holds_patronsearch --> |
| 175 |
[% IF borrowers %] |
174 |
|
| 176 |
[% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %] |
175 |
<table id="table_borrowers" class="selections-table" style="display: none;"> |
| 177 |
[% END %] |
176 |
<thead> |
|
|
177 |
<tr> |
| 178 |
<th>Name</th> |
| 179 |
<th>Address</th> |
| 180 |
<th>Card number</th> |
| 181 |
<th>Date of birth</th> |
| 182 |
<th>Category</th> |
| 183 |
<th>Library</th> |
| 184 |
<th>Primary phone</th> |
| 185 |
</tr> |
| 186 |
</thead> |
| 187 |
<tbody></tbody> |
| 188 |
</table> |
| 189 |
|
| 178 |
</div> |
190 |
</div> |
| 179 |
[% IF clubcount %] |
191 |
[% IF clubcount %] |
| 180 |
<div id="holds_clubsearch_pane"> |
192 |
<div id="holds_clubsearch_pane"> |
|
Lines 1146-1152
Link Here
|
| 1146 |
[% INCLUDE 'calendar.inc' %] |
1158 |
[% INCLUDE 'calendar.inc' %] |
| 1147 |
[% INCLUDE 'columns_settings.inc' %] |
1159 |
[% INCLUDE 'columns_settings.inc' %] |
| 1148 |
[% Asset.js("lib/hc-sticky.js") | $raw %] |
1160 |
[% Asset.js("lib/hc-sticky.js") | $raw %] |
| 1149 |
[% Asset.js("js/circ-patron-search-results.js") | $raw %] |
|
|
| 1150 |
[% INCLUDE 'select2.inc' %] |
1161 |
[% INCLUDE 'select2.inc' %] |
| 1151 |
[% Asset.js("js/holds.js") | $raw%] |
1162 |
[% Asset.js("js/holds.js") | $raw%] |
| 1152 |
<script> |
1163 |
<script> |
|
Lines 1404-1409
Link Here
|
| 1404 |
} |
1415 |
} |
| 1405 |
|
1416 |
|
| 1406 |
$(document).ready(function() { |
1417 |
$(document).ready(function() { |
|
|
1418 |
|
| 1407 |
$("#always_show_holds").change(function(){ |
1419 |
$("#always_show_holds").change(function(){ |
| 1408 |
if( $(this).prop('checked') ){ |
1420 |
if( $(this).prop('checked') ){ |
| 1409 |
document.cookie = 'always_show_holds=DO'; |
1421 |
document.cookie = 'always_show_holds=DO'; |
|
Lines 1507-1547
Link Here
|
| 1507 |
return false; |
1519 |
return false; |
| 1508 |
}); |
1520 |
}); |
| 1509 |
|
1521 |
|
| 1510 |
[% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %] |
|
|
| 1511 |
[% IF ( PatronAutoComplete ) %] |
| 1512 |
$( "#patron" ).autocomplete({ |
| 1513 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
| 1514 |
minLength: 3, |
| 1515 |
select: function( event, ui ) { |
| 1516 |
$( "#patron" ).val( ui.item.cardnumber ); |
| 1517 |
$( "#holds_patronsearch" ).submit(); |
| 1518 |
return false; |
| 1519 |
} |
| 1520 |
}) |
| 1521 |
.data( "ui-autocomplete" )._renderItem = function( ul, item ) { |
| 1522 |
return $( "<li></li>" ) |
| 1523 |
.data( "ui-autocomplete-item", item ) |
| 1524 |
.append( |
| 1525 |
"<a>" |
| 1526 |
+ ( item.surname ? item.surname.escapeHtml() : "" ) |
| 1527 |
+ ", " |
| 1528 |
+ ( item.firstname ? item.firstname.escapeHtml() : "" ) |
| 1529 |
+ " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")" |
| 1530 |
+ " " |
| 1531 |
+ "<small>" |
| 1532 |
+ ( item.address ? item.address.escapeHtml() : "" ) |
| 1533 |
+ " " |
| 1534 |
+ ( item.city ? item.city.escapeHtml() : "" ) |
| 1535 |
+ " " |
| 1536 |
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) |
| 1537 |
+ " " |
| 1538 |
+ ( item.country ? item.country.escapeHtml() : "" ) |
| 1539 |
+ "</small>" |
| 1540 |
+ "</a>" ) |
| 1541 |
.appendTo( ul ); |
| 1542 |
}; |
| 1543 |
[% END %] |
| 1544 |
[% END %] |
| 1545 |
Sticky = $("#toolbar"); |
1522 |
Sticky = $("#toolbar"); |
| 1546 |
Sticky.hcSticky({ |
1523 |
Sticky.hcSticky({ |
| 1547 |
stickTo: "#existing_holds", |
1524 |
stickTo: "#existing_holds", |
|
Lines 1593-1598
Link Here
|
| 1593 |
return false; |
1570 |
return false; |
| 1594 |
}); |
1571 |
}); |
| 1595 |
|
1572 |
|
|
|
1573 |
[% FOREACH biblionumber IN biblionumbers %] |
| 1574 |
[% SET url_biblio_params = url_biblio_params _ "&biblionumber=" _ biblionumber %] |
| 1575 |
[% END %] |
| 1576 |
[% IF multi_hold %] |
| 1577 |
[% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %] |
| 1578 |
[% END %] |
| 1579 |
search = 0; |
| 1580 |
dtMemberResults = KohaTable("table_borrowers", { |
| 1581 |
'bServerSide': true, |
| 1582 |
'sAjaxSource': "/cgi-bin/koha/svc/members/search", |
| 1583 |
'fnServerData': function(sSource, aoData, fnCallback) { |
| 1584 |
if ( ! search ) { |
| 1585 |
return; |
| 1586 |
} |
| 1587 |
aoData.push({ |
| 1588 |
'name': 'searchmember', |
| 1589 |
'value': $("#patron").val() |
| 1590 |
},{ |
| 1591 |
'name': 'template_path', |
| 1592 |
'value': 'reserve/tables/members_results.tt', |
| 1593 |
}); |
| 1594 |
$.ajax({ |
| 1595 |
'dataType': 'json', |
| 1596 |
'type': 'POST', |
| 1597 |
'url': sSource, |
| 1598 |
'data': aoData, |
| 1599 |
'success': function(json){ |
| 1600 |
// redirect if there is only 1 result. |
| 1601 |
if ( json.aaData.length == 1 ) { |
| 1602 |
var borrowernumber = json.aaData[0].borrowernumber; |
| 1603 |
document.location.href = '/cgi-bin/koha/reserve/request.pl?borrowernumber=' + borrowernumber + "[% url_biblio_params %]" |
| 1604 |
return false; |
| 1605 |
} |
| 1606 |
fnCallback(json); |
| 1607 |
} |
| 1608 |
}); |
| 1609 |
}, |
| 1610 |
'fnDrawCallback': function (oSettings) { |
| 1611 |
var data = this.fnGetData(); |
| 1612 |
$.each($(this).find("tbody tr"), function(index, tr) { |
| 1613 |
let url = '/cgi-bin/koha/reserve/request.pl?borrowernumber=' + data[index].borrowernumber + "[% url_biblio_params %]" |
| 1614 |
$(tr).off('click').on('click', function() { |
| 1615 |
document.location.href = url; |
| 1616 |
}).addClass('clickable'); |
| 1617 |
$(tr).find("a.patron_preview").attr('href', url); |
| 1618 |
}); |
| 1619 |
}, |
| 1620 |
'aoColumns':[ |
| 1621 |
{ 'mDataProp': 'dt_name' }, |
| 1622 |
{ 'mDataProp': 'dt_address' }, |
| 1623 |
{ 'mDataProp': 'dt_cardnumber' }, |
| 1624 |
{ 'mDataProp': 'dt_dateofbirth' }, |
| 1625 |
{ 'mDataProp': 'dt_category' }, |
| 1626 |
{ 'mDataProp': 'dt_branch' }, |
| 1627 |
{ 'mDataProp': 'dt_phone' }, |
| 1628 |
], |
| 1629 |
'bFilter': false, |
| 1630 |
'bAutoWidth': false, |
| 1631 |
'sPaginationType': 'full_numbers', |
| 1632 |
"bProcessing": true |
| 1633 |
}, columns_settings_borrowers_table ); |
| 1634 |
$("#table_borrowers_wrapper").hide(); |
| 1635 |
|
| 1636 |
function filter() { |
| 1637 |
search = 1; |
| 1638 |
$("#table_borrowers").show(); |
| 1639 |
$("#table_borrowers_wrapper").show(); |
| 1640 |
dtMemberResults.fnDraw(); |
| 1641 |
return false; |
| 1642 |
} |
| 1643 |
$("#holds_patronsearch").on("submit", filter); |
| 1644 |
|
| 1596 |
}); |
1645 |
}); |
| 1597 |
</script> |
1646 |
</script> |
| 1598 |
[% END %] |
1647 |
[% END %] |