+ [% IF (AcqCreateItem == 'ordering') %]
+ var items_columns = [null, null, 'barcode', 'homebranchname',
+ 'holdingbranchname', 'notforloan', 'restricted', 'location',
+ 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
+ 'itemtype', 'materials', 'itemnotes'];
+
+ function PopupEditPage(biblionumber, itemnumber) {
+ var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
+ + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
+ var w = window.open(url);
+ var watchClose = setInterval(function() {
+ if (w.closed) {
+ clearTimeout(watchClose);
+ $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
+ {
+ 'itemnumber': itemnumber
+ },
+ function(item) {
+ var tds = $("#item_"+itemnumber+" td");
+ for(var i=2; i<tds.length; i++) {
+ var column = items_columns[i];
+ $(tds[i]).text(item[column]);
+ }
+ }
+ );
+ }
+ }, 500);
+ }
+
+ function CalcQtyToReceive() {
+ var qty = $("input[name='items_to_receive']:checked").length;
+ $("#quantity").val(qty);
+ }
+
+ function CheckNItems(n) {
+ $("input[name='items_to_receive']").each(function() {
+ $(this).attr('checked', false);
+ });
+ $("input[name='items_to_receive']:lt("+n+")").each(function () {
+ $(this).attr('checked', true);
+ });
+ }
+ [% END %]
+