Lines 268-274
Link Here
|
268 |
<a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a> |
268 |
<a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a> |
269 |
</li> |
269 |
</li> |
270 |
[% END %] |
270 |
[% END %] |
271 |
[% IF ( MARCNOTES ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
271 |
[% IF Koha.Preference('EnableItemGroups') %]<li><a href="#item_groups">Item Groups</a></li>[% END %] |
|
|
272 |
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
272 |
[% IF ComponentParts && ComponentParts.size %]<li id="components_tab"><a href="#components">Components ([% ComponentParts.size | html %])</a></li>[% END %] |
273 |
[% IF ComponentParts && ComponentParts.size %]<li id="components_tab"><a href="#components">Components ([% ComponentParts.size | html %])</a></li>[% END %] |
273 |
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %] |
274 |
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %] |
274 |
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %] |
275 |
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %] |
Lines 303-308
Link Here
|
303 |
[% IF CAN_user_tools_items_batchmod %] |
304 |
[% IF CAN_user_tools_items_batchmod %] |
304 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
305 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
305 |
[% END %] |
306 |
[% END %] |
|
|
307 |
[% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] |
308 |
<a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a> |
309 |
<a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a> |
310 |
[% END %] |
306 |
</span> |
311 |
</span> |
307 |
[% END %] |
312 |
[% END %] |
308 |
</div> |
313 |
</div> |
Lines 317-322
Link Here
|
317 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
322 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
318 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
323 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
319 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
324 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
|
|
325 |
[% IF Koha.Preference('EnableItemGroups') %] |
326 |
<th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th> |
327 |
[% END %] |
320 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
328 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
321 |
[% IF volinfo %] |
329 |
[% IF volinfo %] |
322 |
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th> |
330 |
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th> |
Lines 391-396
Note that permanent location is a code, and location may be an authval.
Link Here
|
391 |
</span> |
399 |
</span> |
392 |
</td> |
400 |
</td> |
393 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
401 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
|
|
402 |
[% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %] |
394 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
403 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
395 |
[% IF ( volinfo ) %] |
404 |
[% IF ( volinfo ) %] |
396 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
405 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
Lines 596-601
Note that permanent location is a code, and location may be an authval.
Link Here
|
596 |
|
605 |
|
597 |
[% END %][%# end of block items_table %] |
606 |
[% END %][%# end of block items_table %] |
598 |
|
607 |
|
|
|
608 |
[% IF Koha.Preference('EnableItemGroups') %] |
609 |
<div id="item_groups"> |
610 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
611 |
<div class="item_groups_table_table_controls"> |
612 |
<a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a> |
613 |
</div> |
614 |
[% END %] |
615 |
<table class="items-group-table" id="items-group-table"> |
616 |
<thead> |
617 |
<tr> |
618 |
<td>Display Order</td> |
619 |
<td>Description</td> |
620 |
<td> </td> |
621 |
</tr> |
622 |
</thead> |
623 |
</table> |
624 |
</div> |
625 |
[% END %] |
626 |
|
599 |
<div id="holdings"> |
627 |
<div id="holdings"> |
600 |
|
628 |
|
601 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %] |
629 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %] |
Lines 1027-1032
Note that permanent location is a code, and location may be an authval.
Link Here
|
1027 |
|
1055 |
|
1028 |
[% END %] |
1056 |
[% END %] |
1029 |
|
1057 |
|
|
|
1058 |
<div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label"> |
1059 |
<div class="modal-dialog"> |
1060 |
<div class="modal-content"> |
1061 |
<div class="modal-header"> |
1062 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1063 |
<h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3> |
1064 |
</div> |
1065 |
<form id="modal-item-group-create-form" class="validated"> |
1066 |
<div class="modal-body"> |
1067 |
<fieldset> |
1068 |
<p> |
1069 |
<label for="item_group_description" class="required">Name: </label> |
1070 |
<input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" /> |
1071 |
<span class="required">Required</span> |
1072 |
</p> |
1073 |
<p> |
1074 |
<label for="item_group_display_order" class="required">Display order: </label> |
1075 |
<input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" /> |
1076 |
<span class="required">Required</span> |
1077 |
<br/> |
1078 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1079 |
</p> |
1080 |
</fieldset> |
1081 |
</div> |
1082 |
<div class="modal-footer"> |
1083 |
<button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button> |
1084 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1085 |
</div> |
1086 |
</form> |
1087 |
</div> |
1088 |
</div> |
1089 |
</div> |
1090 |
|
1091 |
<div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label"> |
1092 |
<div class="modal-dialog"> |
1093 |
<div class="modal-content"> |
1094 |
<div class="modal-header"> |
1095 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1096 |
<h3 id="modal-item-group-edit-label"><i class='fa fa-edit'></i> Edit item group</h3> |
1097 |
</div> |
1098 |
<form id="modal-item-group-edit-form" class="validated"> |
1099 |
<div class="modal-body"> |
1100 |
<fieldset> |
1101 |
<p> |
1102 |
<label for="item_group_description" class="required">Name: </label> |
1103 |
<input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" /> |
1104 |
<span class="required">Required</span> |
1105 |
</p> |
1106 |
<p> |
1107 |
<label for="item_group_display_order" class="required">Sort order: </label> |
1108 |
<input name="display_order" id="modal-item-group-edit-form-display_order" size="5" /> |
1109 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1110 |
</p> |
1111 |
</fieldset> |
1112 |
</div> |
1113 |
<div class="modal-footer"> |
1114 |
<button id="modal-item-group-edit-submit" class="btn btn-default"><i class='fa fa-edit'></i> Submit</button> |
1115 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1116 |
</div> |
1117 |
</form> |
1118 |
</div> |
1119 |
</div> |
1120 |
</div> |
1121 |
|
1122 |
<div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label"> |
1123 |
<div class="modal-dialog"> |
1124 |
<div class="modal-content"> |
1125 |
<div class="modal-header"> |
1126 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1127 |
<h3 id="modal-item-group-delete-label"><i class='fa fa-trash'></i> Delete item group</h3> |
1128 |
</div> |
1129 |
<div class="modal-body"> |
1130 |
Are you sure you want to delete this item group? |
1131 |
</div> |
1132 |
<div class="modal-footer"> |
1133 |
<button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash'></i> Delete</button> |
1134 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1135 |
</div> |
1136 |
</div> |
1137 |
</div> |
1138 |
</div> |
1139 |
|
1140 |
<div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label"> |
1141 |
<div class="modal-dialog"> |
1142 |
<div class="modal-content"> |
1143 |
<div class="modal-header"> |
1144 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1145 |
<h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3> |
1146 |
</div> |
1147 |
<form id="modal-item-group-set-form" class="validated"> |
1148 |
<div class="modal-body"> |
1149 |
<fieldset> |
1150 |
<p> |
1151 |
<label for="item_group" class="required">Item group: </label> |
1152 |
<select name="item_group" id="item-group-add-form-select"> |
1153 |
[% FOREACH ig IN biblio.item_groups %] |
1154 |
<option value="[% ig.id | html %]">[% ig.description | html %]</option> |
1155 |
[% END %] |
1156 |
</select> |
1157 |
<span class="required">Required</span> |
1158 |
</p> |
1159 |
</fieldset> |
1160 |
</div> |
1161 |
<div class="modal-footer"> |
1162 |
<button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button> |
1163 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1164 |
</div> |
1165 |
</form> |
1166 |
</div> |
1167 |
</div> |
1168 |
</div> |
1169 |
|
1170 |
<div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label"> |
1171 |
<div class="modal-dialog"> |
1172 |
<div class="modal-content"> |
1173 |
<div class="modal-header"> |
1174 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1175 |
<h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3> |
1176 |
</div> |
1177 |
<div class="modal-body"> |
1178 |
Are you sure you want to remove these item(s) from their item group(s)? |
1179 |
</div> |
1180 |
<div class="modal-footer"> |
1181 |
<button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button> |
1182 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1183 |
</div> |
1184 |
</div> |
1185 |
</div> |
1186 |
</div> |
1187 |
|
1030 |
[% MACRO jsinclude BLOCK %] |
1188 |
[% MACRO jsinclude BLOCK %] |
1031 |
[% INCLUDE 'catalog-strings.inc' %] |
1189 |
[% INCLUDE 'catalog-strings.inc' %] |
1032 |
[% Asset.js("js/catalog.js") | $raw %] |
1190 |
[% Asset.js("js/catalog.js") | $raw %] |
Lines 1378-1383
Note that permanent location is a code, and location may be an authval.
Link Here
|
1378 |
if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)}; |
1536 |
if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)}; |
1379 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1537 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1380 |
}); |
1538 |
}); |
|
|
1539 |
|
1540 |
[% IF Koha.Preference('EnableItemGroups') %] |
1541 |
// Load item groups table |
1542 |
var itemGroupsTable = KohaTable("items-group-table", { |
1543 |
"bAutoWidth": false, |
1544 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
1545 |
"aoColumns": [ |
1546 |
{ |
1547 |
"mDataProp": function( oObj ) { |
1548 |
return oObj.display_order; |
1549 |
}, |
1550 |
}, |
1551 |
{ |
1552 |
"mDataProp": function( oObj ) { |
1553 |
return oObj.description; |
1554 |
}, |
1555 |
}, |
1556 |
{ |
1557 |
"mDataProp": function( oObj ) { |
1558 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
1559 |
return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1560 |
<i class='fa fa-edit'></i> ${_("Edit")} |
1561 |
</button>` |
1562 |
+ ' ' |
1563 |
+ `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1564 |
<i class='fa fa-trash'></i> ${('Delete')} |
1565 |
</button>`; |
1566 |
[% ELSE %] |
1567 |
return ""; |
1568 |
[% END %] |
1569 |
}, |
1570 |
}, |
1571 |
], |
1572 |
"bPaginate": false, |
1573 |
"bProcessing": true, |
1574 |
"bServerSide": false, |
1575 |
"sAjaxSource": `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1`, |
1576 |
"sAjaxDataProp": "", |
1577 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
1578 |
$.getJSON( sSource, aoData, function (json) { |
1579 |
fnCallback(json) |
1580 |
} ); |
1581 |
}, |
1582 |
}); |
1583 |
|
1584 |
// Create new item groups |
1585 |
$('.item-group-create').on('click', function(){ |
1586 |
$('#modal-item-group-create-form-description').val(""); |
1587 |
$('#modal-item-group-create-submit').removeAttr('disabled'); |
1588 |
$('#modal-item-group-create').modal('show'); |
1589 |
}); |
1590 |
|
1591 |
$("#modal-item-group-create-form").validate({ |
1592 |
submitHandler: function(form) { |
1593 |
$.ajax({ |
1594 |
url: `/api/v1/biblios/${biblionumber}/item_groups`, |
1595 |
headers: { "x-koha-embed": "items" }, |
1596 |
success: function(item_groups){ |
1597 |
$('#modal-item-group-create-submit').attr('disabled', 'disabled'); |
1598 |
|
1599 |
var settings = { |
1600 |
"url": `/api/v1/biblios/${biblionumber}/item_groups`, |
1601 |
"method": "POST", |
1602 |
"headers": { |
1603 |
"Content-Type": "application/json" |
1604 |
}, |
1605 |
"data": JSON.stringify( |
1606 |
{ |
1607 |
"description": $("#modal-item-group-create-form-description").val(), |
1608 |
"display_order": $("#modal-item-group-create-form-display_order").val(), |
1609 |
} |
1610 |
), |
1611 |
}; |
1612 |
|
1613 |
$.ajax(settings) |
1614 |
.done(function (response) { |
1615 |
$('#item-group-add-form-select').append($('<option>', { |
1616 |
value: response.item_group_id, |
1617 |
text: response.description |
1618 |
})); |
1619 |
|
1620 |
$('#modal-item-group-create').modal('hide'); |
1621 |
if ( item_groups.length == 0 ) { |
1622 |
// This bib has no previous item groups, reload the page |
1623 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1624 |
} else { |
1625 |
// Has other item groups, just reload the table |
1626 |
itemGroupsTable.api().ajax.reload(); |
1627 |
} |
1628 |
}) |
1629 |
.fail(function(err) { |
1630 |
var message = err.responseJSON.error; |
1631 |
alert(message); |
1632 |
}); |
1633 |
} |
1634 |
}); |
1635 |
} |
1636 |
}); |
1637 |
|
1638 |
$('#modal-item-group-create').on('shown.bs.modal', function () { |
1639 |
$('#modal-item-group-create-form-description').focus(); |
1640 |
}) |
1641 |
|
1642 |
// Edit existing item groups |
1643 |
$('body').on( 'click', '.item-group-edit', function(){ |
1644 |
const item_group_id = $(this).data('item-group-id'); |
1645 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1646 |
$.get( url, function( data ) { |
1647 |
$('#modal-item-group-edit-form-description').val( data.description ); |
1648 |
$('#modal-item-group-edit-form-display_order').val( data.display_order ); |
1649 |
$('#modal-item-group-edit-submit').data('item-group-id', item_group_id ); |
1650 |
$('#modal-item-group-edit-submit').removeAttr('disabled'); |
1651 |
$('#modal-item-group-edit').modal('show'); |
1652 |
}); |
1653 |
}); |
1654 |
|
1655 |
$("#modal-item-group-edit-form").validate({ |
1656 |
submitHandler: function(form) { |
1657 |
$('#modal-item-group-edit-submit').attr('disabled', 'disabled'); |
1658 |
|
1659 |
const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id'); |
1660 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1661 |
|
1662 |
var settings = { |
1663 |
"url": url, |
1664 |
"method": "PUT", |
1665 |
"headers": { |
1666 |
"Content-Type": "application/json" |
1667 |
}, |
1668 |
"data": JSON.stringify( |
1669 |
{ |
1670 |
"description": $("#modal-item-group-edit-form-description").val(), |
1671 |
"display_order": $("#modal-item-group-edit-form-display_order").val(), |
1672 |
} |
1673 |
), |
1674 |
}; |
1675 |
|
1676 |
$.ajax(settings) |
1677 |
.done(function (response) { |
1678 |
$('#modal-item-group-edit').modal('hide'); |
1679 |
itemGroupsTable.api().ajax.reload(); |
1680 |
}) |
1681 |
.fail(function(err) { |
1682 |
var message = err.responseJSON.error; |
1683 |
alert(message); |
1684 |
}); |
1685 |
} |
1686 |
}); |
1687 |
|
1688 |
$('#modal-item-group-edit').on('shown.bs.modal', function () { |
1689 |
$('#modal-item-group-edit-form-description').focus(); |
1690 |
}) |
1691 |
|
1692 |
// Delete existing item groups |
1693 |
$('body').on( 'click', '.item-group-delete', function(){ |
1694 |
const item_group_id = $(this).data('item-group-id'); |
1695 |
$('#modal-item-group-delete-submit').data('item-group-id', item_group_id ); |
1696 |
$('#modal-item-group-delete-submit').removeAttr('disabled'); |
1697 |
$('#modal-item-group-delete').modal('show'); |
1698 |
}); |
1699 |
$("#modal-item-group-delete-submit").on('click', function(){ |
1700 |
$('#modal-item-group-delete-submit').attr('disabled', 'disabled'); |
1701 |
const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id'); |
1702 |
|
1703 |
$.ajax({ |
1704 |
url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1705 |
headers: { "x-koha-embed": "items" }, |
1706 |
success: function(item_group_data){ |
1707 |
$.ajax({ |
1708 |
"url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1709 |
"method": "DELETE", |
1710 |
}) |
1711 |
.done(function (response) { |
1712 |
$('#modal-item-group-delete').modal('hide'); |
1713 |
$(`#item-group-add-form-select option[value='${item_group_id}']`).remove(); |
1714 |
if ( item_group_data.items === null ) { |
1715 |
// No items for this item group, we can just refresh the table |
1716 |
itemGroupsTable.api().ajax.reload(); |
1717 |
} else { |
1718 |
// This item group had items attached to it, we need to reload the page |
1719 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1720 |
} |
1721 |
}) |
1722 |
.fail(function(err) { |
1723 |
var message = err.responseJSON.error; |
1724 |
alert(message); |
1725 |
}); |
1726 |
} |
1727 |
}); |
1728 |
}); |
1729 |
|
1730 |
// Add item(s) to a item group |
1731 |
$('.itemselection_action_item_group_set').on('click', function(){ |
1732 |
$('#modal-item-group-set').modal('show'); |
1733 |
}); |
1734 |
|
1735 |
$("#modal-item-group-set-form").validate({ |
1736 |
submitHandler: function(form) { |
1737 |
$('#modal-item-group-set-submit').attr('disabled', 'disabled'); |
1738 |
|
1739 |
const item_group_id = $('#item-group-add-form-select').val(); |
1740 |
|
1741 |
let itemnumbers = new Array(); |
1742 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1743 |
const itemnumber = $(this).val(); |
1744 |
itemnumbers.push( itemnumber ); |
1745 |
}); |
1746 |
if (itemnumbers.length > 0) { |
1747 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group'; |
1748 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1749 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1750 |
url += `&item_group_id=${item_group_id}`; |
1751 |
|
1752 |
window.location.replace(url); |
1753 |
} |
1754 |
|
1755 |
$('#modal-item-group-set').modal('hide'); |
1756 |
} |
1757 |
}); |
1758 |
|
1759 |
// Remove item(s) from an item group |
1760 |
$('.itemselection_action_item_group_unset').on('click', function(){ |
1761 |
$('#modal-item-group-unset').modal('show'); |
1762 |
}); |
1763 |
|
1764 |
$("#modal-item-group-unset-submit").on('click', function(){ |
1765 |
$('#modal-item-group-unset-submit').attr('disabled', 'disabled'); |
1766 |
|
1767 |
let itemnumbers = new Array(); |
1768 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1769 |
const itemnumber = $(this).val(); |
1770 |
itemnumbers.push( itemnumber ); |
1771 |
}); |
1772 |
if (itemnumbers.length > 0) { |
1773 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group'; |
1774 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1775 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1776 |
|
1777 |
window.location.replace(url); |
1778 |
} |
1779 |
|
1780 |
$('#modal-item-group-unset').modal('hide'); |
1781 |
}); |
1782 |
[% END %] |
1381 |
</script> |
1783 |
</script> |
1382 |
[% END %] |
1784 |
[% END %] |
1383 |
[% INCLUDE 'intranet-bottom.inc' %] |
1785 |
[% INCLUDE 'intranet-bottom.inc' %] |
1384 |
- |
|
|