From a185968899cd72af803759664cd7a22bbbb4c832 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 13 Aug 2014 13:10:18 +0200 Subject: [PATCH] Bug 12754: Template changes for run_xslt in marc mod templates Content-Type: text/plain; charset=utf-8 Adds action Run XSLT to the admin template and script. Test plan: Add, edit and delete actions with/without xslt actions. --- .../modules/tools/marc_modification_templates.tt | 35 +++++++++++++++++-- tools/marc_modification_templates.pl | 12 ++++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt index 6253135..62cea86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -43,26 +43,41 @@ function onActionChange(selectObj) { show('field_number_block'); hide('with_value_block'); hide('to_field_block'); + show('from_field_inputs'); + hide('xslt_file_block'); break; case 'update_field': hide('field_number_block'); show('with_value_block'); hide('to_field_block'); + show('from_field_inputs'); + hide('xslt_file_block'); break; case 'move_field': show('field_number_block'); hide('with_value_block'); show('to_field_block'); + show('from_field_inputs'); + hide('xslt_file_block'); break; case 'copy_field': show('field_number_block'); hide('with_value_block'); show('to_field_block'); + show('from_field_inputs'); + hide('xslt_file_block'); break; + case 'run_xslt': + hide('field_number_block'); + hide('with_value_block'); + hide('to_field_block'); + hide('from_field_inputs'); + show('xslt_file_block'); + break; } } @@ -165,7 +180,7 @@ var action_submit_value; function editAction( mmta_id, ordering, action, field_number, from_field, from_subfield, field_value, to_field, to_subfield, to_regex_search, to_regex_replace, to_regex_modifiers, conditional, conditional_field, conditional_subfield, - conditional_comparison, conditional_value, conditional_regex, description + conditional_comparison, conditional_value, conditional_regex, description, run_xslt ) { document.getElementById('mmta_id').value = mmta_id; @@ -200,6 +215,7 @@ function editAction( mmta_id, ordering, action, field_number, from_field, from_s document.getElementById('conditional_regex').checked = parseInt( conditional_regex ); document.getElementById('description').value = description; + document.getElementById('run_xslt').value = run_xslt; window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerHTML; document.getElementById('modaction_legend').innerHTML = _("Edit action %s").format(ordering); @@ -244,6 +260,8 @@ function cancelEditAction() { document.getElementById('modaction_legend').innerHTML = window.modaction_legend_innerhtml; document.getElementById('action_submit').value = window.action_submit_value; + $("#description").val(""); + hide('cancel_edit'); } @@ -349,7 +367,11 @@ function setSelectByValue( selectId, value ) { [% END %] [% END %] - field + [% IF ActionsLoo.run_xslt %] + Run [% ActionsLoo.run_xslt %] + [% ELSE %] + field + [% END %] [% ActionsLoo.from_field %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield %][% END %] @@ -401,7 +423,8 @@ function setSelectByValue( selectId, value ) { "[% ActionsLoo.conditional_comparison |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", "[% ActionsLoo.conditional_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", "[% ActionsLoo.conditional_regex |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", - "[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]" + "[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", + "[% ActionsLoo.run_xslt %]" )'>Edit Delete @@ -422,8 +445,12 @@ function setSelectByValue( selectId, value ) { + + + + - field(s) + field(s)