Bug 28418: Show template_id of MARC modification templates

This patch adds an "id" column to the table of MARC modification
templates. The table is now a DataTable with table settings, with the
new column hidden by default to preserve the existing configuration.

To test, apply the patch and restart services.

 - Go to Administration -> MARC modification templates.
 - If necessary, add two or more templates.
 - Confirm that table of templates displays as a DataTable, with all
   associated sorting, filtering, export, etc.
 - The "id" column should be hidden by default.
 - Confirm that column visibility controls work correctly.
 - Confirm that the table settings found under Administration -> Table
   settings work correctly to set the default visibility of the table
   columns.

Signed-off-by: Barbara Johnson  <barbara.johnson@bedfordtx.gov>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2021-05-21 18:10:14 +00:00 committed by Kyle M Hall
parent 572e72d467
commit c265428e13
3 changed files with 26 additions and 4 deletions

View File

@ -1525,6 +1525,18 @@ modules:
columnname: info
-
columnname: interface
marc-modification-templates:
templatest:
columns:
-
columnname: id
is_hidden: 1
-
columnname: template
-
columnname: actions
cannot_be_toggled: 1
cannot_be_modified: 1
notices:
lettert:
columns:

View File

@ -1,6 +1,7 @@
[% USE raw %]
[% USE JSON.Escape %]
[% USE Asset %]
[% USE TablesSettings %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>MARC modification templates &rsaquo; Tools &rsaquo; Koha</title>
@ -86,13 +87,15 @@
<table id="templatest">
<thead>
<tr>
<th>Id</th>
<th>Template</th>
<th class="noExport">Actions</th>
<th class="NoSort noExport">Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH TemplatesLoo IN TemplatesLoop %]
<tr>
<td>[% TemplatesLoo.template_id | html %]</td>
<td>[% TemplatesLoo.name | html %]</td>
<td class="actions">
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=[% TemplatesLoo.template_id | html %]&amp;op=select_template" ><i class="fa fa-fw fa-pencil"></i> Edit actions</a>
@ -352,12 +355,15 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% Asset.js("js/marc_modification_templates.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
columns_settings = [% TablesSettings.GetColumns('tools', 'marc-modification-templates', 'templatest', 'json') | $raw %];
[% IF ActionsLoop %]
var mmtas = [% ActionsLoop.json | $raw %]
[% END %]
</script>
[% Asset.js("js/marc_modification_templates.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

View File

@ -1,4 +1,4 @@
/* global __ */
/* global __ KohaTable columns_settings */
$(document).ready(function() {
window.modaction_legend_innerhtml = $("#modaction_legend").text();
window.action_submit_value = $("#action_submit").val();
@ -49,7 +49,7 @@ $(document).ready(function() {
}
if ( $("#conditional_comparison").val() == '' ) {
alert( __("The conditional comparison operator should be filled.") );
return false
return false;
}
if ( $("#conditional_value").val() == '' &&
( $("#conditional_comparison").val() == 'equals' || $("#conditional_comparison").val() == 'not_equals' ) ) {
@ -108,6 +108,10 @@ $(document).ready(function() {
editAction( mmta[0] );
updateAllEvery();
});
KohaTable("templatest", {
}, columns_settings);
});
function updateAllEvery(){