|
Lines 164-213
Link Here
|
| 164 |
<!-- /.main.container-fluid --> |
164 |
<!-- /.main.container-fluid --> |
| 165 |
|
165 |
|
| 166 |
[% MACRO jsinclude BLOCK %] |
166 |
[% MACRO jsinclude BLOCK %] |
| 167 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
167 |
[% INCLUDE 'acq-histsearch_js.inc' %] |
| 168 |
[% INCLUDE 'calendar.inc' %] |
|
|
| 169 |
[% INCLUDE 'datatables.inc' %] |
| 170 |
<script> |
| 171 |
var MSG_REMOVE_PATRON = _("Remove"); |
| 172 |
$(document).ready(function() { |
| 173 |
var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %]; |
| 174 |
$("#histsearcht").kohaTable( |
| 175 |
{ |
| 176 |
pagingType: "full", |
| 177 |
}, |
| 178 |
table_settings |
| 179 |
); |
| 180 |
|
| 181 |
function AddPatron( patron_name, value, container, input_name ) { |
| 182 |
div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash-can' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>"; |
| 183 |
$(container).append( div ); |
| 184 |
|
| 185 |
$(container).parent().show( 800 ); |
| 186 |
} |
| 187 |
function RemovePatron( cardnumber, container ) { |
| 188 |
$( '#borrower_' + cardnumber ).remove(); |
| 189 |
|
| 190 |
if ( ! $(container).html() ) { |
| 191 |
$(container).parent("fieldset").hide( 800 ); |
| 192 |
} |
| 193 |
} |
| 194 |
patron_autocomplete($("#find_patron"), { |
| 195 |
'on-select-callback': function( event, ui ) { |
| 196 |
var field = ui.item.patron_id; |
| 197 |
AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#basket_creators"), 'created_by' ); |
| 198 |
$("#find_patron").val('').focus(); |
| 199 |
return false; |
| 200 |
} |
| 201 |
}); |
| 202 |
$("body").on("click",".removePatron",function(e){ |
| 203 |
e.preventDefault(); |
| 204 |
var divid = $(this).parent().attr("id"); |
| 205 |
var cardnumber = divid.replace("borrower_",""); |
| 206 |
RemovePatron(cardnumber, $("#basket_creators")); |
| 207 |
}); |
| 208 |
|
| 209 |
}); |
| 210 |
</script> |
| 211 |
[% END %] |
168 |
[% END %] |
| 212 |
|
169 |
|
| 213 |
[% INCLUDE 'intranet-bottom.inc' %] |
170 |
[% INCLUDE 'intranet-bottom.inc' %] |
| 214 |
- |
|
|