<!ENTITY staff.cat.marcedit.toggleFFE.label "Fixed Fields -- Record type: ">
<!ENTITY staff.cat.marcedit.source.caption "Bibliographic source">
<!ENTITY staff.cat.marcedit.source.submit.label "Update source">
+<!ENTITY staff.cat.marcedit.phys_char_wizard.label "Physical Characteristics Wizard">
+<!ENTITY staff.cat.marcedit.phys_char_wizard.accesskey "W">
<!ENTITY staff.cat.marc_new.load.label "Load">
<!ENTITY staff.cat.marc_new.load.accesskey "L">
<!ENTITY staff.cat.marc_new.set_default.label "Set Workstation Default">
'EG_ACQ_USER_REQUESTS' : 'oils://remote/eg/acq/picklist/user_request',
'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul',
'XUL_SERIAL_PATTERN_WIZARD' : 'oils://remote/xul/server/serial/pattern_wizard.xul',
+ 'EG_MARCEDIT_PHYS_CHAR_WIZARD' : 'oils://remote/eg/cat/marcedit/phys_char_wizard',
'CUSTOM_JS' : '/xul/server/skin/custom.js',
'ACQ_LINEITEM' : 'oils://remote/eg/acq/lineitem/related/',
'SERIAL_LIST_SUBSCRIPTION' : 'oils://remote/eg/serial/list_subscription',
}
document.getElementById('save-button').setAttribute('label', window.xulG.save.label);
+ /* Ugh. Sorry about the spaghetti. */
document.getElementById('save-button').setAttribute('oncommand',
+ 'var to_save = function() { ' + /* begin to_save() */
'if ($("xul-editor").hidden) set_flat_editor(false); ' +
'mangle_005(); ' +
'var xml_string = xml_escape_unicode( xml_record.toXMLString() ); ' +
'save_attempt( xml_string ); ' +
- 'loadRecord();'
+ 'loadRecord(); ' +
+ '}; ' + /* end to_save() */
+
+ 'if (typeof _owPCW == "object") { ' +
+ ' for (var k in _owPCW) { ' +
+ ' if (_owPCW[k].active) { ' +
+ ' try { _owPCW[k].apply(to_save); to_save.ran = true; } ' +
+ ' catch (E) { alert("_ow_PCW[" + k + "]: " + E); } ' +
+ ' break; ' +
+ ' }' +
+ ' }' +
+ '} ' +
+ 'if (!to_save.ran) to_save();'
);
if (window.xulG.record.url) {
buildBibSourceList(authtoken, xulG.record.id);
}
+ preparePhysCharWizardContext();
dojo.require('MARC.FixedFields');
+ dojo.require("openils.widget.PhysCharWizard");
} catch(E) {
alert('FIXME, MARC Editor, my_init: ' + E);
return context_menu_id;
}
+/* This just sets up a special context menu for a 007 data field to use, so
+ * that users can right-click for a menu and get a choice to launch the
+ * Physical Characteristics Wizard.
+ */
+function preparePhysCharWizardContext() {
+ var menu = document.getElementById("physCharWizardContext");
+ menu.appendChild(document.createElement("menuseparator"));
+
+ var clipb_children = document.getElementById("clipboard").childNodes;
+ for (var i = 0; i < clipb_children.length; i++) /* collection not array */ {
+ var child = clipb_children[i];
+ if (child.nodeName == 'menuitem')
+ menu.appendChild(child.cloneNode(true));
+ }
+}
+
+function launchPhysCharWizard(popup_node) {
+ try {
+ new openils.widget.PhysCharWizard({
+ "node": popup_node,
+ "onapply": function(v) {
+ createControlField("007", v);
+ loadRecord();
+ }
+ });
+ } catch (E) {
+ alert("Exception raised by openils.widget.PhysCharWizard:\n" + E);
+ }
+}
+
function fillFixedFields () {
try {
var grid = document.getElementById('leaderGrid');
{ value : field.text(),
class : 'plain marcEditableControlfield',
name : 'CONTROL' + tagname,
- context : 'clipboard',
+ context : tagname == 7 ? 'physCharWizardContext': 'clipboard',
size : 50,
maxlength : 50 } )
);