From 0f97c96d05b67439c1617cf43c5de88e26cb666b Mon Sep 17 00:00:00 2001 From: preprod34 Date: Fri, 12 Aug 2011 11:44:33 -0400 Subject: [PATCH] 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. --- .../intranet-tmpl/prog/en/js/xmlControlfield.js | 6 ++++-- .../cataloguing/value_builder/marc21_field_006.tt | 2 +- .../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 5acb5fd..608b79b 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 3c2e02c..66a2a5a 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 8083c0f..9561ae5 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 %] -- 1.5.6.5