From ebb57cd6c5114241b93b7f474057fbff5b60c48c Mon Sep 17 00:00:00 2001 From: Gus Date: Tue, 19 Jan 2016 23:33:14 +0000 Subject: [PATCH] Bug 14647: Make the file name extension dynamic on exporting records Test - 1. go to cgi-bin/koha/tools/export.pl 2. Check that both tabs ("Export bibliographic records & Rxport authority records") do the following 3. In Output format 4. When changing "File format" from dropdown it update "file name" 5. Still works with user inputted names Works as expected. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../prog/en/modules/tools/export.tt | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt index 5df6fb16bd..ba7e3f3e77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt @@ -210,14 +210,14 @@
Output format
  1. - -
  2. - +
@@ -316,6 +316,25 @@ e.preventDefault(); $(".branch_select").prop("checked",0); }); + + $('#output_format').change(function(){ + var filename = $('#filename').val(); + var file_name = filename.split("."); + var extension = $(this).val(); + if (extension == "iso2709") { + extension = "mrc"; + } + $('#filename').val(file_name[0] + "." + extension); + }); + $('#output_format_auth').change(function(){ + var filename_auth = $('#filename_auth').val(); + var file_name_auth = filename_auth.split("."); + var extension = $(this).val(); + if (extension == "iso2709") { + extension = "mrc"; + } + $('#filename_auth').val(file_name_auth[0] + "." + extension); + }); }); [% END %] -- 2.39.5