Bugzilla – Attachment 30782 Details for
Bug 12754
Add XSLT action to MARC modification templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12754: Template changes for run_xslt in marc mod templates
Bug-12754-Template-changes-for-runxslt-in-marc-mod.patch (text/plain), 8.63 KB, created by
Marcel de Rooy
on 2014-08-14 10:55:04 UTC
(
hide
)
Description:
Bug 12754: Template changes for run_xslt in marc mod templates
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-08-14 10:55:04 UTC
Size:
8.63 KB
patch
obsolete
>From 8e3c711e2c1c0ba25febc91d73cebb58fdeba5ca Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >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: >Go to Manage MARC modification templates. >Select a template. >Add, edit and delete actions, including the Run XSLT type. >--- > .../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</a></td> > <td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]">Delete</a></td> > </tr> >@@ -422,8 +445,12 @@ function setSelectByValue( selectId, value ) { > <option value="update_field">Add/Update</option> > <option value="move_field">Move</option> > <option value="copy_field">Copy</option> >+ <option value="run_xslt">Run XSLT</option> > </select> > >+ <span id="xslt_file_block"> >+ <input type="text" name="run_xslt" id="run_xslt" size="100"/> >+ </span> > <span id="field_number_block"> > <select name="field_number" id="field_number"> > <option value="0">All</option> >@@ -431,7 +458,7 @@ function setSelectByValue( selectId, value ) { > </select> > </span> > >- field(s) <input type="text" name="from_field" id="from_field" size="3" maxlength="3" /> <input type="text" name="from_subfield" id="from_subfield" size="1" maxlength="1" /> >+ <span id="from_field_inputs">field(s) <input type="text" name="from_field" id="from_field" size="3" maxlength="3" /> <input type="text" name="from_subfield" id="from_subfield" size="1" maxlength="1" /></span> > > <span name="with_value_block" id="with_value_block" style="display:none;"> > with value <input type="text" name="field_value" id="field_value" /> >diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl >index 4f9323f..f17f0f9 100755 >--- a/tools/marc_modification_templates.pl >+++ b/tools/marc_modification_templates.pl >@@ -69,8 +69,9 @@ if ( $op eq "create_template" ) { > my $conditional_value = $cgi->param('conditional_value'); > my $conditional_regex = ( $cgi->param('conditional_regex') eq 'on' ) ? 1 : 0; > my $description = $cgi->param('description'); >+ my $run_xslt = $cgi->param('run_xslt'); > >- if ($from_field) { >+ if ( $from_field || $run_xslt ) { > unless ($mmta_id) { > AddModificationTemplateAction( > $template_id, $action, >@@ -81,7 +82,8 @@ if ( $op eq "create_template" ) { > $to_regex_modifiers, $conditional, > $conditional_field, $conditional_subfield, > $conditional_comparison, $conditional_value, >- $conditional_regex, $description >+ $conditional_regex, $description, >+ $run_xslt, > ); > } > else { >@@ -94,11 +96,11 @@ if ( $op eq "create_template" ) { > $to_regex_modifiers, $conditional, > $conditional_field, $conditional_subfield, > $conditional_comparison, $conditional_value, >- $conditional_regex, $description >+ $conditional_regex, $description, >+ $run_xslt, > ); > } >- } >- else { >+ } else { > $template->param( error => 'no_from_field' ); > } > >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12754
:
30754
|
30756
|
30757
|
30758
|
30759
| 30782 |
30783
|
30784