Bugzilla – Attachment 23806 Details for
Bug 11004
Make xmlControlfield.js use the marcflavour syspref to look for XML files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files
Bug-11004---Make-xmlControlfieldjs-use-the-marcfla.patch (text/plain), 5.60 KB, created by
Jonathan Druart
on 2013-12-24 10:51:04 UTC
(
hide
)
Description:
Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-12-24 10:51:04 UTC
Size:
5.60 KB
patch
obsolete
>From e192114e845724be2d3e27a63a2bd90386a805fc Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Mon, 7 Oct 2013 15:14:08 +0200 >Subject: [PATCH] Bug 11004 - Make xmlControlfield.js use the marcflavour > syspref to look for XML files > >Currently, xmlControlfield.js is hard coded to look for XML files for MARC21: > > url: this.themelang + "/data/marc21_field_" + this.tagfield + ".xml", > >This patch makes this code use the value from the marcflavour syspref, as a >preparation for making the NORMARC value builders use the XML technique >employed by the MARC21 value builders for 006 and 008. > >To test: >- Make sure you have a MARC21 installation >- Set marcflavour = NORMARC >- Go to Cataloguing and start a new record with the default framework >- Open the value builders for 006 and 008 and observe that they still work, showing > the coded values for MARC21 >- Apply this patch >- Check the value builders for 006 and 008 and observe that you get a truncated view > with an empty "Select a type of material" dropdown >- Use e.g. the Net console in Firebug to observe requests to > http://localhost/intranet-tmpl/prog/en/data/normarc_field_008.xml > that result in a 404 status >- Set marcflavour = MARC21 >- Observe that the value builders for 006 and 008 are now fully working >- 006 and 008 should be the only value builders affected by this change, since > they are the only ones using xmlControlfield.js, but please also verify that > other value builders are still working as expected > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js | 5 +++-- > .../prog/en/modules/cataloguing/value_builder/marc21_field_006.tt | 2 +- > .../prog/en/modules/cataloguing/value_builder/marc21_field_008.tt | 2 +- > 3 files changed, 5 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 c02e700..89e8e97 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, themelang) >+ xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial, themelang, marcflavour) > { > this.tagfield = tagfield; > this.idMaterial = idMaterial; >@@ -179,6 +179,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) > this.h4_result = h4_result; > this.tr_result = tr_result; > this.themelang = themelang; >+ this.marcflavour = marcflavour.toLowerCase(); > };//xmlControlField > > >@@ -205,7 +206,7 @@ function changeH4Result(form, h4_result, tr_result, pos, value) > { > this.xmlDoc = $.ajax({ > type: "GET", >- url: this.themelang + "/data/marc21_field_" + this.tagfield + ".xml", >+ url: this.themelang + "/data/" + this.marcflavour + "_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 2824577..4a2263a 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', '', '[% themelang %]'); >+ objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang %]', '[% marcflavour %]'); > 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 b292991..6e5acb9 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', '', '[% themelang %]'); >+ objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang %]', '[% marcflavour %]'); > objXmlControlField.loadXmlValues(); > renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result")); > [% END %] >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11004
:
21848
|
23796
| 23806