Lines 273-279
Link Here
|
273 |
<a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a> |
273 |
<a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a> |
274 |
</li> |
274 |
</li> |
275 |
[% END %] |
275 |
[% END %] |
276 |
[% IF Koha.Preference('EnableVolumes') %]<li><a href="#volumes">Volumes</a></li>[% END %] |
276 |
[% IF Koha.Preference('EnableItemGroups') %]<li><a href="#item_groups">Item groups</a></li>[% END %] |
277 |
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
277 |
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %] |
278 |
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %] |
278 |
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %] |
279 |
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %] |
279 |
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %] |
Lines 310-318
Link Here
|
310 |
[% IF CAN_user_tools_items_batchmod %] |
310 |
[% IF CAN_user_tools_items_batchmod %] |
311 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
311 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a> |
312 |
[% END %] |
312 |
[% END %] |
313 |
[% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %] |
313 |
[% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] |
314 |
<a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a> |
314 |
<a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a> |
315 |
<a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a> |
315 |
<a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a> |
316 |
[% END %] |
316 |
[% END %] |
317 |
</span> |
317 |
</span> |
318 |
[% END %] |
318 |
[% END %] |
Lines 328-335
Link Here
|
328 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
328 |
<th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> |
329 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
329 |
<th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> |
330 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
330 |
[% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] |
331 |
[% IF Koha.Preference('EnableVolumes') %] |
331 |
[% IF Koha.Preference('EnableItemGroups') %] |
332 |
<th id="[% tab | html %]_volume" data-colname="[% tab | html %]_volume">Volume</th> |
332 |
<th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th> |
333 |
[% END %] |
333 |
[% END %] |
334 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
334 |
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> |
335 |
[% IF volinfo %] |
335 |
[% IF volinfo %] |
Lines 405-411
Note that permanent location is a code, and location may be an authval.
Link Here
|
405 |
</span> |
405 |
</span> |
406 |
</td> |
406 |
</td> |
407 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
407 |
[% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] |
408 |
[% IF Koha.Preference('EnableVolumes') %]<td class="volume">[% item.object.volume.description | html %]</td>[% END %] |
408 |
[% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %] |
409 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
409 |
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td> |
410 |
[% IF ( volinfo ) %] |
410 |
[% IF ( volinfo ) %] |
411 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
411 |
[% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] |
Lines 611-624
Note that permanent location is a code, and location may be an authval.
Link Here
|
611 |
|
611 |
|
612 |
[% END %][%# end of block items_table %] |
612 |
[% END %][%# end of block items_table %] |
613 |
|
613 |
|
614 |
[% IF Koha.Preference('EnableVolumes') %] |
614 |
[% IF Koha.Preference('EnableItemGroups') %] |
615 |
<div id="volumes"> |
615 |
<div id="item_groups"> |
616 |
[% IF CAN_user_editcatalogue_manage_volumes %] |
616 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
617 |
<div class="volumes_table_table_controls"> |
617 |
<div class="item_groups_table_table_controls"> |
618 |
<a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New volume</a> |
618 |
<a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a> |
619 |
</div> |
619 |
</div> |
620 |
[% END %] |
620 |
[% END %] |
621 |
<table class="volumes-table" id="volumes-table"> |
621 |
<table class="items-group-table" id="items-group-table"> |
622 |
<thead> |
622 |
<thead> |
623 |
<tr> |
623 |
<tr> |
624 |
<td>Display Order</td> |
624 |
<td>Display Order</td> |
Lines 1048-1079
Note that permanent location is a code, and location may be an authval.
Link Here
|
1048 |
|
1048 |
|
1049 |
[% END %] |
1049 |
[% END %] |
1050 |
|
1050 |
|
1051 |
<div class="modal fade" id="modal-volume-create" tabindex="-1" role="dialog" aria-labelledby="modal-volume-create-label"> |
1051 |
<div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label"> |
1052 |
<div class="modal-dialog"> |
1052 |
<div class="modal-dialog"> |
1053 |
<div class="modal-content"> |
1053 |
<div class="modal-content"> |
1054 |
<div class="modal-header"> |
1054 |
<div class="modal-header"> |
1055 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1055 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1056 |
<h3 id="modal-volume-create-label"><i class="fa fa-plus"></i> Create a new volume</h3> |
1056 |
<h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3> |
1057 |
</div> |
1057 |
</div> |
1058 |
<form id="modal-volume-create-form" class="validated"> |
1058 |
<form id="modal-item-group-create-form" class="validated"> |
1059 |
<div class="modal-body"> |
1059 |
<div class="modal-body"> |
1060 |
<fieldset> |
1060 |
<fieldset> |
1061 |
<p> |
1061 |
<p> |
1062 |
<label for="volume_description" class="required">Name: </label> |
1062 |
<label for="item_group_description" class="required">Name: </label> |
1063 |
<input name="description" id="modal-volume-create-form-description" type="text" size="30" required="required" class="required" /> |
1063 |
<input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" /> |
1064 |
<span class="required">Required</span> |
1064 |
<span class="required">Required</span> |
1065 |
</p> |
1065 |
</p> |
1066 |
<p> |
1066 |
<p> |
1067 |
<label for="volume_display_order" class="required">Display order: </label> |
1067 |
<label for="item_group_display_order" class="required">Display order: </label> |
1068 |
<input name="display_order" id="modal-volume-create-form-display_order" value="0" size="5" required="required" class="required" /> |
1068 |
<input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" /> |
1069 |
<span class="required">Required</span> |
1069 |
<span class="required">Required</span> |
1070 |
<br/> |
1070 |
<br/> |
1071 |
<span class="hint">Numbers only, volumes will be displayed in counting order</span> |
1071 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1072 |
</p> |
1072 |
</p> |
1073 |
</fieldset> |
1073 |
</fieldset> |
1074 |
</div> |
1074 |
</div> |
1075 |
<div class="modal-footer"> |
1075 |
<div class="modal-footer"> |
1076 |
<button id="modal-volume-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button> |
1076 |
<button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button> |
1077 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1077 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1078 |
</div> |
1078 |
</div> |
1079 |
</form> |
1079 |
</form> |
Lines 1081-1110
Note that permanent location is a code, and location may be an authval.
Link Here
|
1081 |
</div> |
1081 |
</div> |
1082 |
</div> |
1082 |
</div> |
1083 |
|
1083 |
|
1084 |
<div class="modal fade" id="modal-volume-edit" tabindex="-1" role="dialog" aria-labelledby="modal-volume-edit-label"> |
1084 |
<div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label"> |
1085 |
<div class="modal-dialog"> |
1085 |
<div class="modal-dialog"> |
1086 |
<div class="modal-content"> |
1086 |
<div class="modal-content"> |
1087 |
<div class="modal-header"> |
1087 |
<div class="modal-header"> |
1088 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1088 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1089 |
<h3 id="modal-volume-edit-label"><i class='fa fa-edit'></i> Edit volume</h3> |
1089 |
<h3 id="modal-item-group-edit-label"><i class='fa fa-edit'></i> Edit item group</h3> |
1090 |
</div> |
1090 |
</div> |
1091 |
<form id="modal-volume-edit-form" class="validated"> |
1091 |
<form id="modal-item-group-edit-form" class="validated"> |
1092 |
<div class="modal-body"> |
1092 |
<div class="modal-body"> |
1093 |
<fieldset> |
1093 |
<fieldset> |
1094 |
<p> |
1094 |
<p> |
1095 |
<label for="volume_description" class="required">Name: </label> |
1095 |
<label for="item_group_description" class="required">Name: </label> |
1096 |
<input name="description" id="modal-volume-edit-form-description" type="text" size="30" required="required" class="required" /> |
1096 |
<input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" /> |
1097 |
<span class="required">Required</span> |
1097 |
<span class="required">Required</span> |
1098 |
</p> |
1098 |
</p> |
1099 |
<p> |
1099 |
<p> |
1100 |
<label for="volume_display_order" class="required">Sort order: </label> |
1100 |
<label for="item_group_display_order" class="required">Sort order: </label> |
1101 |
<input name="display_order" id="modal-volume-edit-form-display_order" size="5" /> |
1101 |
<input name="display_order" id="modal-item-group-edit-form-display_order" size="5" /> |
1102 |
<span class="hint">Numbers only, volumes will be displayed in counting order</span> |
1102 |
<span class="hint">Numbers only, item groups will be displayed in counting order</span> |
1103 |
</p> |
1103 |
</p> |
1104 |
</fieldset> |
1104 |
</fieldset> |
1105 |
</div> |
1105 |
</div> |
1106 |
<div class="modal-footer"> |
1106 |
<div class="modal-footer"> |
1107 |
<button id="modal-volume-edit-submit" class="btn btn-default"><i class='fa fa-edit'></i> Submit</button> |
1107 |
<button id="modal-item-group-edit-submit" class="btn btn-default"><i class='fa fa-edit'></i> Submit</button> |
1108 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1108 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1109 |
</div> |
1109 |
</div> |
1110 |
</form> |
1110 |
</form> |
Lines 1112-1150
Note that permanent location is a code, and location may be an authval.
Link Here
|
1112 |
</div> |
1112 |
</div> |
1113 |
</div> |
1113 |
</div> |
1114 |
|
1114 |
|
1115 |
<div class="modal fade" id="modal-volume-delete" tabindex="-1" role="dialog" aria-labelledby="modal-volume-delete-label"> |
1115 |
<div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label"> |
1116 |
<div class="modal-dialog"> |
1116 |
<div class="modal-dialog"> |
1117 |
<div class="modal-content"> |
1117 |
<div class="modal-content"> |
1118 |
<div class="modal-header"> |
1118 |
<div class="modal-header"> |
1119 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1119 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1120 |
<h3 id="modal-volume-delete-label"><i class='fa fa-trash'></i> Delete volume</h3> |
1120 |
<h3 id="modal-item-group-delete-label"><i class='fa fa-trash'></i> Delete item group</h3> |
1121 |
</div> |
1121 |
</div> |
1122 |
<div class="modal-body"> |
1122 |
<div class="modal-body"> |
1123 |
Are you sure you want to delete this volume? |
1123 |
Are you sure you want to delete this item group? |
1124 |
</div> |
1124 |
</div> |
1125 |
<div class="modal-footer"> |
1125 |
<div class="modal-footer"> |
1126 |
<button id="modal-volume-delete-submit" class="btn btn-danger"><i class='fa fa-trash'></i> Delete</button> |
1126 |
<button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash'></i> Delete</button> |
1127 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1127 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1128 |
</div> |
1128 |
</div> |
1129 |
</div> |
1129 |
</div> |
1130 |
</div> |
1130 |
</div> |
1131 |
</div> |
1131 |
</div> |
1132 |
|
1132 |
|
1133 |
<div class="modal fade" id="modal-volume-set" tabindex="-1" role="dialog" aria-labelledby="modal-volume-set-label"> |
1133 |
<div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label"> |
1134 |
<div class="modal-dialog"> |
1134 |
<div class="modal-dialog"> |
1135 |
<div class="modal-content"> |
1135 |
<div class="modal-content"> |
1136 |
<div class="modal-header"> |
1136 |
<div class="modal-header"> |
1137 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1137 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1138 |
<h3 id="modal-volume-set-label"><i class='fa fa-book'></i> Set volume for items</h3> |
1138 |
<h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3> |
1139 |
</div> |
1139 |
</div> |
1140 |
<form id="modal-volume-set-form" class="validated"> |
1140 |
<form id="modal-item-group-set-form" class="validated"> |
1141 |
<div class="modal-body"> |
1141 |
<div class="modal-body"> |
1142 |
<fieldset> |
1142 |
<fieldset> |
1143 |
<p> |
1143 |
<p> |
1144 |
<label for="volume" class="required">Volume: </label> |
1144 |
<label for="item_group" class="required">Item group: </label> |
1145 |
<select name="volume" id="volume-add-form-select"> |
1145 |
<select name="item_group" id="item-group-add-form-select"> |
1146 |
[% FOREACH v IN biblio.volumes %] |
1146 |
[% FOREACH ig IN biblio.item_groups %] |
1147 |
<option value="[% v.id | html %]">[% v.description | html %]</option> |
1147 |
<option value="[% ig.id | html %]">[% ig.description | html %]</option> |
1148 |
[% END %] |
1148 |
[% END %] |
1149 |
</select> |
1149 |
</select> |
1150 |
<span class="required">Required</span> |
1150 |
<span class="required">Required</span> |
Lines 1152-1158
Note that permanent location is a code, and location may be an authval.
Link Here
|
1152 |
</fieldset> |
1152 |
</fieldset> |
1153 |
</div> |
1153 |
</div> |
1154 |
<div class="modal-footer"> |
1154 |
<div class="modal-footer"> |
1155 |
<button id="modal-volume-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set volume</button> |
1155 |
<button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button> |
1156 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1156 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1157 |
</div> |
1157 |
</div> |
1158 |
</form> |
1158 |
</form> |
Lines 1160-1177
Note that permanent location is a code, and location may be an authval.
Link Here
|
1160 |
</div> |
1160 |
</div> |
1161 |
</div> |
1161 |
</div> |
1162 |
|
1162 |
|
1163 |
<div class="modal fade" id="modal-volume-unset" tabindex="-1" role="dialog" aria-labelledby="modal-volume-unset-label"> |
1163 |
<div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label"> |
1164 |
<div class="modal-dialog"> |
1164 |
<div class="modal-dialog"> |
1165 |
<div class="modal-content"> |
1165 |
<div class="modal-content"> |
1166 |
<div class="modal-header"> |
1166 |
<div class="modal-header"> |
1167 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1167 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1168 |
<h3 id="modal-volume-unset-label"><i class='fa fa-unlink'></i> Remove item from volume</h3> |
1168 |
<h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3> |
1169 |
</div> |
1169 |
</div> |
1170 |
<div class="modal-body"> |
1170 |
<div class="modal-body"> |
1171 |
Are you sure you want to remove these item(s) from their volume(s)? |
1171 |
Are you sure you want to remove these item(s) from their item group(s)? |
1172 |
</div> |
1172 |
</div> |
1173 |
<div class="modal-footer"> |
1173 |
<div class="modal-footer"> |
1174 |
<button id="modal-volume-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button> |
1174 |
<button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button> |
1175 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1175 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
1176 |
</div> |
1176 |
</div> |
1177 |
</div> |
1177 |
</div> |
Lines 1527-1535
Note that permanent location is a code, and location may be an authval.
Link Here
|
1527 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1527 |
if ( search_value ){ $('#cat-search-block #search-form').val(search_value)}; |
1528 |
}); |
1528 |
}); |
1529 |
|
1529 |
|
1530 |
[% IF Koha.Preference('EnableVolumes') %] |
1530 |
[% IF Koha.Preference('EnableItemGroups') %] |
1531 |
// Load volumes table |
1531 |
// Load item groups table |
1532 |
var volumesTable = KohaTable("volumes-table", { |
1532 |
var itemGroupsTable = KohaTable("items-group-table", { |
1533 |
"bAutoWidth": false, |
1533 |
"bAutoWidth": false, |
1534 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
1534 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
1535 |
"aoColumns": [ |
1535 |
"aoColumns": [ |
Lines 1545-1556
Note that permanent location is a code, and location may be an authval.
Link Here
|
1545 |
}, |
1545 |
}, |
1546 |
{ |
1546 |
{ |
1547 |
"mDataProp": function( oObj ) { |
1547 |
"mDataProp": function( oObj ) { |
1548 |
[% IF CAN_user_editcatalogue_manage_volumes %] |
1548 |
[% IF CAN_user_editcatalogue_manage_item_groups %] |
1549 |
return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'> |
1549 |
return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1550 |
<i class='fa fa-edit'></i> ${_("Edit")} |
1550 |
<i class='fa fa-edit'></i> ${_("Edit")} |
1551 |
</button>` |
1551 |
</button>` |
1552 |
+ ' ' |
1552 |
+ ' ' |
1553 |
+ `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'> |
1553 |
+ `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'> |
1554 |
<i class='fa fa-trash'></i> ${('Delete')} |
1554 |
<i class='fa fa-trash'></i> ${('Delete')} |
1555 |
</button>`; |
1555 |
</button>`; |
1556 |
[% ELSE %] |
1556 |
[% ELSE %] |
Lines 1562-1568
Note that permanent location is a code, and location may be an authval.
Link Here
|
1562 |
"bPaginate": false, |
1562 |
"bPaginate": false, |
1563 |
"bProcessing": true, |
1563 |
"bProcessing": true, |
1564 |
"bServerSide": false, |
1564 |
"bServerSide": false, |
1565 |
"sAjaxSource": `/api/v1/biblios/${biblionumber}/volumes?_per_page=-1`, |
1565 |
"sAjaxSource": `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1`, |
1566 |
"sAjaxDataProp": "", |
1566 |
"sAjaxDataProp": "", |
1567 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
1567 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
1568 |
$.getJSON( sSource, aoData, function (json) { |
1568 |
$.getJSON( sSource, aoData, function (json) { |
Lines 1571-1619
Note that permanent location is a code, and location may be an authval.
Link Here
|
1571 |
}, |
1571 |
}, |
1572 |
}); |
1572 |
}); |
1573 |
|
1573 |
|
1574 |
// Create new volumes |
1574 |
// Create new item groups |
1575 |
$('.volume-create').on('click', function(){ |
1575 |
$('.item-group-create').on('click', function(){ |
1576 |
$('#modal-volume-create-form-description').val(""); |
1576 |
$('#modal-item-group-create-form-description').val(""); |
1577 |
$('#modal-volume-create-submit').removeAttr('disabled'); |
1577 |
$('#modal-item-group-create-submit').removeAttr('disabled'); |
1578 |
$('#modal-volume-create').modal('show'); |
1578 |
$('#modal-item-group-create').modal('show'); |
1579 |
}); |
1579 |
}); |
1580 |
|
1580 |
|
1581 |
$("#modal-volume-create-form").validate({ |
1581 |
$("#modal-item-group-create-form").validate({ |
1582 |
submitHandler: function(form) { |
1582 |
submitHandler: function(form) { |
1583 |
$.ajax({ |
1583 |
$.ajax({ |
1584 |
url: `/api/v1/biblios/${biblionumber}/volumes`, |
1584 |
url: `/api/v1/biblios/${biblionumber}/item_groups`, |
1585 |
headers: { "x-koha-embed": "items" }, |
1585 |
headers: { "x-koha-embed": "items" }, |
1586 |
success: function(volumes){ |
1586 |
success: function(item_groups){ |
1587 |
$('#modal-volume-create-submit').attr('disabled', 'disabled'); |
1587 |
$('#modal-item-group-create-submit').attr('disabled', 'disabled'); |
1588 |
|
1588 |
|
1589 |
var settings = { |
1589 |
var settings = { |
1590 |
"url": `/api/v1/biblios/${biblionumber}/volumes`, |
1590 |
"url": `/api/v1/biblios/${biblionumber}/item_groups`, |
1591 |
"method": "POST", |
1591 |
"method": "POST", |
1592 |
"headers": { |
1592 |
"headers": { |
1593 |
"Content-Type": "application/json" |
1593 |
"Content-Type": "application/json" |
1594 |
}, |
1594 |
}, |
1595 |
"data": JSON.stringify( |
1595 |
"data": JSON.stringify( |
1596 |
{ |
1596 |
{ |
1597 |
"description": $("#modal-volume-create-form-description").val(), |
1597 |
"description": $("#modal-item-group-create-form-description").val(), |
1598 |
"display_order": $("#modal-volume-create-form-display_order").val(), |
1598 |
"display_order": $("#modal-item-group-create-form-display_order").val(), |
1599 |
} |
1599 |
} |
1600 |
), |
1600 |
), |
1601 |
}; |
1601 |
}; |
1602 |
|
1602 |
|
1603 |
$.ajax(settings) |
1603 |
$.ajax(settings) |
1604 |
.done(function (response) { |
1604 |
.done(function (response) { |
1605 |
$('#volume-add-form-select').append($('<option>', { |
1605 |
$('#item-group-add-form-select').append($('<option>', { |
1606 |
value: response.volume_id, |
1606 |
value: response.item_group_id, |
1607 |
text: response.description |
1607 |
text: response.description |
1608 |
})); |
1608 |
})); |
1609 |
|
1609 |
|
1610 |
$('#modal-volume-create').modal('hide'); |
1610 |
$('#modal-item-group-create').modal('hide'); |
1611 |
if ( volumes.length == 0 ) { |
1611 |
if ( item_groups.length == 0 ) { |
1612 |
// This bib has no previous volumes, reload the page |
1612 |
// This bib has no previous item groups, reload the page |
1613 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1613 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1614 |
} else { |
1614 |
} else { |
1615 |
// Has other volumes, just reload the table |
1615 |
// Has other item groups, just reload the table |
1616 |
volumesTable.api().ajax.reload(); |
1616 |
itemGroupsTable.api().ajax.reload(); |
1617 |
} |
1617 |
} |
1618 |
}) |
1618 |
}) |
1619 |
.fail(function(err) { |
1619 |
.fail(function(err) { |
Lines 1625-1653
Note that permanent location is a code, and location may be an authval.
Link Here
|
1625 |
} |
1625 |
} |
1626 |
}); |
1626 |
}); |
1627 |
|
1627 |
|
1628 |
$('#modal-volume-create').on('shown.bs.modal', function () { |
1628 |
$('#modal-item-group-create').on('shown.bs.modal', function () { |
1629 |
$('#modal-volume-create-form-description').focus(); |
1629 |
$('#modal-item-group-create-form-description').focus(); |
1630 |
}) |
1630 |
}) |
1631 |
|
1631 |
|
1632 |
// Edit existing volumes |
1632 |
// Edit existing item groups |
1633 |
$('body').on( 'click', '.volume-edit', function(){ |
1633 |
$('body').on( 'click', '.item-group-edit', function(){ |
1634 |
const volume_id = $(this).data('volume-id'); |
1634 |
const item_group_id = $(this).data('item-group-id'); |
1635 |
const url = `/api/v1/biblios/${biblionumber}/volumes/${volume_id}`; |
1635 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1636 |
$.get( url, function( data ) { |
1636 |
$.get( url, function( data ) { |
1637 |
$('#modal-volume-edit-form-description').val( data.description ); |
1637 |
$('#modal-item-group-edit-form-description').val( data.description ); |
1638 |
$('#modal-volume-edit-form-display_order').val( data.display_order ); |
1638 |
$('#modal-item-group-edit-form-display_order').val( data.display_order ); |
1639 |
$('#modal-volume-edit-submit').data('volume-id', volume_id ); |
1639 |
$('#modal-item-group-edit-submit').data('item-group-id', item_group_id ); |
1640 |
$('#modal-volume-edit-submit').removeAttr('disabled'); |
1640 |
$('#modal-item-group-edit-submit').removeAttr('disabled'); |
1641 |
$('#modal-volume-edit').modal('show'); |
1641 |
$('#modal-item-group-edit').modal('show'); |
1642 |
}); |
1642 |
}); |
1643 |
}); |
1643 |
}); |
1644 |
|
1644 |
|
1645 |
$("#modal-volume-edit-form").validate({ |
1645 |
$("#modal-item-group-edit-form").validate({ |
1646 |
submitHandler: function(form) { |
1646 |
submitHandler: function(form) { |
1647 |
$('#modal-volume-edit-submit').attr('disabled', 'disabled'); |
1647 |
$('#modal-item-group-edit-submit').attr('disabled', 'disabled'); |
1648 |
|
1648 |
|
1649 |
const volume_id = $('#modal-volume-edit-submit').data('volume-id'); |
1649 |
const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id'); |
1650 |
const url = `/api/v1/biblios/${biblionumber}/volumes/${volume_id}`; |
1650 |
const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`; |
1651 |
|
1651 |
|
1652 |
var settings = { |
1652 |
var settings = { |
1653 |
"url": url, |
1653 |
"url": url, |
Lines 1657-1672
Note that permanent location is a code, and location may be an authval.
Link Here
|
1657 |
}, |
1657 |
}, |
1658 |
"data": JSON.stringify( |
1658 |
"data": JSON.stringify( |
1659 |
{ |
1659 |
{ |
1660 |
"description": $("#modal-volume-edit-form-description").val(), |
1660 |
"description": $("#modal-item-group-edit-form-description").val(), |
1661 |
"display_order": $("#modal-volume-edit-form-display_order").val(), |
1661 |
"display_order": $("#modal-item-group-edit-form-display_order").val(), |
1662 |
} |
1662 |
} |
1663 |
), |
1663 |
), |
1664 |
}; |
1664 |
}; |
1665 |
|
1665 |
|
1666 |
$.ajax(settings) |
1666 |
$.ajax(settings) |
1667 |
.done(function (response) { |
1667 |
.done(function (response) { |
1668 |
$('#modal-volume-edit').modal('hide'); |
1668 |
$('#modal-item-group-edit').modal('hide'); |
1669 |
volumesTable.api().ajax.reload(); |
1669 |
itemGroupsTable.api().ajax.reload(); |
1670 |
}) |
1670 |
}) |
1671 |
.fail(function(err) { |
1671 |
.fail(function(err) { |
1672 |
var message = err.responseJSON.error; |
1672 |
var message = err.responseJSON.error; |
Lines 1675-1711
Note that permanent location is a code, and location may be an authval.
Link Here
|
1675 |
} |
1675 |
} |
1676 |
}); |
1676 |
}); |
1677 |
|
1677 |
|
1678 |
$('#modal-volume-edit').on('shown.bs.modal', function () { |
1678 |
$('#modal-item-group-edit').on('shown.bs.modal', function () { |
1679 |
$('#modal-volume-edit-form-description').focus(); |
1679 |
$('#modal-item-group-edit-form-description').focus(); |
1680 |
}) |
1680 |
}) |
1681 |
|
1681 |
|
1682 |
// Delete existing volumes |
1682 |
// Delete existing item groups |
1683 |
$('body').on( 'click', '.volume-delete', function(){ |
1683 |
$('body').on( 'click', '.item-group-delete', function(){ |
1684 |
const volume_id = $(this).data('volume-id'); |
1684 |
const item_group_id = $(this).data('item-group-id'); |
1685 |
$('#modal-volume-delete-submit').data('volume-id', volume_id ); |
1685 |
$('#modal-item-group-delete-submit').data('item-group-id', item_group_id ); |
1686 |
$('#modal-volume-delete-submit').removeAttr('disabled'); |
1686 |
$('#modal-item-group-delete-submit').removeAttr('disabled'); |
1687 |
$('#modal-volume-delete').modal('show'); |
1687 |
$('#modal-item-group-delete').modal('show'); |
1688 |
}); |
1688 |
}); |
1689 |
$("#modal-volume-delete-submit").on('click', function(){ |
1689 |
$("#modal-item-group-delete-submit").on('click', function(){ |
1690 |
$('#modal-volume-delete-submit').attr('disabled', 'disabled'); |
1690 |
$('#modal-item-group-delete-submit').attr('disabled', 'disabled'); |
1691 |
const volume_id = $("#modal-volume-delete-submit").data('volume-id'); |
1691 |
const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id'); |
1692 |
|
1692 |
|
1693 |
$.ajax({ |
1693 |
$.ajax({ |
1694 |
url: `/api/v1/biblios/${biblionumber}/volumes/${volume_id}`, |
1694 |
url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1695 |
headers: { "x-koha-embed": "items" }, |
1695 |
headers: { "x-koha-embed": "items" }, |
1696 |
success: function(volume_data){ |
1696 |
success: function(item_group_data){ |
1697 |
$.ajax({ |
1697 |
$.ajax({ |
1698 |
"url": `/api/v1/biblios/${biblionumber}/volumes/${volume_id}`, |
1698 |
"url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`, |
1699 |
"method": "DELETE", |
1699 |
"method": "DELETE", |
1700 |
}) |
1700 |
}) |
1701 |
.done(function (response) { |
1701 |
.done(function (response) { |
1702 |
$('#modal-volume-delete').modal('hide'); |
1702 |
$('#modal-item-group-delete').modal('hide'); |
1703 |
$(`#volume-add-form-select option[value='${volume_id}']`).remove(); |
1703 |
$(`#item-group-add-form-select option[value='${item_group_id}']`).remove(); |
1704 |
if ( volume_data.items === null ) { |
1704 |
if ( item_group_data.items === null ) { |
1705 |
// No items for this volume, we can just refresh the table |
1705 |
// No items for this item group, we can just refresh the table |
1706 |
volumesTable.api().ajax.reload(); |
1706 |
itemGroupsTable.api().ajax.reload(); |
1707 |
} else { |
1707 |
} else { |
1708 |
// This volume had items attached to it, we need to reload the page |
1708 |
// This item group had items attached to it, we need to reload the page |
1709 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1709 |
window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`); |
1710 |
} |
1710 |
} |
1711 |
}) |
1711 |
}) |
Lines 1717-1732
Note that permanent location is a code, and location may be an authval.
Link Here
|
1717 |
}); |
1717 |
}); |
1718 |
}); |
1718 |
}); |
1719 |
|
1719 |
|
1720 |
// Add item(s) to a volume |
1720 |
// Add item(s) to a item group |
1721 |
$('.itemselection_action_volume_set').on('click', function(){ |
1721 |
$('.itemselection_action_item_group_set').on('click', function(){ |
1722 |
$('#modal-volume-set').modal('show'); |
1722 |
$('#modal-item-group-set').modal('show'); |
1723 |
}); |
1723 |
}); |
1724 |
|
1724 |
|
1725 |
$("#modal-volume-set-form").validate({ |
1725 |
$("#modal-item-group-set-form").validate({ |
1726 |
submitHandler: function(form) { |
1726 |
submitHandler: function(form) { |
1727 |
$('#modal-volume-set-submit').attr('disabled', 'disabled'); |
1727 |
$('#modal-item-group-set-submit').attr('disabled', 'disabled'); |
1728 |
|
1728 |
|
1729 |
const volume_id = $('#volume-add-form-select').val(); |
1729 |
const item_group_id = $('#item-group-add-form-select').val(); |
1730 |
|
1730 |
|
1731 |
let itemnumbers = new Array(); |
1731 |
let itemnumbers = new Array(); |
1732 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1732 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
Lines 1734-1758
Note that permanent location is a code, and location may be an authval.
Link Here
|
1734 |
itemnumbers.push( itemnumber ); |
1734 |
itemnumbers.push( itemnumber ); |
1735 |
}); |
1735 |
}); |
1736 |
if (itemnumbers.length > 0) { |
1736 |
if (itemnumbers.length > 0) { |
1737 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_volume'; |
1737 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group'; |
1738 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1738 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1739 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1739 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1740 |
url += `&volume_id=${volume_id}`; |
1740 |
url += `&item_group_id=${item_group_id}`; |
1741 |
|
1741 |
|
1742 |
window.location.replace(url); |
1742 |
window.location.replace(url); |
1743 |
} |
1743 |
} |
1744 |
|
1744 |
|
1745 |
$('#modal-volume-set').modal('hide'); |
1745 |
$('#modal-item-group-set').modal('hide'); |
1746 |
} |
1746 |
} |
1747 |
}); |
1747 |
}); |
1748 |
|
1748 |
|
1749 |
// Remove item(s) from a volume |
1749 |
// Remove item(s) from an item group |
1750 |
$('.itemselection_action_volume_unset').on('click', function(){ |
1750 |
$('.itemselection_action_item_group_unset').on('click', function(){ |
1751 |
$('#modal-volume-unset').modal('show'); |
1751 |
$('#modal-item-group-unset').modal('show'); |
1752 |
}); |
1752 |
}); |
1753 |
|
1753 |
|
1754 |
$("#modal-volume-unset-submit").on('click', function(){ |
1754 |
$("#modal-item-group-unset-submit").on('click', function(){ |
1755 |
$('#modal-volume-unset-submit').attr('disabled', 'disabled'); |
1755 |
$('#modal-item-group-unset-submit').attr('disabled', 'disabled'); |
1756 |
|
1756 |
|
1757 |
let itemnumbers = new Array(); |
1757 |
let itemnumbers = new Array(); |
1758 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
1758 |
$("input[name='itemnumber'][type='checkbox']:checked").each(function() { |
Lines 1760-1773
Note that permanent location is a code, and location may be an authval.
Link Here
|
1760 |
itemnumbers.push( itemnumber ); |
1760 |
itemnumbers.push( itemnumber ); |
1761 |
}); |
1761 |
}); |
1762 |
if (itemnumbers.length > 0) { |
1762 |
if (itemnumbers.length > 0) { |
1763 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_volume'; |
1763 |
let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group'; |
1764 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1764 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
1765 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1765 |
url += '&biblionumber=[% biblionumber | uri %]'; |
1766 |
|
1766 |
|
1767 |
window.location.replace(url); |
1767 |
window.location.replace(url); |
1768 |
} |
1768 |
} |
1769 |
|
1769 |
|
1770 |
$('#modal-volume-unset').modal('hide'); |
1770 |
$('#modal-item-group-unset').modal('hide'); |
1771 |
}); |
1771 |
}); |
1772 |
[% END %] |
1772 |
[% END %] |
1773 |
</script> |
1773 |
</script> |