Lines 283-289
Link Here
|
283 |
<a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% itemloop.size() || 0 | html %])</a> |
283 |
<a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% itemloop.size() || 0 | html %])</a> |
284 |
</li> |
284 |
</li> |
285 |
[% END %] |
285 |
[% END %] |
286 |
[% IF ( MARCNOTES ) %]<li role="presentation"><a href="#description" aria-controls="description" role="tab" data-toggle="tab">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
286 |
[% IF Koha.Preference('EnableItemGroups') %] |
|
|
287 |
<li role="presentation"> |
288 |
<a href="#item_groups" aria-controls="item_groups" role="tab" data-toggle="tab">Item groups</a> |
289 |
</li> |
290 |
[% END %] |
291 |
[% IF ( MARCNOTES || notes ) %]<li role="presentation"><a href="#description" aria-controls="description" role="tab" data-toggle="tab">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
287 |
[% IF ComponentParts && ComponentParts.size %]<li id="components_tab" role="presentation"><a href="#components" aria-controls="components" role="tab" data-toggle="tab">Components ([% ComponentParts.size | html %])</a></li>[% END %] |
292 |
[% IF ComponentParts && ComponentParts.size %]<li id="components_tab" role="presentation"><a href="#components" aria-controls="components" role="tab" data-toggle="tab">Components ([% ComponentParts.size | html %])</a></li>[% END %] |
288 |
[% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions" aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %] |
293 |
[% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions" aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %] |
289 |
[% IF Koha.Preference('AcquisitionDetails') %]<li role="presentation"><a href="#acq_details" aria-controls="acq_details" role="tab" data-toggle="tab">Acquisition details</a></li>[% END %] |
294 |
[% IF Koha.Preference('AcquisitionDetails') %]<li role="presentation"><a href="#acq_details" aria-controls="acq_details" role="tab" data-toggle="tab">Acquisition details</a></li>[% END %] |
Lines 321-326
Link Here
|
321 |
[% IF CAN_user_tools_items_batchmod %] |
326 |
[% IF CAN_user_tools_items_batchmod %] |
322 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
327 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
323 |
[% END %] |
328 |
[% END %] |
|
|
329 |
[% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] |
330 |
<a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a> |
331 |
<a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a> |
332 |
[% END %] |
324 |
</span> |
333 |
</span> |
325 |
[% END %] |
334 |
[% END %] |
326 |
</div> |
335 |
</div> |
Lines 335-340
Link Here
|
335 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
344 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
336 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
345 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
337 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
346 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
|
|
347 |
[% IF Koha.Preference('EnableItemGroups') %] |
348 |
<th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th> |
349 |
[% END %] |
338 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
350 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
339 |
[% IF volinfo %] |
351 |
[% IF volinfo %] |
340 |
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th> |
352 |
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th> |
Lines 411-416
Note that permanent location is a code, and location may be an authval.
Link Here
|
411 |
</span> |
423 |
</span> |
412 |
</td> |
424 |
</td> |
413 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
425 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
|
|
426 |
[% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %] |
414 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
427 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
415 |
[% IF ( volinfo ) %] |
428 |
[% IF ( volinfo ) %] |
416 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
429 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
Lines 627-632
Note that permanent location is a code, and location may be an authval.
Link Here
|
627 |
|
640 |
|
628 |
[% END %][%# end of block items_table %] |
641 |
[% END %][%# end of block items_table %] |
629 |
|
642 |
|
|
|
643 |
[% IF Koha.Preference('EnableItemGroups') %] |
644 |
<div role="tabpanel" class="tab-pane" id="item_groups"> |
645 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
646 |
<div class="item_groups_table_table_controls"> |
647 |
<a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a> |
648 |
</div> |
649 |
[% END %] |
650 |
<table class="items-group-table" id="items-group-table"> |
651 |
<thead> |
652 |
<tr> |
653 |
<td>Display Order</td> |
654 |
<td>Description</td> |
655 |
<td> </td> |
656 |
</tr> |
657 |
</thead> |
658 |
</table> |
659 |
</div> |
660 |
[% END %] |
661 |
|
662 |
|
630 |
<div role="tabpanel" class="tab-pane" id="holdings"> |
663 |
<div role="tabpanel" class="tab-pane" id="holdings"> |
631 |
|
664 |
|
632 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %] |
665 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %] |
Lines 1059-1064
Note that permanent location is a code, and location may be an authval.
Link Here
|
1059 |
|
1092 |
|
1060 |
[% END %] |
1093 |
[% END %] |
1061 |
|
1094 |
|
|
|
1095 |
<div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label"> |
1096 |
<div class="modal-dialog"> |
1097 |
<div class="modal-content"> |
1098 |
<div class="modal-header"> |
1099 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1100 |
<h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3> |
1101 |
</div> |
1102 |
<form id="modal-item-group-create-form" class="validated"> |
1103 |
<div class="modal-body"> |
1104 |
<fieldset> |
1105 |
<p> |
1106 |
<label for="item_group_description" class="required">Name: </label> |
1107 |
<input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" /> |
1108 |
<span class="required">Required</span> |
1109 |
</p> |
1110 |
<p> |
1111 |
<label for="item_group_display_order" class="required">Display order: </label> |
1112 |
<input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" /> |
1113 |
<span class="required">Required</span> |
1114 |
<br/> |
1115 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1116 |
</p> |
1117 |
</fieldset> |
1118 |
</div> |
1119 |
<div class="modal-footer"> |
1120 |
<button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button> |
1121 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1122 |
</div> |
1123 |
</form> |
1124 |
</div> |
1125 |
</div> |
1126 |
</div> |
1127 |
|
1128 |
<div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label"> |
1129 |
<div class="modal-dialog"> |
1130 |
<div class="modal-content"> |
1131 |
<div class="modal-header"> |
1132 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1133 |
<h3 id="modal-item-group-edit-label"><i class='fa fa-edit'></i> Edit item group</h3> |
1134 |
</div> |
1135 |
<form id="modal-item-group-edit-form" class="validated"> |
1136 |
<div class="modal-body"> |
1137 |
<fieldset> |
1138 |
<p> |
1139 |
<label for="item_group_description" class="required">Name: </label> |
1140 |
<input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" /> |
1141 |
<span class="required">Required</span> |
1142 |
</p> |
1143 |
<p> |
1144 |
<label for="item_group_display_order" class="required">Sort order: </label> |
1145 |
<input name="display_order" id="modal-item-group-edit-form-display_order" size="5" /> |
1146 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1147 |
</p> |
1148 |
</fieldset> |
1149 |
</div> |
1150 |
<div class="modal-footer"> |
1151 |
<button id="modal-item-group-edit-submit" class="btn btn-default"><i class='fa fa-edit'></i> Submit</button> |
1152 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1153 |
</div> |
1154 |
</form> |
1155 |
</div> |
1156 |
</div> |
1157 |
</div> |
1158 |
|
1159 |
<div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label"> |
1160 |
<div class="modal-dialog"> |
1161 |
<div class="modal-content"> |
1162 |
<div class="modal-header"> |
1163 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1164 |
<h3 id="modal-item-group-delete-label"><i class='fa fa-trash'></i> Delete item group</h3> |
1165 |
</div> |
1166 |
<div class="modal-body"> |
1167 |
Are you sure you want to delete this item group? |
1168 |
</div> |
1169 |
<div class="modal-footer"> |
1170 |
<button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash'></i> Delete</button> |
1171 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1172 |
</div> |
1173 |
</div> |
1174 |
</div> |
1175 |
</div> |
1176 |
|
1177 |
<div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label"> |
1178 |
<div class="modal-dialog"> |
1179 |
<div class="modal-content"> |
1180 |
<div class="modal-header"> |
1181 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1182 |
<h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3> |
1183 |
</div> |
1184 |
<form id="modal-item-group-set-form" class="validated"> |
1185 |
<div class="modal-body"> |
1186 |
<fieldset> |
1187 |
<p> |
1188 |
<label for="item_group" class="required">Item group: </label> |
1189 |
<select name="item_group" id="item-group-add-form-select"> |
1190 |
[% FOREACH ig IN biblio.item_groups %] |
1191 |
<option value="[% ig.id | html %]">[% ig.description | html %]</option> |
1192 |
[% END %] |
1193 |
</select> |
1194 |
<span class="required">Required</span> |
1195 |
</p> |
1196 |
</fieldset> |
1197 |
</div> |
1198 |
<div class="modal-footer"> |
1199 |
<button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button> |
1200 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1201 |
</div> |
1202 |
</form> |
1203 |
</div> |
1204 |
</div> |
1205 |
</div> |
1206 |
|
1207 |
<div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label"> |
1208 |
<div class="modal-dialog"> |
1209 |
<div class="modal-content"> |
1210 |
<div class="modal-header"> |
1211 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1212 |
<h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3> |
1213 |
</div> |
1214 |
<div class="modal-body"> |
1215 |
Are you sure you want to remove these item(s) from their item group(s)? |
1216 |
</div> |
1217 |
<div class="modal-footer"> |
1218 |
<button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button> |
1219 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1220 |
</div> |
1221 |
</div> |
1222 |
</div> |
1223 |
</div> |
1224 |
|
1062 |
[% MACRO jsinclude BLOCK %] |
1225 |
[% MACRO jsinclude BLOCK %] |
1063 |
[% INCLUDE 'catalog-strings.inc' %] |
1226 |
[% INCLUDE 'catalog-strings.inc' %] |
1064 |
[% Asset.js("js/catalog.js") | $raw %] |
1227 |
[% Asset.js("js/catalog.js") | $raw %] |
Lines 1417-1424
Note that permanent location is a code, and location may be an authval.
Link Here
|
1417 |
var search_value = localStorage.getItem("searchbox_value"); |
1580 |
var search_value = localStorage.getItem("searchbox_value"); |
1418 |
if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)}; |
1581 |
if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)}; |
1419 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1582 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1420 |
}); |
1583 |
|
1421 |
[% END %] |
1584 |
[% IF Koha.Preference('EnableItemGroups') %] |
|
|
1585 |
// Load item groups table |
1586 |
var itemGroupsTable = KohaTable("items-group-table", { |
1587 |
"bAutoWidth": false, |
1588 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
1589 |
"aoColumns": [ |
1590 |
{ |
1591 |
"mDataProp": function( oObj ) { |
1592 |
return oObj.display_order; |
1593 |
}, |
1594 |
}, |
1595 |
{ |
1596 |
"mDataProp": function( oObj ) { |
1597 |
return oObj.description; |
1598 |
}, |
1599 |
}, |
1600 |
{ |
1601 |
"mDataProp": function( oObj ) { |
1602 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
1603 |
return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1604 |
<i class='fa fa-edit'></i> ${_("Edit")} |
1605 |
</button>` |
1606 |
+ ' ' |
1607 |
+ `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1608 |
<i class='fa fa-trash'></i> ${('Delete')} |
1609 |
</button>`; |
1610 |
[% ELSE %] |
1611 |
return ""; |
1612 |
[% END %] |
1613 |
}, |
1614 |
}, |
1615 |
], |
1616 |
"bPaginate": false, |
1617 |
"bProcessing": true, |
1618 |
"bServerSide": false, |
1619 |
"sAjaxSource": `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1`, |
1620 |
"sAjaxDataProp": "", |
1621 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
1622 |
$.getJSON( sSource, aoData, function (json) { |
1623 |
fnCallback(json) |
1624 |
} ); |
1625 |
}, |
1626 |
}); |
1627 |
|
1628 |
// Create new item groups |
1629 |
$('.item-group-create').on('click', function(){ |
1630 |
$('#modal-item-group-create-form-description').val(""); |
1631 |
$('#modal-item-group-create-submit').removeAttr('disabled'); |
1632 |
$('#modal-item-group-create').modal('show'); |
1633 |
}); |
1634 |
|
1635 |
$("#modal-item-group-create-form").validate({ |
1636 |
submitHandler: function(form) { |
1637 |
$.ajax({ |
1638 |
url: `/api/v1/biblios/${biblionumber}/item_groups`, |
1639 |
headers: { "x-koha-embed": "items" }, |
1640 |
success: function(item_groups){ |
1641 |
$('#modal-item-group-create-submit').attr('disabled', 'disabled'); |
1642 |
|
1643 |
var settings = { |
1644 |
"url": `/api/v1/biblios/${biblionumber}/item_groups`, |
1645 |
"method": "POST", |
1646 |
"headers": { |
1647 |
"Content-Type": "application/json" |
1648 |
}, |
1649 |
"data": JSON.stringify( |
1650 |
{ |
1651 |
"description": $("#modal-item-group-create-form-description").val(), |
1652 |
"display_order": $("#modal-item-group-create-form-display_order").val(), |
1653 |
} |
1654 |
), |
1655 |
}; |
1656 |
|
1657 |
$.ajax(settings) |
1658 |
.done(function (response) { |
1659 |
$('#item-group-add-form-select').append($('<option>', { |
1660 |
value: response.item_group_id, |
1661 |
text: response.description |
1662 |
})); |
1663 |
|
1664 |
$('#modal-item-group-create').modal('hide'); |
1665 |
if ( item_groups.length == 0 ) { |
1666 |
// This bib has no previous item groups, reload the page |
1667 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1668 |
} else { |
1669 |
// Has other item groups, just reload the table |
1670 |
itemGroupsTable.api().ajax.reload(); |
1671 |
} |
1672 |
}) |
1673 |
.fail(function(err) { |
1674 |
var message = err.responseJSON.error; |
1675 |
alert(message); |
1676 |
}); |
1677 |
} |
1678 |
}); |
1679 |
} |
1680 |
}); |
1681 |
|
1682 |
$('#modal-item-group-create').on('shown.bs.modal', function () { |
1683 |
$('#modal-item-group-create-form-description').focus(); |
1684 |
}) |
1685 |
|
1686 |
// Edit existing item groups |
1687 |
$('body').on( 'click', '.item-group-edit', function(){ |
1688 |
const item_group_id = $(this).data('item-group-id'); |
1689 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1690 |
$.get( url, function( data ) { |
1691 |
$('#modal-item-group-edit-form-description').val( data.description ); |
1692 |
$('#modal-item-group-edit-form-display_order').val( data.display_order ); |
1693 |
$('#modal-item-group-edit-submit').data('item-group-id', item_group_id ); |
1694 |
$('#modal-item-group-edit-submit').removeAttr('disabled'); |
1695 |
$('#modal-item-group-edit').modal('show'); |
1696 |
}); |
1697 |
}); |
1698 |
|
1699 |
$("#modal-item-group-edit-form").validate({ |
1700 |
submitHandler: function(form) { |
1701 |
$('#modal-item-group-edit-submit').attr('disabled', 'disabled'); |
1702 |
|
1703 |
const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id'); |
1704 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1705 |
|
1706 |
var settings = { |
1707 |
"url": url, |
1708 |
"method": "PUT", |
1709 |
"headers": { |
1710 |
"Content-Type": "application/json" |
1711 |
}, |
1712 |
"data": JSON.stringify( |
1713 |
{ |
1714 |
"description": $("#modal-item-group-edit-form-description").val(), |
1715 |
"display_order": $("#modal-item-group-edit-form-display_order").val(), |
1716 |
} |
1717 |
), |
1718 |
}; |
1719 |
|
1720 |
$.ajax(settings) |
1721 |
.done(function (response) { |
1722 |
$('#modal-item-group-edit').modal('hide'); |
1723 |
itemGroupsTable.api().ajax.reload(); |
1724 |
}) |
1725 |
.fail(function(err) { |
1726 |
var message = err.responseJSON.error; |
1727 |
alert(message); |
1728 |
}); |
1729 |
} |
1730 |
}); |
1731 |
|
1732 |
$('#modal-item-group-edit').on('shown.bs.modal', function () { |
1733 |
$('#modal-item-group-edit-form-description').focus(); |
1734 |
}) |
1735 |
|
1736 |
// Delete existing item groups |
1737 |
$('body').on( 'click', '.item-group-delete', function(){ |
1738 |
const item_group_id = $(this).data('item-group-id'); |
1739 |
$('#modal-item-group-delete-submit').data('item-group-id', item_group_id ); |
1740 |
$('#modal-item-group-delete-submit').removeAttr('disabled'); |
1741 |
$('#modal-item-group-delete').modal('show'); |
1742 |
}); |
1743 |
$("#modal-item-group-delete-submit").on('click', function(){ |
1744 |
$('#modal-item-group-delete-submit').attr('disabled', 'disabled'); |
1745 |
const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id'); |
1746 |
|
1747 |
$.ajax({ |
1748 |
url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1749 |
headers: { "x-koha-embed": "items" }, |
1750 |
success: function(item_group_data){ |
1751 |
$.ajax({ |
1752 |
"url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1753 |
"method": "DELETE", |
1754 |
}) |
1755 |
.done(function (response) { |
1756 |
$('#modal-item-group-delete').modal('hide'); |
1757 |
$(`#item-group-add-form-select option[value='${item_group_id}']`).remove(); |
1758 |
if ( item_group_data.items === null ) { |
1759 |
// No items for this item group, we can just refresh the table |
1760 |
itemGroupsTable.api().ajax.reload(); |
1761 |
} else { |
1762 |
// This item group had items attached to it, we need to reload the page |
1763 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1764 |
} |
1765 |
}) |
1766 |
.fail(function(err) { |
1767 |
var message = err.responseJSON.error; |
1768 |
alert(message); |
1769 |
}); |
1770 |
} |
1771 |
}); |
1772 |
}); |
1773 |
|
1774 |
// Add item(s) to a item group |
1775 |
$('.itemselection_action_item_group_set').on('click', function(){ |
1776 |
$('#modal-item-group-set').modal('show'); |
1777 |
}); |
1778 |
|
1779 |
$("#modal-item-group-set-form").validate({ |
1780 |
submitHandler: function(form) { |
1781 |
$('#modal-item-group-set-submit').attr('disabled', 'disabled'); |
1782 |
|
1783 |
const item_group_id = $('#item-group-add-form-select').val(); |
1784 |
|
1785 |
let itemnumbers = new Array(); |
1786 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1787 |
const itemnumber = $(this).val(); |
1788 |
itemnumbers.push( itemnumber ); |
1789 |
}); |
1790 |
if (itemnumbers.length > 0) { |
1791 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group'; |
1792 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1793 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1794 |
url += `&item_group_id=${item_group_id}`; |
1795 |
|
1796 |
window.location.replace(url); |
1797 |
} |
1798 |
|
1799 |
$('#modal-item-group-set').modal('hide'); |
1800 |
} |
1801 |
}); |
1802 |
|
1803 |
// Remove item(s) from an item group |
1804 |
$('.itemselection_action_item_group_unset').on('click', function(){ |
1805 |
$('#modal-item-group-unset').modal('show'); |
1806 |
}); |
1807 |
|
1808 |
$("#modal-item-group-unset-submit").on('click', function(){ |
1809 |
$('#modal-item-group-unset-submit').attr('disabled', 'disabled'); |
1810 |
|
1811 |
let itemnumbers = new Array(); |
1812 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1813 |
const itemnumber = $(this).val(); |
1814 |
itemnumbers.push( itemnumber ); |
1815 |
}); |
1816 |
if (itemnumbers.length > 0) { |
1817 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group'; |
1818 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1819 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1820 |
|
1821 |
window.location.replace(url); |
1822 |
} |
1823 |
|
1824 |
$('#modal-item-group-unset').modal('hide'); |
1825 |
}); |
1826 |
[% END %] |
1422 |
</script> |
1827 |
</script> |
1423 |
[% END %] |
1828 |
[% END %] |
1424 |
[% INCLUDE 'intranet-bottom.inc' %] |
1829 |
[% INCLUDE 'intranet-bottom.inc' %] |
1425 |
- |
|
|