From ca7c1b6ff1d79cbc222669d8d13a646879698c17 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 26 Aug 2014 11:14:33 +0200 Subject: [PATCH] Bug 12823: Alert about defining the SRU search field mappings This is a follow-up for report 6536 (SRU search targets). It will alert a user that saves a SRU server without field mappings. Test plan: Add a Z39.50 server. No confirm message. Add a SRU server without field mappings. Cancel the confirm. Add one field mapping. No confirm message. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- .../prog/en/modules/admin/z3950servers.tt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index f5f38252e6..c10a30aa28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -27,6 +27,16 @@ timeout: { number: true } } }); + $("#serverentry").submit(function( event ) { + // first test if show_sru_fields exists + if( $('#show_sru_fields').length && $('#show_sru_fields').val()=='' && !confirm( _("No SRU search field mappings have been defined. This means that all field searches will go through the whole record. Continue?"))) { + return false; + } + // copy show_sru_fields to hidden counterpart + $('#sru_fields').val( $('#show_sru_fields').val() ); + // enable recordtype to include field in post + $('#recordtype').prop('disabled',false); + }); }); //]]> -- 2.39.5