Browse Source

Bug 22191: Add column configuration to libraries administration

This patch adds column configuration to the table of libraries
in administration. No new defaults for the table are defined.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Administration -> Libraries
   - Test that the "Column visibility" button works to show and hide
     columns. The "actions" column should be excluded.
   - Test that export options (Excel, CSV, etc) exclude the "actions"
     column.
 - Go to Administration -> Columns settings and edit the default
   configuration of the libraries table. Confirm that these
   changes are reflected in libraries administration.

Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
Owen Leonard 5 years ago
committed by Nick Clemens
parent
commit
9371bec02e
  1. 19
      admin/columns_settings.yml
  2. 13
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

19
admin/columns_settings.yml

@ -157,6 +157,25 @@ modules:
cannot_be_toggled: 1
cannot_be_modified: 1
libraries:
libraries:
-
columnname: library_name
-
columnname: library_code
-
columnname: library_address
-
columnname: marc_organization_code
-
columnname: library_ip
-
columnname: is_pickup_location
-
columnname: actions
cannot_be_toggled: 1
cannot_be_modified: 1
catalogue:
detail:

13
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

@ -1,6 +1,7 @@
[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% USE ColumnsSettings %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Administration &rsaquo; Libraries
[% IF op == 'add_form' %]
@ -184,7 +185,7 @@
[% IF op == 'list' %]
<h3>Libraries</h3>
[% IF libraries.count %]
<table id="branchest">
<table id="libraries">
<thead>
<tr>
<th>Name</th>
@ -261,16 +262,18 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
<script>
var columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'libraries', 'libraries', 'json' ) | $raw %];
$(document).ready(function() {
$("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, {
KohaTable("libraries", {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
],
"iDisplayLength": 10,
"sPaginationType": "four_button"
}));
"sPaginationType": "four_button",
"exportColumns": [0,1,2,3,4,5]
}, columns_settings);
[% UNLESS library %]
$("#Aform").on("submit", function( event ) {

Loading…
Cancel
Save