From 390d1d5be6e59990bee85ed6e44f117a8cd19c54 Mon Sep 17 00:00:00 2001 From: preprod34 Date: Fri, 12 Aug 2011 11:44:33 -0400 Subject: [PATCH] Bug 6715 - Fix xmlControlfield.js so the xml files are fetched in the correct language directory. xmlControlfield.js was always fetching the "en" xml file, preventing the translations from working. http://bugs.koha-community.org/show_bug.cgi?id=6715 Signed-off-by: Katrin Fischer - Apply patch - Install language files, example: perl translate install de-DE - Edit .xml files for value builders 006 and 008 - Test by creating a new record and using value builders Signed-off-by: Chris Cormack --- koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js | 6 ++++-- .../modules/cataloguing/value_builder/marc21_field_006.tt | 2 +- .../modules/cataloguing/value_builder/marc21_field_008.tt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js index 5acb5fde7e..608b79bd67 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js @@ -168,7 +168,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) (function() { - xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial) + xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial, themelang) { this.tagfield = tagfield; this.idMaterial = idMaterial; @@ -178,6 +178,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) this.table = table; this.h4_result = h4_result; this.tr_result = tr_result; + this.themelang = themelang; };//xmlControlField @@ -192,6 +193,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) table: null, h4_result: "", tr_result: "", + themelang: "", setIdMaterial: function(idMaterial) @@ -203,7 +205,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) { this.xmlDoc = $.ajax({ type: "GET", - url: "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", + url: this.themelang + "/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", dataType: "xml", async: false }).responseXML; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt index 3c2e02cd1e..66a2a5a658 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt @@ -16,7 +16,7 @@ var form = document.f_pop; h4_result = document.getElementById("h4_result"); tr_result = document.getElementById("tr_result"); - objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', ''); + objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang %]'); objXmlControlField.loadXmlValues(); renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result")); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt index 8083c0fa0c..9561ae524e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt @@ -16,7 +16,7 @@ var form = document.f_pop; h4_result = document.getElementById("h4_result"); tr_result = document.getElementById("tr_result"); - objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', ''); + objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang %]'); objXmlControlField.loadXmlValues(); renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result")); [% END %] -- 2.39.5