Bug 34913: Move item groups table to kohaTable
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commit f9687f28c018075758364ffb3d859d2477defdae) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
ad1c38b589
commit
a8018d568c
1 changed files with 17 additions and 21 deletions
|
@ -2221,22 +2221,24 @@
|
|||
|
||||
[% IF Koha.Preference('EnableItemGroups') %]
|
||||
// Load item groups table
|
||||
var itemGroupsTable = KohaTable("items-group-table", {
|
||||
"autoWidth": false,
|
||||
"dom": '<"top pager"ilp>t<"bottom pager"ip>r',
|
||||
"columns": [
|
||||
var itemGroupsTable = $("#items-group-table").kohaTable({
|
||||
autoWidth: false,
|
||||
dom: '<"top pager"ilp>t<"bottom pager"ip>r',
|
||||
columns: [
|
||||
{
|
||||
"data": function( oObj ) {
|
||||
return oObj.display_order;
|
||||
},
|
||||
data: "display_order",
|
||||
title: _("Display order"),
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
"data": function( oObj ) {
|
||||
return oObj.description;
|
||||
},
|
||||
data: "description",
|
||||
title: _("Description"),
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
"data": function( oObj ) {
|
||||
data: function( oObj ) {
|
||||
[% IF CAN_user_editcatalogue_manage_item_groups %]
|
||||
return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
|
||||
<i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
|
||||
|
@ -2249,18 +2251,12 @@
|
|||
return "";
|
||||
[% END %]
|
||||
},
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
},
|
||||
],
|
||||
"paginate": false,
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"ajax": `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1`,
|
||||
"sAjaxDataProp": "",
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
$.getJSON( sSource, aoData, function (json) {
|
||||
fnCallback(json)
|
||||
} );
|
||||
},
|
||||
paginate: false,
|
||||
ajax: { url: `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1` },
|
||||
});
|
||||
|
||||
// Create new item groups
|
||||
|
|
Loading…
Reference in a new issue