From 3f7d54d628671a82ac328581238855d7a134562b Mon Sep 17 00:00:00 2001
From: dbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 14 Jul 2010 21:08:32 +0000
Subject: [PATCH] Authority records get some fixed-field love in the MARC
 Editor

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16934 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/xul/staff_client/server/cat/marcedit.css |   4 +
 Open-ILS/xul/staff_client/server/cat/marcedit.js  | 102 +++++++++++++++++++++-
 Open-ILS/xul/staff_client/server/cat/marcedit.xul |  53 ++++++++++-
 3 files changed, 153 insertions(+), 6 deletions(-)

diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.css b/Open-ILS/xul/staff_client/server/cat/marcedit.css
index 7a4e9d546f..46627bf1bc 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.css
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.css
@@ -95,6 +95,10 @@ grid#leaderGrid[type="COM"] *[set~="COM"], grid#leaderGrid[type="COM"] *[set~="C
     visibility: visible;
 }
 
+grid#leaderGrid[type="AUT"] *[set~="AUT"], grid#leaderGrid[type="AUT"] *[set~="AUT"] + textbox {
+    visibility: visible;
+}
+
 grid#leaderGrid[type="MFHD"] *[set~="MFHD"], grid#leaderGrid[type="MFHD"] *[set~="MFHD"] + textbox {
     visibility: visible;
 }
diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 848d10ec23..61b2ae017b 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -671,6 +671,7 @@ var rec_type = {
     SCO : { Type : /[cd]{1}/,    BLvl : /[abcdms]{1}/ },
     REC : { Type : /[ij]{1}/,    BLvl : /[abcdms]{1}/ },
     COM : { Type : /[m]{1}/,    BLvl : /[abcdms]{1}/ },
+	AUT : { Type : /[z]{1}/,	BLvl : /.{1}/ },
     MFHD : { Type : /[uvxy]{1}/,  BLvl : /.{1}/ }
 };
 
@@ -909,6 +910,7 @@ var ff_pos = {
             SCO : {start : 6, len : 1, def : 'c' },
             REC : {start : 6, len : 1, def : 'i' },
             COM : {start : 6, len : 1, def : 'm' },
+            AUT : {start : 6, len : 1, def : 'z' },
             MFHD : {start : 6, len : 1, def : 'y' }
         }
     },
@@ -963,6 +965,7 @@ var ff_pos = {
             SCO : {start : 17, len : 1, def : ' ' },
             REC : {start : 17, len : 1, def : ' ' },
             COM : {start : 17, len : 1, def : ' ' },
+            AUT : {start : 17, len : 1, def : 'n' },
             MFHD : {start : 17, len : 1, def : 'u' }
         }
     },
@@ -1121,7 +1124,102 @@ var ff_pos = {
         _6 : {
             SER : {start : 16, len : 1, def : ' ' }
         }
-    }
+    },
+	"GeoDiv" : {
+		"_8" : {
+			"AUT" : {"start" : 6, "len" : 1, "def" : ' ' }
+		}
+	},
+	"Roman" : {
+		"_8" : {
+			"AUT" : {"start" : 7, "len" : 1, "def" : ' ' }
+		}
+	},
+	"CatLang" : {
+		"_8" : {
+			"AUT" : {"start" : 8, "len" : 1, "def" : ' ' }
+		}
+	},
+	"Kind" : {
+		"_8" : {
+			"AUT" : {"start" : 9, "len" : 1, "def" : ' ' }
+		}
+	},
+	"Rules" : {
+		"_8" : {
+			"AUT" : {"start" : 10, "len" : 1, "def" : ' ' }
+		}
+	},
+	"SHSys" : {
+		"_8" : {
+			"AUT" : {"start" : 11, "len" : 1, "def" : ' ' }
+		}
+	},
+	"SerType" : {
+		"_8" : {
+			"AUT" : {"start" : 12, "len" : 1, "def" : ' ' }
+		}
+	},
+	"SerNum" : {
+		"_8" : {
+			"AUT" : {"start" : 13, "len" : 1, "def" : ' ' }
+		}
+	},
+	"HeadMain" : {
+		"_8" : {
+			"AUT" : {"start" : 14, "len" : 1, "def" : ' ' }
+		}
+	},
+	"HeadSubj" : {
+		"_8" : {
+			"AUT" : {"start" : 15, "len" : 1, "def" : ' ' }
+		}
+	},
+	"HeadSer" : {
+		"_8" : {
+			"AUT" : {"start" : 16, "len" : 1, "def" : ' ' }
+		}
+	},
+	"TypeSubd" : {
+		"_8" : {
+			"AUT" : {"start" : 17, "len" : 1, "def" : ' ' }
+		}
+	},
+	"TypeGov" : {
+		"_8" : {
+			"AUT" : {"start" : 28, "len" : 1, "def" : ' ' }
+		}
+	},
+	"RefEval" : {
+		"_8" : {
+			"AUT" : {"start" : 29, "len" : 1, "def" : ' ' }
+		}
+	},
+	"RecUpd" : {
+		"_8" : {
+			"AUT" : {"start" : 31, "len" : 1, "def" : ' ' }
+		}
+	},
+	"NameDiff" : {
+		"_8" : {
+			"AUT" : {"start" : 32, "len" : 1, "def" : ' ' }
+		}
+	},
+	"Level" : {
+		"_8" : {
+			"AUT" : {"start" : 33, "len" : 1, "def" : ' ' }
+		}
+	},
+	"ModRec" : {
+		"_8" : {
+			"AUT" : {"start" : 38, "len" : 1, "def" : ' ' }
+		}
+	},
+	"CatSrc" : {
+		"_8" : {
+			"AUT" : {"start" : 39, "len" : 1, "def" : ' ' }
+		}
+	}
 };
 
 function recordType (rec) {
@@ -1234,7 +1332,7 @@ function fillFixedFields (rec) {
                         p = '_7';
                     }
 
-                    if (!value) {
+                    if (p && !value) {
                         for (var j = 0; j < ff_pos[name][p][rtype].len; j++) {
                             value += d;
                         }
diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.xul b/Open-ILS/xul/staff_client/server/cat/marcedit.xul
index 8edb07ca5a..1c91a6c5f5 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.xul
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.xul
@@ -180,13 +180,58 @@
                             <textbox id="File_tb" context="clipboard" class="plain" name="File" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
                         </row>
                         <row>
-                            <label name="Type" control="Type_tbmfhd" set="MFHD" value="Type" />
+                            <label name="Type" control="Type_tbmfhd" set="AUT MFHD" value="Type" />
                             <textbox id="Type_tbmfhd" context="clipboard" class="plain" name="Type" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
-                            <label name="ELvl" control="ELvl_tbmfhd" set="MFHD" value="ELvl" />
-                            <textbox id="Elvl_tbmfhd" context="clipboard" class="plain" name="ELvl" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
-                            <label name="Item" control="Item_tbmfhd" set="MFHD" value="Item" />
+                            <label name="ELvl" control="ELvl_tbmfhd" set="AUT MFHD" value="ELvl" />
+                            <textbox id="ELvl_tbmfhd" context="clipboard" class="plain" name="ELvl" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="Item" control="Item_tbmfhd" set="AUT MFHD" value="Item" />
                             <textbox id="Item_tbmfhd" context="clipboard" class="plain" name="Item" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="GeoDiv" control="GeoDiv_tb" set="AUT" value="GeoDiv" />
+                            <textbox id="GeoDiv_tb" context="clipboard" class="plain" name="GeoDiv" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="Roman" control="Roman_tb" set="AUT" value="Roman" />
+                            <textbox id="Roman_tb" context="clipboard" class="plain" name="Roman" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="CatLang" control="CatLang_tb" set="AUT" value="CatLang" />
+                            <textbox id="CatLang_tb" context="clipboard" class="plain" name="CatLang" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
                         </row>
+                        <row>
+                            <label name="Kind" control="Kind_tb" set="AUT" value="Kind" />
+                            <textbox id="Kind_tb" context="clipboard" class="plain" name="Kind" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="Rules" control="Rules_tb" set="AUT" value="Rules" />
+                            <textbox id="Rules_tb" context="clipboard" class="plain" name="Rules" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="SHSys" control="SHSys_tb" set="AUT" value="SHSys" />
+                            <textbox id="SHSys_tb" context="clipboard" class="plain" name="SHSys" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="SerType" control="SerType_tb" set="AUT" value="SerType" />
+                            <textbox id="SerType_tb" context="clipboard" class="plain" name="SerType" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="SerNum" control="SerNum_tb" set="AUT" value="SerNum" />
+                            <textbox id="SerNum_tb" context="clipboard" class="plain" name="SerNum" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="HeadMain" control="HeadMain_tb" set="AUT" value="HeadMain" />
+                            <textbox id="HeadMain_tb" context="clipboard" class="plain" name="HeadMain" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                        </row>
+                        <row>
+                            <label name="HeadSubj" control="HeadSubj_tb" set="AUT" value="HeadSubj" />
+                            <textbox id="HeadSubj_tb" context="clipboard" class="plain" name="HeadSubj" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="HeadSer" control="HeadSer_tb" set="AUT" value="HeadSer" />
+                            <textbox id="HeadSer_tb" context="clipboard" class="plain" name="HeadSer" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="TypeSubd" control="TypeSubd_tb" set="AUT" value="TypeSubd" />
+                            <textbox id="TypeSubd_tb" context="clipboard" class="plain" name="TypeSubd" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="TypeGov" control="TypeGov_tb" set="AUT" value="TypeGov" />
+                            <textbox id="TypeGov_tb" context="clipboard" class="plain" name="TypeGov" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="RefEval" control="RefEval_tb" set="AUT" value="RefEval" />
+                            <textbox id="RefEval_tb" context="clipboard" class="plain" name="RefEval" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="RecUpd" control="RecUpd_tb" set="AUT" value="RecUpd" />
+                            <textbox id="RecUpd_tb" context="clipboard" class="plain" name="RecUpd" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                        </row>
+                        <row>
+                            <label name="NameDiff" control="NameDiff_tb" set="AUT" value="NameDiff" />
+                            <textbox id="NameDiff_tb" context="clipboard" class="plain" name="NameDiff" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="Level" control="Level_tb" set="AUT" value="Level" />
+                            <textbox id="Level_tb" context="clipboard" class="plain" name="Level" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="ModRec" control="ModRec_tb" set="AUT" value="ModRec" />
+                            <textbox id="ModRec_tb" context="clipboard" class="plain" name="ModRec" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                            <label name="CatSrc" control="CatSrc_tb" set="AUT" value="CatSrc" />
+                            <textbox id="CatSrc_tb" context="clipboard" class="plain" name="CatSrc" maxlength="1" size="1" oninput="updateFixedFields(this);" onfocus="this.select();"/>
+                        </row>
+
                     </rows>
                 </grid>
             </vbox>
-- 
2.11.0