]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/cat/marcedit.xul
adding initial authority support to the MARC editor
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / cat / marcedit.xul
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3 <?xml-stylesheet href="marcedit.css" type="text/css"?>
4
5 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xhtml="http://www.w3.org/1999/xhtml" onload="try{my_init();loadRecord(xml_record);}catch(E){alert('FIXME: '+E);}">
6
7 <script src="marcedit.js" type="application/x-javascript; e4x=1"/>
8 <script src="/opac/common/js/CGI.js" type="application/x-javascript; e4x=1"/>
9
10 <groupbox flex="0">
11         <caption label="Options"/>
12         <hbox flex="1">
13                 <checkbox persist="checked" accesskey='s' label="Stack subfields" onclick="stackSubfields(this);" checked="false" id="stackSubfields"/>
14                 <button id="save-button"/>
15                 <button label="Help" oncommand="alert('Add Row: CTRL+Enter\nAdd Subfield: CTRL+D\nRemove Row: CTRL+Del\nRemove Subfield: SHIFT+Del');"/>
16         </hbox>
17 </groupbox>
18
19 <groupbox flex="1">
20         <caption label="MARC Record"/>
21         <vbox flex="1" style="overflow: auto;">
22                 <groupbox flex="0">
23                         <caption>
24                                 <label value="Fixed Fields -- Record type: " ondblclick="toggleFFE();"/>
25                                 <label id="recordTypeLabel" context="recordTypeMenu"/>
26                         </caption>
27                         <vbox flex="1">
28                                 <grid flex="0" id="leaderGrid" type="BKS" hidden="true" persist="hidden">
29                                         <columns>
30                                                 <column flex="1"/>
31                                                 <column flex="1"/>
32                                                 <column flex="1"/>
33                                                 <column flex="1"/>
34                                                 <column flex="1"/>
35                                                 <column flex="1"/>
36                                                 <column flex="1"/>
37                                                 <column flex="1"/>
38                                                 <column flex="1"/>
39                                                 <column flex="1"/>
40                                                 <column flex="1"/>
41                                                 <column flex="1"/>
42                                         </columns>
43                                         <rows>
44                                                 <row>
45                                                         <label name="Type" set="BKS SER VIS MIX MAP SCO REC COM" value="Type" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
46                                                         <textbox class="plain" name="Type" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
47                                                         <label name="ELvl" set="BKS SER VIS MIX MAP SCO REC COM" value="ELvl" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
48                                                         <textbox class="plain" name="ELvl" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
49                                                         <label name="Srce" set="BKS SER VIS MIX MAP SCO REC COM" value="Srce" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
50                                                         <textbox class="plain" name="Srce" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
51                                                         <label name="Audn" set="BKS VIS SCO REC COM" value="Audn" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
52                                                         <textbox class="plain" name="Audn" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
53                                                         <label name="Ctrl" set="BKS SER VIS MIX MAP SCO REC COM" value="Ctrl" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
54                                                         <textbox class="plain" name="Ctrl" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
55                                                         <label name="Lang" set="BKS SER VIS MIX MAP SCO REC COM" value="Lang" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
56                                                         <textbox class="plain" name="Lang" maxlength="3" size="3" oninput="updateFixedFields(this);"/>
57                                                 </row>
58                                                 <row>
59                                                         <label name="BLvl" set="BKS SER VIS MIX MAP SCO REC COM" value="BLvl" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
60                                                         <textbox class="plain" name="BLvl" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
61                                                         <label name="Form" set="BKS SER VIS MIX MAP SCO REC" value="Form" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
62                                                         <textbox class="plain" name="Form" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
63                                                         <label name="Conf" set="BKS SER" value="Conf" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
64                                                         <textbox class="plain" name="Conf" maxlength="4" size="4" oninput="updateFixedFields(this);"/>
65                                                         <label name="Biog" set="BKS" value="Biog" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
66                                                         <textbox class="plain" name="Biog" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
67                                                         <label name="MRec" set="BKS SER VIS MIX MAP SCO REC COM" value="MRec" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
68                                                         <textbox class="plain" name="MRec" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
69                                                         <label name="Ctry" set="BKS SER VIS MIX MAP SCO REC COM" value="Ctry" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
70                                                         <textbox class="plain" name="Ctry" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
71                                                 </row>
72                                                 <row>
73                                                         <label name="S/L" set="SER" value="S/L" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
74                                                         <textbox class="plain" name="S/L" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
75                                                         <label name="Cont" set="BKS SER" value="Cont" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
76                                                         <textbox class="plain" name="Cont" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
77                                                         <label name="GPub" set="BKS SER VIS MAP COM" value="GPub" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
78                                                         <textbox class="plain" name="GPub" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
79                                                         <label name="LitF" set="BKS" value="LitF" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
80                                                         <textbox class="plain" name="LitF" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
81                                                         <label name="Indx" set="BKS MAP" value="Indx" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
82                                                         <textbox class="plain" name="Indx" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
83                                                         <label name="Alph" set="SER" value="Alph" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
84                                                         <textbox class="plain" name="Alph" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
85                                                 </row>
86                                                 <row>
87                                                         <label name="Desc" set="BKS SER VIS MIX MAP SCO REC COM" value="Desc" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
88                                                         <textbox class="plain" name="Desc" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
89                                                         <label name="Ills" set="BKS" value="Ills" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
90                                                         <textbox class="plain" name="Ills" maxlength="4" size="4" oninput="updateFixedFields(this);"/>
91                                                         <label name="Fest" set="BKS" value="Fest" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
92                                                         <textbox class="plain" name="Fest" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
93                                                         <label name="DtSt" set="BKS SER VIS MIX MAP SCO REC COM" value="DtSt" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
94                                                         <textbox class="plain" name="DtSt" maxlength="1" size="1" oninput="updateFixedFields(this);"/>
95                                                         <label name="Date1" set="BKS SER VIS MIX MAP SCO REC COM" value="Date1" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
96                                                         <textbox class="plain" name="Date1" maxlength="4" size="4" oninput="updateFixedFields(this);"/>
97                                                         <label name="Date2" set="BKS SER VIS MIX MAP SCO REC COM" value="Date2" onclick="this.nextSibling.focus(); this.nextSibling.select();"/>
98                                                         <textbox class="plain" name="Date2" maxlength="4" size="4" oninput="updateFixedFields(this);"/>
99                                                 </row>
100                                         </rows>
101                                 </grid>
102                         </vbox>
103                 </groupbox>
104
105                 <grid id="recGrid">
106                         <columns>
107                                 <column/>
108                                 <column/>
109                                 <column/>
110                                 <column flex="1"/>
111                         </columns>
112                         <rows/>
113                 </grid>
114         </vbox>
115 </groupbox>
116
117 <grid name="authority-marc-template" hidden="true">
118         <columns>
119                 <column/>
120                 <column/>
121                 <column/>
122                 <column flex="1"/>
123         </columns>
124         <rows/>
125 </grid>
126
127 <popupset>
128         <popup id="recordTypeMenu" position="after_start">
129                 <menuitem label="BKS" oncommand="changeFFEditor('BKS');"/>
130                 <menuitem label="SER" oncommand="changeFFEditor('SER');"/>
131                 <menuitem label="VIS" oncommand="changeFFEditor('VIS');"/>
132                 <menuitem label="MIX" oncommand="changeFFEditor('MIX');"/>
133                 <menuitem label="MAP" oncommand="changeFFEditor('MAP');"/>
134                 <menuitem label="SCO" oncommand="changeFFEditor('SCO');"/>
135                 <menuitem label="REC" oncommand="changeFFEditor('REC');"/>
136                 <menuitem label="COM" oncommand="changeFFEditor('COM');"/>
137         </popup>
138 </popupset>
139
140 <script type="application/x-javascript; e4x=1"><![CDATA[
141
142 var xml_record;
143
144 function my_init() {
145         try {
146                 // Fake xulG for standalone...
147                 try {
148                         window.xulG.record;
149                 } catch (e) {
150                         window.xulG = {};
151                         window.xulG.record = {};
152                         window.xulG.save = {};
153
154                         window.xulG.save.label = 'Save Record';
155                         window.xulG.save.func = function (r) { alert(r); }
156
157                         var cgi = new CGI();
158                         var _rid = cgi.param('record');
159                         if (_rid) {
160                                 window.xulG.record.url = '/opac/extras/supercat/retrieve/marcxml/record/' + _rid;
161                         }
162                 }
163                 // End faking part...
164
165                 document.getElementById('save-button').setAttribute('label', window.xulG.save.label);
166                 document.getElementById('save-button').setAttribute('oncommand', 'window.xulG.save.func(xml_record.toXMLString())');
167
168                 if (window.xulG.record.url) {
169                         var req =  new XMLHttpRequest();
170                         req.open('GET',window.xulG.record.url,false);
171                         req.send(null);
172                         window.xulG.record.marc = req.responseText
173                 }
174
175                 xml_record = new XML( window.xulG.record.marc );
176
177                 // Get the tooltip xml all async like
178                 req =  new XMLHttpRequest();
179                 req.open('GET','marcedit-tooltips.xml',true);
180                 req.onreadystatechange = function () {
181                         if (req.readyState == 4) {
182                                 bib_data = new XML( req.responseText );
183                                 genToolTips();
184                         }
185                 }
186                 req.send(null);
187         } catch(E) {
188                 alert('FIXME, MARC Editor: ' + E);
189         }
190 }
191
192 ]]></script>
193
194 </window>
195
196
197