@@ -, +, @@ the list view --- .../en/modules/tools/batch_record_modification.tt | 61 ++++++++++++++------ tools/batch_record_modification.pl | 4 +- 2 files changed, 45 insertions(+), 20 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -41,7 +41,24 @@ $(document).ready(function() { })); $("#mainformsubmit").click(function(){ - return submitBackgroundJob(document.getElementById("process")); + if ( $("#marc_modification_template_id").val() > 0 ) { + return submitBackgroundJob(document.getElementById("process")); + } + alert(_("Please select a modification template.")); + return false; + }); + + $("#marc_modification_template_id").change(function(){ + var url = "/cgi-bin/koha/svc/records/preview?" + var mmtid = $(this).val(); + $("a.preview").each(function(){ + $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid); + }); + }); + + $("a.preview").click(function(){ + // Equivalent to rel="gb_page_center[600,500]" + return GB_showCenter(_("Preview MARC"), this.href , 600, 500); }); }); @@ -138,12 +155,23 @@ $(document).ready(function() { [% ELSIF view == 'list' %] [% IF records %] - [% IF recordtype == 'biblio' %] -