LP#1203792: Multiple 006/007 fields for MARC Editor user/simonmai/multiple_006_007_fields_marc_editor
authorSimon Hieu Mai <hieu.mai@mnsu.edu>
Tue, 23 Jul 2013 15:16:02 +0000 (10:16 -0500)
committerSimon Hieu Mai <hieu.mai@mnsu.edu>
Tue, 23 Jul 2013 15:16:02 +0000 (10:16 -0500)
This patch will make the MARC Edtior to support adding multiple 006/007 fields per bib record.

It changes the current "Add/Replace 006/007" of right-clicking drop down menu into "Add 006/007"
that lets staff add/edit multiple 006/007 fields.

To delete any these fields, just right click and select "Remove Row" as the way we've used to remove
other data fields.
Signed-off-by: Simon Hieu Mai <hieu.mai@mnsu.edu>
Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties

index 61b2667..6fd1a27 100644 (file)
@@ -904,7 +904,7 @@ function marcLeader (leader) {
 function marcControlfield (field) {
     tagname = field.@tag.toString().substr(2);
     var row;
-    if (tagname == '1' || tagname == '3' || tagname == '6' || tagname == '7' || tagname == '8') {
+    if (tagname == '1' || tagname == '3' || tagname == '8') {
         row = createRow(
             { class : 'marcControlfieldRow',
               tag : '_' + tagname },
@@ -932,7 +932,40 @@ function marcControlfield (field) {
                   context : 'clipboard',
                   size : 50,
                   maxlength : 50 } )
-            );
+        );
+    } else if (tagname == '6' || tagname == '7') {
+        row = createRow(
+            { class : 'marcControlfieldRow',
+              tag : '_' + tagname },
+            createMARCTextbox(
+                field.@tag,
+                { value : field.@tag,
+                  class : 'plain marcTag',
+                  name : 'marcTag',
+                  context : 'tags_popup',
+                  oninput : 'if (this.value.length == 3) { this.nextSibling.focus(); }',
+                  size : 3,
+                  maxlength : 3,
+                  onmouseover : 'current_focus = this; getTooltip(this, "tag");' } ),
+            createLabel(
+                { value : field.@ind1,
+                  class : 'marcInd1',
+                  onmouseover : 'getTooltip(this, "ind1");',
+                  tooltipid : 'tag' + field.@tag + 'ind1val' + field.@ind1 } ),
+            createLabel(
+                { value : field.@ind2,
+                  class : 'marcInd2',
+                  onmouseover : 'getTooltip(this, "ind2");',
+                  tooltipid : 'tag' + field.@tag + 'ind2val' + field.@ind2 } ),
+            createMARCTextbox(
+                field,
+                { value : field.text(),
+                  class : 'plain marcEditableControlfield',
+                  name : 'CONTROL' + tagname,
+                  context : 'clipboard',
+                  size : 50,
+                  maxlength : 50 } )
+        );
     } else {
         row = createRow(
             { class : 'marcControlfieldRow',
index f42ec10..bdb6f5f 100644 (file)
@@ -258,8 +258,8 @@ staff.cat.marcedit.marcTag.LDR.label=MARC Leader
 staff.cat.marcedit.add_row.label=Add Row
 staff.cat.marcedit.insert_row.label=Insert Row
 staff.cat.marcedit.remove_row.label=Remove Row
-staff.cat.marcedit.replace_006.label=Add/Replace 006
-staff.cat.marcedit.replace_007.label=Add/Replace 007
+staff.cat.marcedit.replace_006.label=Add 006
+staff.cat.marcedit.replace_007.label=Add 007
 staff.cat.marcedit.replace_008.label=Add/Replace 008
 staff.cat.marcedit.not_authority_field.label=Not a controlled subfield
 staff.cat.marcedit.apply_full.label=Apply Full Authority (1XX)