Lines 9-46
Link Here
|
9 |
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script> |
9 |
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script> |
10 |
<![endif]--> |
10 |
<![endif]--> |
11 |
<script type="text/javascript" src="[% interface %]/js/browser.js"></script> |
11 |
<script type="text/javascript" src="[% interface %]/js/browser.js"></script> |
|
|
12 |
<script type="text/javascript" src="[% themelang %]/js/koha-to-marc-mapping-api.js"></script> |
12 |
<script type="text/javascript"> |
13 |
<script type="text/javascript"> |
13 |
//<![CDATA[ |
14 |
//<![CDATA[ |
14 |
var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); |
15 |
var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); |
15 |
browser.show(); |
16 |
browser.show(); |
16 |
|
17 |
|
17 |
//Fetch the Shelving locations using AJAX |
|
|
18 |
//Build the replacement HTML for the shelving location options |
19 |
//Then replace the existing HTML with this. |
20 |
function reloadShelvingLocations(homebranch) { |
21 |
|
22 |
$.ajax({ |
23 |
url: "/cgi-bin/koha/svc/getAuthorisedValues.pl", |
24 |
type: "POST", |
25 |
dataType: 'json', |
26 |
data: { 'category' : 'LOC', 'branch_limit' : homebranch }, |
27 |
success: function(data, textStatus, jqXHR) { |
28 |
|
29 |
var html_replacement = '<option value="" selected="selected"></option>\n'; |
30 |
for (var i in data) { |
31 |
html_replacement += '<option value="'+data[i].authorised_value+'">'+data[i].lib+'</option>\n'; |
32 |
} |
33 |
$("select[id*='tag_[% shelvingLocationMarcTag %]_subfield_[% shelvingLocationMarcSubfield %]']").html(html_replacement); |
34 |
} |
35 |
}); |
36 |
} |
37 |
|
38 |
|
18 |
|
39 |
$(document).ready(function(){ |
19 |
$(document).ready(function(){ |
40 |
|
|
|
41 |
//Reload shelving location with AJAX if the "Permanent location" (homebranch) changes. |
20 |
//Reload shelving location with AJAX if the "Permanent location" (homebranch) changes. |
42 |
$("select[id*='tag_[% homebranchMarcTag %]_subfield_[% homebranchMarcSubfield %]']").change(function() { |
21 |
//Function is bound from koha-to-marc-mapping-api.js |
43 |
reloadShelvingLocations(this.value); |
22 |
$("select[id^='tag_[% homebranchMarcTag %]_subfield_[% homebranchMarcSubfield %]']").change(function() { |
|
|
23 |
var shelvingLocationSelector = $(this).closest("ol") //Get the shelving location <select>-element of this specific Item. On this same page there can be many items. |
24 |
.find("select[id^='tag_[% shelvingLocationMarcTag %]_subfield_[% shelvingLocationMarcSubfield %]']"); |
25 |
reloadShelvingLocations(this.value, [% frameworkcode || 0 %], shelvingLocationSelector); |
44 |
}); |
26 |
}); |
45 |
|
27 |
|
46 |
|
28 |
|
Lines 296-299
$(document).ready(function() {
Link Here
|
296 |
|
278 |
|
297 |
</div> |
279 |
</div> |
298 |
</div> |
280 |
</div> |
299 |
[% INCLUDE 'intranet-bottom.inc' %] |
281 |
|
|
|
282 |
[% INCLUDE 'intranet-bottom.inc' %] |