Bug 33484: Include patron search code if no patron selected yet
When placing a hold we should not display the patron search code (html+js) if we have picked a patron already, otherwise a get a JS error Uncaught TypeError: table_dt.settings()[0] is undefined koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc 781 let table_dt = patrons_table.DataTable(); 782 let loaded_from_state = table_dt.settings()[0].loaded_from_state; Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
b4099974f0
commit
c71e123c4d
|
|
@ -1998,16 +1998,20 @@
|
|||
table_settings = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
|
||||
</script>
|
||||
|
||||
[% SET search_results_block_id = 'holds_patronsearch_pane_panel' %] [%# adjusting variable for patron-search.inc %]
|
||||
[% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
|
||||
[% UNLESS patron %]
|
||||
[% SET search_results_block_id = 'holds_patronsearch_pane_panel' %] [%# adjusting variable for patron-search.inc %]
|
||||
[% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#holds_patronsearch").on("submit", filter);
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#holds_patronsearch").on("submit", filter);
|
||||
});
|
||||
$('.printholdslip').click(function(){
|
||||
var reserve_id = $(this).attr('data-reserve_id');
|
||||
window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
|
||||
return false;
|
||||
var reserve_id = $(this).attr('data-reserve_id');
|
||||
window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
|
||||
return false;
|
||||
})
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue