further fixes to null indicator handling in flat-text MARC editor
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 23 Dec 2010 15:14:10 +0000 (15:14 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 23 Dec 2010 15:14:10 +0000 (15:14 +0000)
[1] ensure that null indicators are converted to blanks
[2] fix glitch when supplying default indicator values

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19066 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/MARC/Field.js
Open-ILS/web/js/dojo/MARC/Record.js

index 1cc3422..c9a2359 100644 (file)
@@ -31,8 +31,8 @@ if(!dojo._hasResource["MARC.Field"]) {
         constructor : function(kwargs) {
             this.record = kwargs.record;
             this.tag = kwargs.tag;
-            this.ind1 = kwargs.ind1;
-            this.ind2 = kwargs.ind2;
+            this.ind1 = kwargs.ind1 || ' ';
+            this.ind2 = kwargs.ind2 || ' ';
             this.data = kwargs.data;
             if (kwargs.subfields) this.subfields = kwargs.subfields;
             else this.subfields = [];
index aca1aa0..3aea14c 100644 (file)
@@ -256,7 +256,7 @@ if(!dojo._hasResource["MARC.Record"]) {
                     }
                 } else {
                     if (current_line.substring(4,5) == me.delimiter) // add delimiters if they were left out
-                        current_line = current_line.substring(0,3) + '\\\\' + current_line.substring(4);
+                        current_line = current_line.substring(0,3) + ' \\\\' + current_line.substring(4);
 
                     var data = df_line_data(current_line);
                     if (!(data.substring(0,1) == me.delimiter)) data = me.delimiter + 'a' + data;