Bugzilla – Attachment 51453 Details for
Bug 13438
Convert normarc framework plugins to new style (see also 10480)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13438: Fix report function in normarc_field_008 js
Bug-13438-Fix-report-function-in-normarcfield008-j.patch (text/plain), 3.67 KB, created by
Marcel de Rooy
on 2016-05-12 09:27:23 UTC
(
hide
)
Description:
Bug 13438: Fix report function in normarc_field_008 js
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-05-12 09:27:23 UTC
Size:
3.67 KB
patch
obsolete
>From cbdab5dd499cad1edd8908b1c392b54fb8b1fbb0 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 12 May 2016 11:20:44 +0200 >Subject: [PATCH] Bug 13438: Fix report function in normarc_field_008 js >Content-Type: text/plain; charset=utf-8 > >The report function did not deal well with undefined fields and >did not respect the length of all elements. > >NOTE: This is a quick fix for something that is currently broken. >A next (larger) step would be to bring it back to the approach in >the marc21 counterpart. > >Test plan: >Make sure that normarc_field_008.pl is connected to your field 008. >Click tag editor for 008, save some values and go back to tag editor. >Test different material types in the tag editor. >--- > .../cataloguing/value_builder/normarc_field_008.tt | 70 ++++++++++---------- > 1 file changed, 36 insertions(+), 34 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/normarc_field_008.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/normarc_field_008.tt >index 14101b1..05313f2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/normarc_field_008.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/normarc_field_008.tt >@@ -4481,40 +4481,42 @@ function pad4(s) { > } > > function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = >- document.f_pop.f1.value+ >- document.f_pop.f6.value+ >- // bug 2563 { >- ( document.f_pop.f710.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f710.value) )+ >- ( document.f_pop.f1114.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f1114.value) )+ >- // } >- document.f_pop.f1517.value+ >- document.f_pop.f18.value+ >- document.f_pop.f19.value+ >- document.f_pop.f20.value+ >- document.f_pop.f21.value+ >- document.f_pop.f22.value+ >- document.f_pop.f23.value+ >- document.f_pop.f24.value+ >- document.f_pop.f25.value+ >- document.f_pop.f26.value+ >- document.f_pop.f27.value+ >- document.f_pop.f28.value+ >- document.f_pop.f29.value+ >- document.f_pop.f30.value+ >- document.f_pop.f31.value+ >- document.f_pop.f32.value+ >- document.f_pop.f33.value+ >- document.f_pop.f34.value+ >- document.f_pop.f3537.value+ >- document.f_pop.f38.value+ >- document.f_pop.f39.value; >- self.close(); >- return false; >- } >- //]]> >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ >+ document.f_pop.f710.value = document.f_pop.f710.value.match(/^\s*$/)? " ": pad4(document.f_pop.f710.value); >+ document.f_pop.f1114.value = document.f_pop.f1114.value.match(/^\s*$/)? " ": pad4(document.f_pop.f1114.value); >+ >+ var str = ''; >+ var loopfields = [ 'f1', 'f6', 'f710', 'f1114', 'f1517', 'f18', 'f19', >+ 'f20', 'f21', 'f22', 'f23', 'f24', 'f25', 'f26', 'f27', 'f28', 'f29', >+ 'f30', 'f31', 'f32', 'f33', 'f34', 'f3537', 'f38', 'f39' ]; >+ for( var i=0; i<loopfields.length; i++ ) { >+ str= str + checkfield( loopfields[i] ); >+ } >+ field.value = str; >+ self.close(); >+ return false; >+} >+function checkfield(str) { >+ var len = 1, ret; >+ >+ if(str == 'f1') { >+ len = 6; // better name would be: f0005 >+ } else if( str == 'f710' ) { >+ len = 4; // better name would be: f0710 >+ } else if( str.length>3 ) { >+ len = 1 + parseInt(str.substr(3,2)) - parseInt(str.substr(1,2)); >+ } >+ >+ if( document.f_pop.elements.namedItem(str) ) { >+ ret = document.getElementsByName(str)[0].value + ' '; >+ } else { >+ ret = ' '; >+ } >+ return ret.substr(0, len); >+} >+//]]> > </script> > > [% INCLUDE 'popup-bottom.inc' %] >-- >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 13438
:
49823
|
49824
| 51453