+++ /dev/null
-VERSION=0.1.0
-PACKAGE=Evergreen
-DESCRIPTION=Evergreen Staff Client
-BUILD=2005072719
-
-RETRIEVE_FIELDMAPPER=wget -N http://dev.gapines.org/opac/common/js/util/fieldmapper.js
-RETRIEVE_FM_ALL=wget -N http://dev.gapines.org/opac/common/js/fmall.js
-RETRIEVE_ORG_TREE=wget -N http://dev.gapines.org/opac/common/js/OrgTree.js
-RETRIEVE_CLIENT_CONFIG=cp ../../../../../../OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml .
-
-all: build package
- @echo
- @echo How do makefiles work again?
- @echo BUILD = ${BUILD}
- touch application.ini
-
-build: generated open-ils patron circ
- @echo
- @echo Everything before packaging
-
-package: evergreen.xpi
- @echo
- @echo Packaging
-
-stamp:
- sed -i s/^Version=.\*/Version=${VERSION}/ application.ini
- sed -i s/^BuildID=.\*/BuildID=${BUILD}/ application.ini
- sed -i s/^Name=.\*/Name=${PACKAGE}/ application.ini
- sed -i 's/<em:version>.*<\/em:version>/<em:version>${VERSION}<\/em:version>/' install.rdf
- sed -i 's/<em:name>.*<\/em:name>/<em:name>${PACKAGE}<\/em:name>/' install.rdf
- sed -i 's/<em:description>.*<\/em:description>/<em:description>${DESCRIPTION}<\/em:description>/' install.rdf
- sed -i "s/extVersion: '.\*'/extVersion: '${VERSION}'/" install.js
- sed -i "s/extFullName: '.\*'/extFullName: '${DESCRIPTION}'/" install.js
- sed -i 's/auth\.title ".*"/auth\.title "${DESCRIPTION}"/' chrome/locale/en-US/evergreen/auth.dtd
- sed -i 's/auth\.version ".*"/auth\.version "${PACKAGE} ${VERSION} ${BUILD}"/' chrome/locale/en-US/evergreen/auth.dtd
-
-generated:
- @echo
- @echo These things are installation specific. The staff client is the last thing you should try to build.
- #(cd chrome/content/evergreen/util ; ${RETRIEVE_FIELDMAPPER} );
- (cd chrome/content/evergreen/Open-ILS/util/ ; ${RETRIEVE_ORG_TREE} );
- (cd chrome/content/evergreen/conf ; ${RETRIEVE_CLIENT_CONFIG} );
- (cd chrome/content/evergreen/Open-ILS/util/ ; ${RETRIEVE_FM_ALL} );
-
-open-ils:
- cp ../../OpenSRF/src/javascript/*.js chrome/content/evergreen/OpenSRF/
- cp ../../Open-ILS/web/opac/common/js/*.js chrome/content/evergreen/Open-ILS/util/
- #cp ../../Open-ILS/src/javascript/widgets/*.js chrome/content/evergreen/Open-ILS/widgets/
- #cp ../../Open-ILS/src/javascript/widgets/menu/*.js chrome/content/evergreen/Open-ILS/widgets/menu/
-
-patron:
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_items/g | sed s/PagedTree/PatronItems/g > chrome/content/evergreen/patron/patron_items_overlay.xul )
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_search_results/g | sed s/PagedTree/PatronSearchResults/g > chrome/content/evergreen/patron/patron_search_results_overlay.xul )
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_checkout_items/g | sed s/PagedTree/PatronCheckoutItems/g > chrome/content/evergreen/patron/patron_checkout_items_overlay.xul )
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_holds/g | sed s/PagedTree/PatronHolds/g > chrome/content/evergreen/patron/patron_holds_overlay.xul )
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_items.dtd)
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_search_results.dtd)
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_checkout_items.dtd)
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_holds.dtd)
-
-circ:
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/checkin_items/g | sed s/PagedTree/CheckinItems/g > chrome/content/evergreen/circ/checkin_items_overlay.xul )
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/checkin_items.dtd)
- (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/hold_capture_items/g | sed s/PagedTree/HoldCaptureItems/g > chrome/content/evergreen/circ/hold_capture_items_overlay.xul )
- (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/hold_capture_items.dtd)
-
-evergreen.xpi: evergreen.jar
- @echo
- @echo make the xpi file
- zip -r evergreen.xpi chrome/ defaults/ install.js install.rdf application.ini Makefile LICENSE README -x \*CVS\* > /dev/null
-
-evergreen.jar: build
- @echo
- @echo make the jar file
- (cd chrome; zip -r evergreen.jar content/ locale/ skin/ -x \*CVS\* > /dev/null )
-
-clean:
- @echo
- @echo delete derived files
- rm -f evergreen.xpi
- rm -f chrome/evergreen.jar
- rm -f chrome/content/evergreen/patron/patron_items_overlay.xul chrome/locale/en-US/evergreen/patron_items.dtd
- rm -f chrome/content/evergreen/patron/patron_search_results_overlay.xul chrome/locale/en-US/evergreen/patron_search_results.dtd
- rm -f chrome/content/evergreen/patron/patron_checkout_items_overlay.xul chrome/locale/en-US/evergreen/patron_checkout_items.dtd
- rm -f chrome/content/evergreen/patron/patron_holds_overlay.xul chrome/locale/en-US/evergreen/patron_holds.dtd
- rm -f chrome/content/evergreen/circ/checkin_items_overlay.xul chrome/locale/en-US/evergreen/checkin_items.dtd
- rm -f chrome/content/evergreen/circ/hold_capture_items_overlay.xul chrome/locale/en-US/evergreen/hold_capture_items.dtd
- rm -f chrome/content/evergreen/conf/client_config.xml
- rm -f chrome/content/evergreen/util/fieldmapper.js
- rm -f chrome/content/evergreen/util/OrgTree.js
- rm -f chrome/content/evergreen/OpenSRF/*js
- rm -f chrome/content/evergreen/Open-ILS/util/*js
- rm -f chrome/content/evergreen/Open-ILS/widgets/*js
- rm -f chrome/content/evergreen/Open-ILS/widgets/menu/*js
+++ /dev/null
-This part of the tree is deprecated.. it was a previous incarnation of the staff client now at ILS/Open-ILS/xul/staff_client/
+++ /dev/null
-[App]
-; Modified by Jason for Evergreen
-; This file is used by XUL Runner like so: xulrunner ./application.ini
-;
-; This field specifies your organization's name. This field is recommended,
-; but optional.
-Vendor=PINES
-;
-; This field specifies your application's name. This field is required.
-Name=Evergreen
-;
-; This field specifies your application's version. This field is optional.
-Version=0.1.0
-;
-; This field specifies your application's build ID (timestamp). This field is
-; required.
-BuildID=2005072719
-;
-; This field specifies a compact copyright notice for your application. This
-; field is optional.
-Copyright=Copyright (c) 2005 GPLS/PINES
-;
-; This ID is just an example. Every XUL app ought to have it's own unique ID.
-; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
-; irc.mozilla.org and /msg botbot uuid. This field is optional.
-ID={c3dd711b-c9b4-4785-b8f8-6157149c8905}
-
-[Gecko]
-;
-; This field is required. It specifies the minimum Gecko version that this
-; application requires. Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MinVersion=1.8
-;
-; This field is optional. It specifies the maximum Gecko version that this
-; application requires. It should be specified if your application uses
-; unfrozen interfaces. Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MaxVersion=1.9
+++ /dev/null
-content evergreen jar:evergreen.jar!/content/evergreen/
-locale evergreen en-US jar:evergreen.jar!/locale/en-US/evergreen/
-skin evergreen evergreen jar:evergreen.jar!/skin/evergreen/
+++ /dev/null
-function OpenILS_init(params) {
- sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg,function(i,o){try{return [i,o.toString()];}catch(E){return [i,o];}}))' }));
-
- try {
-
- switch(params.app) {
- case 'Auth' : auth_init(params); break;
- case 'AppShell' : app_shell_init(params); register_AppShell(params.w); break;
- case 'Opac' : opac_init(params); break;
- case 'PatronSearch' : patron_search_init(params); break;
- case 'PatronDisplay' : patron_display_init(params); break;
- case 'Checkin' : checkin_init(params); break;
- case 'HoldCapture' : hold_capture_init(params); break;
- }
-
- } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-
- try {
-
- //register_document(params.w.document);
- register_window(params.w);
-
- } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function OpenILS_exit(params) {
- sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg,function(i,o){try{return [i,o.toString()];}catch(E){return [i,o];}}))' }));
-
- /*
- try {
-
- switch(params.app) {
- case 'Auth' : auth_exit(params); break;
- case 'AppShell' : app_shell_exit(params); unregister_AppShell(params.w); break;
- case 'Opac' : opac_exit(params); break;
- case 'PatronSearch' : patron_search_exit(params); break;
- case 'PatronDisplay' : patron_display_exit(params); break;
- case 'Checkin' : checkin_exit(params); break;
- case 'HoldCapture' : hold_capture_exit(params); break;
- }
-
- } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
- */
-
- try {
-
- // buggy for now
- //unregister_document(params.w.document);
- unregister_window(params.w);
-
- } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-
- sdump('D_TRACE','Exiting OpenILS_exit\n');
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenILS_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/Open-ILS/OpenILS_scripts_overlay.xul"?>
-
- <OpenILS id="OpenILS_js">
-
- <!-- OpenSRF -->
- <script>
- <![CDATA[
- var myPackageDir = "evergreen"; var ses; dump('Loading all the js in the OpenILS overlay...\n');
- /*
- Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService).registerListener(
- {
- observe: function( msg ) {
- if (! msg.message.match( /delta/ ) ) {
- var s = '';
- for (var i in msg) {
- s += 'msg.' + i + ' = ' + msg[i] + '\n';
- }
- alert(s);
- }
- },
- QueryInterface: function (iid) {
- if (!iid.equals(Components.interfaces.nsIConsoleListener)
- && !iid.equals(Components.interfaces.nsISupports)) {
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- return this;
- }
- }
- );
- */
- ]]>
- </script>
- <OpenSRF id="OpenSRF_js" />
-
- <util id="util_js" />
-
- <apps id="apps_js" />
-
- </OpenILS>
-
- <stringbundleset id="string_bundles">
- <stringbundle id="main_strings" src="chrome://evergreen/locale/OpenILS.properties"/>
- <!-- <stringbundle id="patron_strings" src="chrome://evergreen/locale/patron.properties"/> -->
- </stringbundleset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenILS_scripts_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <apps id="apps_js">
- <script src="chrome://evergreen/content/Open-ILS/OpenILS.js" />
- <script src="chrome://evergreen/content/auth/auth.js" />
- <script src="chrome://evergreen/content/main/app_shell.js" />
- <script src="chrome://evergreen/content/main/clam_shell.js" />
- <script src="chrome://evergreen/content/main/paged_tree.js" />
- <script src="chrome://evergreen/content/main/grid_list.js" />
- <script src="chrome://evergreen/content/main/list_box.js" />
- <script src="chrome://evergreen/content/opac/opac.js" />
- <script src="chrome://evergreen/content/patron/patron_utils.js" />
- <script src="chrome://evergreen/content/patron/patron_search.js" />
- <script src="chrome://evergreen/content/patron/patron_search_form.js" />
- <script src="chrome://evergreen/content/patron/patron_search_results.js" />
- <script src="chrome://evergreen/content/patron/patron_display.js" />
- <script src="chrome://evergreen/content/patron/patron_checkout_items.js" />
- <script src="chrome://evergreen/content/patron/patron_items.js" />
- <script src="chrome://evergreen/content/patron/patron_holds.js" />
- <script src="chrome://evergreen/content/patron/patron_bills.js" />
- <script src="chrome://evergreen/content/patron/patron_edit.js" />
- <script src="chrome://evergreen/content/circ/circ_utils.js" />
- <script src="chrome://evergreen/content/circ/checkin.js" />
- <script src="chrome://evergreen/content/circ/checkin_items.js" />
- <script src="chrome://evergreen/content/circ/hold_capture.js" />
- <script src="chrome://evergreen/content/circ/hold_capture_items.js" />
- </apps>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenSRF"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<OpenSRF id="OpenSRF_js">
- <script>dump('Loading all the js in the OpenSRF overlay...\n');</script>
- <!--
- <script src="JSON.js" />
- <script src="md5.js" />
- <script src="opensrf_utils.js" />
- <script src="opensrf_config.js" />
- <script src="opensrf_dom_element.js" />
- <script src="opensrf_domain_object.js" />
- <script src="opensrf_transport.js" />
- <script src="opensrf_jabber_transport.js" />
- <script src="opensrf_msg_stack.js" />
- <script src="opensrf_app_session.js" />
- -->
-</OpenSRF>
-
-</overlay>
+++ /dev/null
-// the master Global variable
-var G = {
-/////////////////////////////////////////////////////////////////////////////////////
-
- // pointer to the auth window
- 'main_window' : self,
-
- // list of open window references, used for debugging in shell
- 'win_list' : [],
-
- // list of Top Level menu interface window references
- 'appshell_list' : [],
-
- // list of documents for debugging. BROKEN
- 'doc_list' : [],
-
- // Windows need unique names. This number helps.
- 'window_name_increment' : 0,
-
- // This number gets put into the title bar for Top Level menu interface windows
- 'appshell_name_increment' : 0,
-
- // I was using this to make sure I could shove references into new windows
- // correctly. However, it's JSON that tends to behave weirdly when crossing
- // window boundaries. [ 'a', 'b', 'c' ] could turn into { '1' : 'a', '2' : 'b',
- 'main_test_variable' : 'Hello World',
-
-/////////////////////////////////////////////////////////////////////////////////////
-
- // Flag for whether the staff client should act as if it were offline or not
- 'offline' : false,
-
- // Array of Session Keys. This is an array mostly by accident, we usually
- // only deal with one session. But this could be useful for implementing
- // overrides with other logins.
- 'auth_ses' : [],
-
- // Org Unit for the login user
- 'user_ou' : '',
-
- // The related org units for the login user
- 'my_orgs' : [], 'my_orgs_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
- // The Org Unit tree
- 'org_tree' : '', 'org_tree_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
- // Historically, was the list of actor::profile's, but now it's user groups.
- 'ap_list' : [], 'ap_hash' : {},
-
- // config::identification_type
- 'cit_list' : [], 'cit_hash' : {},
-
- // config::standing
- 'cst_list' : [], 'cst_hash' : {},
-
- // assett::copy_location, and for my_orgs
- 'acpl_list' : [], 'acpl_hash' : {},
- 'acpl_my_orgs' : [], 'acpl_my_orgs_hash' : {},
-
- // actor::org_unit_type
- 'aout_list' : [], 'aout_hash' : {},
-
- // config::copy_status
- 'ccs_list' : [], 'ccs_hash' : {},
-
- // asset::stat_cat. WHERE IS THIS POPULATED AGAIN?
- 'asc_list' : [],
-
- // actor::stat_cat
- 'actsc_list' : [], 'actsc_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
- 'itemsout_header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!\r\nYou have the following items:<hr/><ol>',
- 'itemsout_line_item' : '<li>%TITLE: 50%\r\nBarcode: %COPY_BARCODE% Due: %DUE_D%\r\n',
- 'itemsout_footer' : '</ol><hr />%PINES_CODE% %TODAY%\r\nYou were helped by %STAFF_FIRSTNAME% %STAFF_LASTNAME%',
-
- 'checkout_header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!\r\nYou checked out the following items:<hr/><ol>',
- 'checkout_line_item' : '<li>%TITLE%\r\nBarcode: %COPY_BARCODE% Due: %DUE_D%\r\n',
- 'checkout_footer' : '</ol><hr />%PINES_CODE% %TODAY%\r\nYou were helped by %STAFF_FIRSTNAME% %STAFF_LASTNAME%'
-
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-};
-
-var debug_ignore_auth_failures = false;
-
-var mw = G['main_window'];
-var auth_meter_incr = 10;
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-function auth_init() {
- sdump('D_AUTH','TESTING: auth.js: ' + mw.G['main_test_variable'] + '\n');
- sdump('D_AUTH',arg_dump(arguments));
-
- var np = document.getElementById('name_prompt');
- np.addEventListener("keypress",handle_keypress,false);
- np.focus();
- var pp = document.getElementById('password_prompt');
- pp.addEventListener("keypress",handle_keypress,false);
- self.addEventListener("unload",nice_shutdown,false);
-
- G['sound'] = xp_sound_init(); snd_logon();
- var pref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- if (pref) {
- pref.setCharPref("capability.principal.codebase.p0.granted", "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
- pref.setCharPref("capability.principal.codebase.p0.id", "http://dev.gapines.org");
- }
-}
-
-function handle_keypress(ev) {
- if (ev.keyCode && ev.keyCode == 13) {
- switch(this) {
- case document.getElementById('name_prompt') :
- ev.preventDefault();
- var pp = document.getElementById('password_prompt');
- pp.focus(); pp.select();
- break;
- case document.getElementById('password_prompt') :
- ev.preventDefault();
- var sb = document.getElementById('submit_button');
- sb.focus();
- authenticate();
- break;
- default:
- break;
- }
- }
-}
-
-function disable_login_prompts() {
- sdump('D_AUTH',arg_dump(arguments));
- disable_widgets(document,'password_prompt','name_prompt','submit_button');
- G.sound.beep();
-}
-
-function enable_login_prompts() {
- sdump('D_AUTH',arg_dump(arguments));
- enable_widgets(document,'password_prompt','name_prompt','submit_button');
- document.getElementById('password_prompt').value = '';
- var np = document.getElementById('name_prompt');
- np.focus(); np.select();
- document.getElementById('auth_meter').value = 0;
- document.getElementById('auth_meter').setAttribute('real', '0.0');
- G.sound.beep();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-function authenticate() {
- sdump('D_AUTH',arg_dump(arguments));
- timer_init('cat');
- var name = document.getElementById('name_prompt').value;
- if (name.length == 0) { enable_login_prompts(); return; }
- // Talk to the system and authenticate the user.
- user_async_request(
- 'open-ils.auth',
- 'open-ils.auth.authenticate.init',
- [ name ],
- auth_init_callback
- );
-}
-
-function auth_init_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var auth_init;
- try {
- auth_init = request.getResultObject();
- if (!auth_init) { throw('null result'); }
- } catch(E) {
- G.offline = true;
- sdump('D_ERROR','Error trying to communicate with the server. Entering OFFLINE mode.\n' + js2JSON(E) + '\n');
- s_alert('Error trying to communicate with the server. Entering OFFLINE mode.\n' + js2JSON(E) + '\n');
- }
-
- sdump( 'D_AUTH', 'D_AUTH_INIT: ' + typeof(auth_init) + ' : ' + auth_init + '\n');
- var name = document.getElementById('name_prompt').value;
- var pw = document.getElementById('password_prompt').value;
- G.name = name; G.pw = pw;
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.auth',
- 'open-ils.auth.authenticate.complete',
- [ name, hex_md5(auth_init + hex_md5(pw)) ],
- auth_ses_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function auth_ses_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var auth_ses;
- try {
- auth_ses = request.getResultObject();
- if (!auth_ses) { if (!G.offline) { throw('null result'); } }
- if (auth_ses == 0) { throw('0 result'); }
- if (instanceOf(auth_ses,ex)) {
- throw(auth_ses.err_msg());
- }
- } catch(E) {
- alert('Login failed on auth_ses: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- mw.G.auth_ses = [ auth_ses ];
- sdump( 'D_AUTH', 'D_AUTH_SES: ' + typeof(mw.G['auth_ses'][0]) + ' : ' + mw.G['auth_ses'][0] + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- //'open-ils.actor.user.profiles.retrieve',
- user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.groups.retrieve',
- [],
- ap_list_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function ap_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- //var ap_file = get_file('ap_list');
- var ap_list;
- try {
- ap_list = request.getResultObject();
- if (!ap_list && G.offline) {
- //ap_list = get_object_in_file('ap_list');
- }
- if (!ap_list) { throw('null result'); }
- if (ap_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- handle_error('Login failed on ap_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('ap_list',ap_list); } catch(E) { handle_error(E); }
- mw.G.ap_list = ap_list;
- mw.G.ap_hash = convert_object_list_to_hash( ap_list );
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.user.ident_types.retrieve',
- [],
- cit_list_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function cit_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var cit_list;
- try {
- cit_list = request.getResultObject();
- //if (!cit_list && G.offline) { cit_list = get_object_in_file('cit_list'); }
- if (!cit_list) { throw('null result'); }
- if (cit_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- alert('Login failed on cit_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('cit_list',cit_list); } catch(E) { handle_error(E); }
- mw.G.cit_list = cit_list;
- mw.G.cit_hash = convert_object_list_to_hash( cit_list );
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.standings.retrieve',
- [],
- cst_list_callback
- );
-
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function cst_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var cst_list;
- try {
- cst_list = request.getResultObject();
- //if (!cst_list && G.offline) { cst_list = get_object_in_file('cst_list'); }
- if (!cst_list) { throw('null result'); }
- if (cst_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- alert('Login failed on cst_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('cst_list',cst_list); } catch(E) { handle_error(E); }
- mw.G.cst_list = cst_list;
- mw.G.cst_hash = convert_object_list_to_hash( cst_list );
- sdump('D_AUTH', 'cst_list = ' + js2JSON(cst_list) + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.search',
- 'open-ils.search.config.copy_location.retrieve.all',
- [],
- acpl_list_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-
-}
-
-function acpl_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var acpl_list;
- try {
- acpl_list = request.getResultObject();
- //if (!acpl_list && G.offline) { acpl_list = get_object_in_file('acpl_list'); }
- if (!acpl_list) { throw('null result'); }
- if (acpl_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- alert('Login failed on acpl_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('acpl_list',acpl_list); } catch(E) { handle_error(E); }
- mw.G.acpl_list = acpl_list;
- mw.G.acpl_hash = convert_object_list_to_hash( acpl_list );
- sdump('D_AUTH', 'acpl_list = ' + js2JSON(acpl_list) + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.search',
- 'open-ils.search.config.copy_status.retrieve.all',
- [],
- ccs_list_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function ccs_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var ccs_list;
- try {
- ccs_list = request.getResultObject();
- //if (!ccs_list && G.offline) { ccs_list = get_object_in_file('ccs_list'); }
- if (!ccs_list) { throw('null result'); }
- if (ccs_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- alert('Login failed on ccs_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('ccs_list',ccs_list); } catch(E) { handle_error(E); }
- mw.G.ccs_list = ccs_list;
- mw.G.ccs_hash = convert_object_list_to_hash( ccs_list );
- sdump('D_AUTH', 'ccs_list = ' + js2JSON(ccs_list) + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.search',
- 'open-ils.search.actor.user.session',
- [ mw.G['auth_ses'][0] ],
- user_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function user_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var user;
- var user_ou;
- try {
- user = request.getResultObject();
- if (!user && G.offline) {
- //user = new au();
- //user.home_ou( get_object_in_file('user_ou') );
- }
- if (!user) { throw('null result'); }
- if (typeof(user) != 'object') { throw('result not an object' + user); }
- } catch(E) {
- alert('Login failed on user: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('user_ou',user.home_ou()); } catch(E) { handle_error(E); }
- mw.G.user = user;
- mw.G.user_ou = user.home_ou();
- sdump('D_AUTH', "user: " + js2JSON(mw.G['user']) + '\n');
- sdump('D_AUTH', "user_ou: " + js2JSON(mw.G['user_ou']) + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.org_tree.retrieve',
- [],
- org_tree_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function org_tree_callback(request) {
- var org_tree;
- try {
- org_tree = request.getResultObject();
- //if (!org_tree && G.offline) { org_tree = get_object_in_file('org_tree'); }
- if (!org_tree) { throw('null result'); }
- if (typeof(org_tree) != 'object') { throw('result not an object' + org_tree); }
- } catch(E) {
- alert('Login failed on org_tree: ' + js2JSON(E)); enable_login_prompts(); return;
- }
-
- //mw.G.org_tree = globalOrgTree;
- //try { set_object_in_file('org_tree',org_tree); } catch(E) { handle_error(E); }
- mw.G.org_tree = org_tree;
- mw.G.org_tree_hash = convert_object_list_to_hash( flatten_ou_branch( mw.G.org_tree ) );
- mw.G.user_ou = find_ou( mw.G.org_tree, mw.G.user_ou );
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- /*user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.org_types.retrieve',
- [ mw.G.auth_ses[0] ],
- org_type_callback
- );*/
- org_type_callback();
-}
-
-function org_type_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var aout_list = globalOrgTypes;
- /*try {
- aout_list = request.getResultObject();
- if (!aout_list) { throw('null result'); }
- if (typeof(aout_list) != 'object') { throw('result not an object' + aout_list); }
- if (aout_list.length == 0) { throw('empty aout_list'); }
- } catch(E) {
- alert('Login failed on aout_list: ' + js2JSON(E)); enable_login_prompts(); return;
- }*/
- mw.G.aout_list = aout_list;
- mw.G.aout_hash = convert_object_list_to_hash( aout_list );
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.org_unit.full_path.retrieve',
- [ mw.G.auth_ses[0] ],
- my_orgs_callback
- );
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function my_orgs_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var my_orgs;
- try {
- my_orgs = request.getResultObject();
- //if (!my_orgs && G.offline) { my_orgs = get_object_in_file('my_orgs'); }
- if (!my_orgs) { throw('null result'); }
- if (typeof(my_orgs) != 'object') { throw('result not an object' + my_orgs); }
- if (my_orgs.length == 0) { throw('empty my_orgs'); }
- } catch(E) {
- alert('Login failed on my_orgs: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
-
- //try { set_object_in_file('my_orgs',my_orgs); } catch(E) { handle_error(E); }
- mw.G.my_orgs = my_orgs;
- mw.G.my_orgs_hash = convert_object_list_to_hash( my_orgs );
- sdump('D_AUTH','my_orgs = ' + js2JSON(my_orgs) + '\n');
- mw.G.acpl_my_orgs = filter_list(
- mw.G.acpl_list,
- function (obj) {
- if ( typeof obj != 'object' ) return null;
- if ( mw.G.my_orgs_hash[ obj.owning_lib() ] ) return obj;
- }
- );
- mw.G.acpl_my_orgs_hash = convert_object_list_to_hash( mw.G.acpl_my_orgs );
- //sdump('D_AUTH', 'my_orgs.length = ' + mw.G.my_orgs.length + ' other_orgs.length = ' + mw.G.other_orgs.length + '\n');
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- user_async_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.retrieve.all',
- [ mw.G.auth_ses[0], mw.G.user_ou.id() ],
- my_actsc_list_callback
- );
-
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function my_actsc_list_callback(request) {
- sdump('D_AUTH',arg_dump(arguments));
- var actsc_list;
- try {
- actsc_list = request.getResultObject();
- //if (!actsc_list && G.offline) { actsc_list = get_object_in_file('actsc_list'); }
- if (!actsc_list) { throw('null result'); }
- //if (actsc_list.length == 0) { throw('zero length result'); }
- } catch(E) {
- alert('Login failed on actsc_list: ' + js2JSON(E));
- if (!debug_ignore_auth_failures) {
- enable_login_prompts(); return;
- }
- }
- //try { set_object_in_file('actsc_list',actsc_list); } catch(E) { handle_error(E); }
- mw.G.actsc_list = actsc_list;
- mw.G.actsc_hash = convert_object_list_to_hash( actsc_list );
- sdump('D_AUTH', 'actsc_list = ' + js2JSON(actsc_list) + '\n');
-
- incr_progressmeter(document,'auth_meter',auth_meter_incr);
-
- spawn_main();
-
- mw.minimize();
-
-}
-
-
-function logoff() {
- sdump('D_AUTH',arg_dump(arguments));
- mw.G['auth_ses'] = '';
- close_all_windows();
- enable_login_prompts();
- incr_progressmeter(document,'auth_meter',-100);
- snd_logoff();
-}
-
-function nice_shutdown() {
- sdump('D_AUTH',arg_dump(arguments));
- if (ses) { logoff(); ses.disconnect(); }
- snd_exit;
- close_all_windows();
- window.close();
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Open-ILS Staff Client -->
-<!-- Screen: Auth/Login -->
-
-<!-- Modified by Jason for Evergreen -->
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/auth.dtd">
-
-<window id="auth_win" title="&auth.title;"
- orient="vertical" style="overflow: auto" persist="width height"
- onload="mw.OpenILS_init({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
- onunload="mw.OpenILS_exit({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/auth.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/Open-ILS/OpenILS_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/auth/auth_overlay.xul"?>
-
- <!-- More Localization -->
- <stringbundleset id="string_bundles"/>
-
- <!-- The logic for this app -->
- <OpenILS id="OpenILS_js" />
-
- <!-- The logic for this screen -->
- <!--<Auth id="auth_js" />-->
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="auth_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="auth_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="auth_main" />
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/auth.dtd">
-<overlay id="auth_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- Modified by Jason for Evergreen -->
-
-<!-- The javascript logic for the staff client -->
-<!--
-<Auth id="auth_js">
- <script src="auth.js" />
-</Auth>
--->
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="auth_cmds">
- <command id="cmd_login" oncommand="
- disable_login_prompts();
- authenticate();
- "/>
- <command id="cmd_logoff" oncommand="logoff();"/>
- <command id="cmd_close_window" oncommand="nice_shutdown();"/>
-</commandset>
-
-<!-- The top level widget for the staff client -->
-<box id="auth_main" flex="1" orient="vertical">
- <deck id="main_deck">
- <groupbox id="main_groupbox" flex="1"/>
- <iframe id="print_frame" flex="1"/>
- <iframe id="scratch_pad" flex="1"/>
- </deck>
- <button label="Console" accesskey="C" oncommand="try {mw.spawn_javascript_console(mw.document,'new_window','',{}); } catch(E) { alert(E); }"/>
- <button label="FConsole" accesskey="F" oncommand="try {mw.spawn_filter_console(mw.document,'new_window','',{}); } catch(E) { alert(E); }"/>
-</box>
-
-<groupbox id="main_groupbox" flex="1">
- <caption id="main_caption" label="&auth.login_header;"/>
- <label value="&auth.version;"/>
- <label value="Development Version"/>
- <label value=" "/>
- <grid>
- <columns>
- <column />
- <column />
- </columns>
- <rows>
- <row>
- <label value="&auth.name_prompt;" control="name_prompt" accesskey="&auth.name_prompt.key;"/>
- <textbox id="name_prompt" value=""/>
- </row>
- <row>
- <label value="&auth.password_prompt;" control="password_prompt" accesskey="&auth.password_prompt.key;"/>
- <textbox id="password_prompt" value="" type="password"/>
- </row>
- <row>
- <label/>
- <hbox>
- <button id="submit_button" label="&auth.submit_prompt;" accesskey="&auth.submit_prompt.key;" command="cmd_login"/>
- <button label="&auth.logoff_prompt;" accesskey="&auth.logoff_prompt.key;" command="cmd_logoff"/>
- </hbox>
- </row>
- <row>
- <label/>
- <label/>
- </row>
- <row>
- <label/>
- <button label="&auth.quit_prompt;" accesskey="&auth.quit_prompt.key;" command="cmd_close_window"/>
- </row>
- </rows>
- </grid>
- <progressmeter id="auth_meter" mode="normal" value="0"/>
-</groupbox>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="auth_keys">
- <key id="auth-login-key" modifiers="accel" key="S" command="cmd_login"/>
- <key id="auth-logoff-key" modifiers="accel" key="L" command="cmd_logoff"/>
- <key id="auth-close-key" modifiers="accel" key="Q" command="cmd_close_window"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="brief_win" title="Record Details"
- orient="vertical" style="overflow: scroll" width="800" height="500"
- onload="my_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
- <script>
- <![CDATA[
- var myPackageDir = "evergreen";
-
- function my_init() {
-
- var mods = user_request(
- 'open-ils.search',
- 'open-ils.search.biblio.record.mods_slim.retrieve',
- [ find_this_id ]
- )[0];
-
- if (mods.title()) document.getElementById('title').setAttribute('value',mods.title());
- if (mods.author()) document.getElementById('author').setAttribute('value',mods.author());
- if (mods.edition()) document.getElementById('edition').setAttribute('value',mods.edition());
- if (mods.pubdate()) document.getElementById('pubdate').setAttribute('value',mods.pubdate());
- if (mods.tcn()) document.getElementById('tcn').setAttribute('value',mods.tcn());
-
- user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.metadata.retrieve',
- [ find_this_id ],
- function (req) {
- var meta = req.getResultObject()[0];
- document.getElementById('creator').setAttribute('value',meta.creator());
- document.getElementById('editor').setAttribute('value',meta.editor());
- document.getElementById('edit_date').setAttribute('value',formatted_date(meta.edit_date(),"%D"));
- }
- );
- }
-
- ]]>
- </script>
-
- <groupbox flex="1">
- <caption label="Record Details"/>
- <hbox flex="1">
- <label style="font-weight: bold;" value="Title:" /><label id="title" />
- <label style="font-weight: bold;" value="Author:" /><label id="author" />
- <label style="font-weight: bold;" value="Edition:" /> <label id="edition" />
- <label style="font-weight: bold;" value="Pub Date:" /> <label id="pubdate" />
- </hbox>
- <hbox flex="1">
- <label style="font-weight: bold;" value="TCN:" /> <label id="tcn" />
- <label style="font-weight: bold;" value="Created By:" /> <label id="creator" />
- <label style="font-weight: bold;" value="Last Edited By:" /> <label id="editor" />
- <label style="font-weight: bold;" value="Last Edited On:" /> <label id="edit_date" />
- </hbox>
- </groupbox>
-
-</window>
-
+++ /dev/null
-// find_this_id = document id
-
-var org_shortname2id = {};
-var my_treerow;
-var browse_meter_per = 0;
-var orgs_with_copies = [];
-var orgs_with_copies_hash = {};
-
-function my_init() {
- timer_init('cat');
- mw.sdump('D_CAT','TESTING: browse_list.js: ' + mw.G['main_test_variable'] + '\n');
- var tc = document.getElementById('browse_list_tree_children');
- build_tree_branch(tc,mw.G['org_tree'],true);
- my_treerow = document.getElementById( 'org_unit_' + mw.G.user_ou.id() ).firstChild;
- document.getElementById('browse_meter').value = 0;
- document.getElementById('browse_meter').setAttribute('real', '0.0');
- gather_copies();
- //populate_tree();
-}
-
-function refresh_browse_list() {
- mw.sdump('D_CAT','=-=-=-=-=-=-=-=-=\n\n\nrefresh_browse_list()\n');
- setTimeout(
- function() {
- // Prune tree
- var nl = document.getElementsByTagName('treeitem');
- for (var i = 0; i < nl.length; i++) {
- var v_treeitem = nl[i];
- if (v_treeitem.getAttribute('object_type') == 'volume') {
- var org_treechildren = v_treeitem.parentNode;
- var org_treeitem = org_treechildren.parentNode;
- org_treeitem.removeChild(org_treechildren);
- var org_treerow = org_treeitem.firstChild;
- org_treerow.childNodes[1].setAttribute('label','0');
- org_treerow.childNodes[2].setAttribute('label','0');
- }
- }
- document.getElementById('browse_meter').value = 0;
- document.getElementById('browse_meter').setAttribute('real', '0.0');
- gather_copies();
- }, 0
- );
-}
-
-function button_toggle_my_libraries(ev) {
- // label = Hide My Libraries
- // alt_label = Show My Libraries
- var target = document.getElementById('browse_list_button1');
- if (!target) { mw.sdump('D_CAT','eh?\n'); return; }
- swap_attributes('browse_list_button1','label','alt_label');
- var toggle = cycle_attribute( target,'toggle', [ '1', '2' ] );
- for (var i in mw.G.my_orgs) {
- var lib = mw.G.my_orgs[i];
- var item = document.getElementById('org_unit_'+lib.id());
- if (item) {
- if (toggle == '2') {
- hide_branch(item);
- } else {
- unhide_branch(item);
- }
- }
- }
-}
-
-function button_toggle_libraries(ev) {
- // label = Show Other Libraries With Copies
- // alt_label = Show Just My Libraries
- var target = document.getElementById('browse_list_button2');
- if (!target) { mw.sdump('D_CAT','eh?\n'); return; }
- swap_attributes('browse_list_button2','label','alt_label');
- var toggle = cycle_attribute( target,'toggle',['1','2'] );
- if (toggle == '1') {
- mw.sdump('D_CAT','Showing just my libraries...\n');
- /*hide_branch( document.getElementById('org_unit_PINES') );
- for (var i = 0; i < mw.G.my_orgs.length; i++) {
- unhide_branch(
- document.getElementById( 'org_unit_' + mw.G.my_orgs[i].id() )
- );
- }*/
- var nl = document.getElementsByTagName('treeitem');
- for (var i = 0; i < nl.length; i++) {
- var item = nl[i];
- if (item.getAttribute('id').substr(0,9) != 'org_unit_') continue;
- if (mw.G.my_orgs_hash[ item.getAttribute('myid') ]) {
- //item.setAttribute('hidden','false');
- unhide_branch(item);
- } else {
- //item.setAttribute('hidden','true');
- hide_branch(item);
- }
- }
- } else {
- mw.sdump('D_CAT','Showing other libraries with copies...\n');
- var nl = document.getElementsByTagName('treeitem');
- for (var i = 0; i < nl.length; i++) {
- var item = nl[i];
- if (item.getAttribute('copies') == 'true') {
- //item.setAttribute('hidden','false');
- //mw.sdump('D_CAT','\tunhiding ' + item.getAttribute('id') + '\n');
- unhide_branch(item);
- } else {
- //item.setAttribute('hidden','true');
- //mw.sdump('D_CAT','\thiding ' + item.getAttribute('id') + '\n');
- //hide_branch(item);
- }
- }
-
- }
-}
-
-function unhide_branch(item,do_open,do_copies) {
- if (item.getAttribute('id') == 'org_unit_PINES') { return; }
- //mw.sdump('D_CAT','Unhiding ' + item.getAttribute('id') + '\n');
- item.setAttribute('hidden','false');
- if (do_open) {
- item.setAttribute('open','true');
- }
- if (do_copies) {
- item.setAttribute('copies','true');
- }
- if (item.parentNode && item.parentNode.setAttribute) {
- var id = item.parentNode.getAttribute('id');
- if (id.substr(0,7) != 'browse_' && id != 'org_unit_PINES') {
- unhide_branch(item.parentNode,do_open,do_copies);
- }
- }
-}
-
-function hide_branch(item,do_open,do_copies) {
- if (item.getAttribute('id') == 'org_unit_PINES') { return; }
- //mw.sdump('D_CAT','Hiding ' + item.getAttribute('id') + '\n');
- item.setAttribute('hidden','true');
- if (do_open) {
- item.setAttribute('open','false');
- }
- if (do_copies) {
- item.setAttribute('copies','true');
- }
- if (item.parentNode && item.parentNode.setAttribute) {
- var id = item.parentNode.getAttribute('id');
- if (id.substr(0,7) != 'browse_' && id != 'org_unit_PINES') {
- hide_branch(item.parentNode,do_open,do_copies);
- }
- }
-}
-
-function gather_copies() {
- // loop the libs
- mw.sdump('D_CAT','Hello : ' + timer_elapsed('world') + '\n');
-/* user_async_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.copy_tree.global.retrieve',
- [ mw.G['auth_ses'][0], find_this_id ],
- gather_copies_callback
- );
-*/
- var orgs_with_copies = [];
- try {
- orgs_with_copies = user_request(
- 'open-ils.cat',
- 'open-ils.cat.actor.org_unit.retrieve_by_title',
- [ find_this_id ]
- )[0];
- } catch(E) {
- handle_error(E);
- }
- for (var i = 0; i < orgs_with_copies.length; i++) {
- orgs_with_copies_hash[ orgs_with_copies[i] ] = true;
- }
- var bucket = new Array();
- for (var i = 0; i < mw.G.my_orgs.length; i++ ) {
- //if (find_id_object_in_list( mw.G.aout_list, mw.G.my_orgs[i].ou_type() ).can_have_vols() == '0')
- if ( mw.G.aout_list[ mw.G.my_orgs[i].ou_type() ].can_have_vols() == '0')
- continue;
- if ( ! orgs_with_copies_hash[ mw.G.my_orgs[i].id() ] ) continue;
- bucket.push( mw.G.my_orgs[i].id() );
- }
- document.getElementById('browse_libs').setAttribute('value','Retrieving my copies...');
- user_async_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.copy_tree.retrieve',
- [ mw.G['auth_ses'][0], find_this_id, bucket ],
- function (request) {
- gather_copies_callback(request);
- document.getElementById('browse_libs').setAttribute('value','Retrieving copies from other libraries...');
- gather_other_copies();
- }
- );
- mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
-}
-
-function gather_other_copies() {
- var w_s = 10; var c_s = 0;
- var bucket = new Array();
-
- var nl = document.getElementsByTagName('treeitem');
- for (var i = 0; i < nl.length; i++) {
- var item = nl[i];
- if (item.getAttribute('can_have_vols') == '0') continue;
- //if ( find_id_object_in_list( mw.G.my_orgs, item.getAttribute('myid') ) ) { continue; }
- if ( mw.G.my_orgs_hash[ item.getAttribute('myid') ] ) { continue; }
- if ( ! orgs_with_copies_hash[ item.getAttribute('myid') ] ) continue;
- bucket.push( item.getAttribute('myid') );
- if (++c_s >= w_s) {
- user_async_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.copy_tree.retrieve',
- [ mw.G['auth_ses'][0], find_this_id, bucket ],
- gather_copies_callback
- );
- mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
- bucket = new Array();
- c_s = 0;
- }
- }
- if (bucket.length > 0) {
- user_async_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.copy_tree.retrieve',
- [ mw.G['auth_ses'][0], find_this_id, bucket ],
- gather_copies_callback
- );
- mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
- }
- browse_meter_per = 100 / counter_peek('world');
- mw.sdump('D_CAT',timer_elapsed('world') + ' : World : ' + timer_elapsed('gather') + '\n');
-}
-
-function find_my_treerow_index() {
- var nl = document.getElementById('browse_list_tree').getElementsByTagName('treerow');
- var count = 0;
- //mw.sdump('D_CAT','find_my_treerow: count = ' + count + ' nl.length = ' + nl.length + '\n');
- for (var i = 0; i < nl.length; i++) {
- var row = nl[i];
- var item = row.parentNode;
- if (item.getAttribute('id') == 'org_unit_' + mw.G.user_ou.id() ) {
- return count;
- }
- var open_attr = item.getAttribute('open');
- var hidden_prop = item.hidden;
- //mw.sdump('D_CAT','id = ' + item.getAttribute('id') + ' hidden_attr = ' + hidden_attr + ' hidden_prop = ' + hidden_prop + '\n');
- if (hidden_prop.toString() == 'false' && open_attr.toString() == 'true') {
- count++;
- }
- }
- return 0;
-}
-
-function gather_copies_callback(request) {
- mw.sdump('D_CAT','gather_copies_callback : ' + timer_elapsed('gather') + ' : ' + ' count = ' + counter_incr('gather') + '\n');
- var result = request.getResultObject();
- var n_volumes = 0; var n_copies = 0; var flag = false;
- //mw.sdump('D_CAT','copybrowser result = ' + js2JSON(result) + '\n=-=-=\n');
- for (var y in result) {
- if (result[y] && (typeof(result[y])=='object')) {
- var volume = result[y]; n_volumes++;
- //mw.sdump('D_CAT','\nvolume = ' + js2JSON(volume) + '\n');
- mw.sdump('D_CAT',' volume id = ' + volume.id() + '\n');
- var lib = find_ou( mw.G.org_tree, volume.owning_lib() );
- mw.sdump('D_CAT','lib = ' + js2JSON(lib) + '\n');
- if ( lib.id() == mw.G.user_ou.id() ) { flag = true; }
- var callnumber = volume.label();
- var copies = volume.copies();
- //mw.sdump('D_CAT','\tcopies = ' + js2JSON(copies) + '\n');
- var item = document.getElementById('org_unit_'+lib.id());
- if (!item) { mw.sdump('D_CAT','skipping\n'); continue; }
-
- var item_row = item.firstChild;
- var volumes_treecell;
- if (item_row.childNodes.length == 1) {
- volumes_treecell = document.createElement('treecell');
- volumes_treecell.setAttribute('label','0');
- item_row.appendChild(volumes_treecell);
- } else {
- volumes_treecell = item_row.childNodes[1];
- }
- volumes_treecell.setAttribute(
- 'label',
- parseInt(volumes_treecell.getAttribute('label')) + 1
- );
-
- var copies_treecell;
- if (item_row.childNodes.length < 3) {
- copies_treecell = document.createElement('treecell');
- copies_treecell.setAttribute('label','0');
- item_row.appendChild(copies_treecell);
- } else {
- copies_treecell = item_row.childNodes[2];
- }
- copies_treecell.setAttribute(
- 'label',
- parseInt(copies_treecell.getAttribute('label')) + copies.length
- );
-
-
- var cn_treechildren;
- var nl = item.getElementsByTagName('treechildren');
- //unhide_branch(item,false,true);
- item.setAttribute('copies',true);
- if (nl.length == 0) {
- cn_treechildren = document.createElement('treechildren');
- item.appendChild(cn_treechildren);
- } else {
- cn_treechildren = nl[0];
- }
-
- var cn_treeitem = document.createElement('treeitem');
- cn_treeitem.setAttribute('container','true');
- cn_treeitem.setAttribute('open','true');
- cn_treeitem.setAttribute('object_type','volume');
- cn_treeitem.setAttribute('volume_id',volume.id());
- cn_treeitem.setAttribute('callnumber',volume.label());
- cn_treeitem.setAttribute('ou_id',lib.id());
-
- cn_treechildren.appendChild(cn_treeitem);
-
- var cn_treerow = document.createElement('treerow');
- cn_treeitem.appendChild(cn_treerow);
-
- var cn_treecell = document.createElement('treecell');
- cn_treecell.setAttribute('label',callnumber);
- cn_treerow.appendChild(cn_treecell);
-
- var treechildren = document.createElement('treechildren');
- cn_treeitem.appendChild(treechildren);
- //mw.sdump('D_CAT', 'org_unit_'+lib+' item = '+item.tagName+'\n');
- for (var j = 0; j < copies.length; j++) {
- var copy = copies[j]; n_copies++;
- //mw.sdump('D_CAT','barcode: ' + copy.barcode() + '\n');
-
- var treeitem = document.createElement('treeitem');
- treeitem.setAttribute('open','true');
- treeitem.setAttribute('container','true');
- treeitem.setAttribute('class','barcode_row');
- treeitem.setAttribute('object_type','copy');
- treeitem.setAttribute('ou_shortname',lib.shortname());
- treeitem.setAttribute('ou_id',lib.id());
- treeitem.setAttribute('callnumber',callnumber);
- treeitem.setAttribute('barcode',copy.barcode());
- treeitem.setAttribute('copy_id',copy.id());
- treeitem.setAttribute('volume_id',volume.id());
- //treeitem.setAttribute('copy',js2JSON(copy));
- treechildren.appendChild(treeitem);
-
- var treerow = document.createElement('treerow');
- treeitem.appendChild(treerow);
-
- var list = [
- copy.barcode() ,
- '',
- '',
- lib.shortname() ,
- callnumber ,
- copy.copy_number() ,
- copy.location(), //mw.G.acpl_hash[ copy.location() ].name() ,
- copy.circ_lib(), //mw.G.org_tree_hash[ copy.circ_lib() ].shortname(),
- yesno( copy.circulate() ) ,
- yesno( copy.ref() ) ,
- yesno( copy.opac_visible() ) ,
- copy.circ_as_type() ,
- copy.circ_modifier() ,
- copy.loan_duration() ,
- copy.fine_level() ,
- copy.create_date() ,
- copy.creator() ,
- copy.edit_date() ,
- copy.editor() ,
- yesno( copy.deposit() ),
- copy.deposit_amount() ,
- copy.price() ,
- mw.G.ccs_hash[ copy.status() ].name()
- ];
-
- for (var i = 0; i < list.length; i++ ) {
- var treecell = document.createElement('treecell');
- treecell.setAttribute('label',list[i]);
- treerow.appendChild(treecell);
- }
-
- }
- } else {
- mw.sdump('D_CAT','gather_copies problem: ' + result[y] + '\n');
- //throw(result[0]);
- }
- }
- var tree = document.getElementById('browse_list_tree');
- if (tree.currentIndex != -1) {
- //mw.sdump('D_CAT','currentIndex != -1 = ' + tree.currentIndex + '\n');
- //tree.treeBoxObject.scrollToRow( tree.currentIndex );
- tree.treeBoxObject.ensureRowIsVisible( tree.currentIndex );
- } else if (flag) {
- //mw.sdump('D_CAT','currentIndex == -1\n');
- var find = find_my_treerow_index();
- mw.sdump('D_CAT','find = ' + find + ' n_volumes = ' + n_volumes + ' n_copies = ' + n_copies + '\n');
- //alert('find = ' + find + ' n_volumes = ' + n_volumes + ' n_copies = ' + n_copies + '\n');
- if (find > 0) {
- find = find + n_volumes + n_copies;
- tree.view.selection.select( find );
- }
- //tree.treeBoxObject.ensureRowIsVisible( find );
- }
- var meter = document.getElementById('browse_meter');
- var real = parseFloat( meter.getAttribute('real') ) + browse_meter_per;
- meter.setAttribute('real',real);
- meter.value = Math.ceil( real );
- if ( counter_peek('gather') == counter_peek('world') ) {
- document.getElementById('browse_libs').setAttribute('value','Finished');
- document.getElementById('browse_libs').setAttribute('hidden','true');
- meter.value = 100;
- meter.setAttribute('hidden','true');
- }
- mw.sdump('D_CAT','gather callback done : ' + timer_elapsed('gather') + '\n');
-}
-
-
-function build_tree_branch(treechildren,org,hide) {
- var id = org.id();
- var name = org.name();
- var shortname = org.shortname(); org_shortname2id[shortname] = id;
- var children = org.children();
- var flag = mw.G.aout_hash[ org.ou_type() ].can_have_vols() == '1';
- var item = make_treeitem('org_unit_' + id, name, flag);
- item.setAttribute('hidden',hide);
- item.setAttribute('ou_id',org.id());
- //if ( find_id_object_in_list( mw.G.my_orgs, id ) ) {
- if ( mw.G.my_orgs_hash[ id ] ) {
- item.setAttribute('open','true');
- item.setAttribute('hidden','false');
- item.setAttribute('myorg','true');
- }
- item.setAttribute(
- 'can_have_vols',
- //find_id_object_in_list( mw.G.aout_list, org.ou_type() ).can_have_vols()
- mw.G.aout_hash[ org.ou_type() ].can_have_vols()
- );
- item.setAttribute( 'myid', org.id() );
- if (children && (children.length > 0)) {
- var n_treechildren = document.createElement('treechildren');
- for (var i in children) {
- var child = children[i];
- build_tree_branch(n_treechildren, child, true);
- }
- item.appendChild(n_treechildren);
- }
- treechildren.appendChild(item);
-}
-
-function make_treeitem(id,name,flag) {
- var treeitem = document.createElement('treeitem');
- treeitem.setAttribute('id',id);
- treeitem.setAttribute('container','true');
- var treerow = make_treerow(name,flag);
- treeitem.appendChild(treerow);
- treeitem.setAttribute('object_type','org_unit');
- return treeitem;
-}
-
-function make_treerow(name,flag) {
- var treerow = document.createElement('treerow');
- var treecell = document.createElement('treecell');
- treecell.setAttribute('label',name);
- treerow.appendChild(treecell);
- treecell = document.createElement('treecell');
- if (flag) treecell.setAttribute('label',0);
- treerow.appendChild(treecell);
- treecell = document.createElement('treecell');
- if (flag) treecell.setAttribute('label',0);
- treerow.appendChild(treecell);
-
- return treerow;
-}
-
-function get_selected_rows_by_object_type(tree,object_type) {
- var items = get_list_from_tree_selection(tree);
- var command = "filter_list(items, function (obj) { return obj.getAttribute('object_type') == '" + object_type + "'; } );";
- return eval(command);
-}
-
-function build_CopyBrowser_Context(ev) {
- mw.sdump('D_CAT','build_CopyBrowser_Context: ev.target.tagName = ' + ev.target.tagName + '\n');
- mw.sdump('D_CAT','this = ' + this.tagName + '\n');
-
- var popup = document.getElementById('browse_menu');
- empty_widget(popup);
-
- var volume_flag = 0; var copy_flag = 0; var library_flag = 0;
-
- var hitlist = document.getElementById('browse_list_tree');
- var start = new Object(); var end = new Object();
- var numRanges = hitlist.view.selection.getRangeCount();
- for (var t=0; t<numRanges; t++){
- hitlist.view.selection.getRangeAt(t,start,end);
- for (var v=start.value; v<=end.value; v++){
- var i = hitlist.contentView.getItemAtIndex(v);
- //mw.sdump('D_CAT',i + ':' + i.firstChild.childNodes.length + '\n');
- switch( i.getAttribute('object_type') ) {
- case 'volume' : volume_flag++; break;
- case 'copy' : copy_flag++; break;
- case 'org_unit' : if (i.getAttribute('can_have_vols') == '1') library_flag++; break;
- }
- }
- }
- mw.sdump('D_CAT','volume_flag = ' + volume_flag + ' copy_flag = ' + copy_flag + ' library_flag = ' + library_flag + '\n');
- if (library_flag > 0) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- menuitem.setAttribute('label','Add Volumes');
- menuitem.setAttribute('command','cmd_volume_add');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- }
- if (volume_flag == 1) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- menuitem.setAttribute('label','Mark Volume as Copy Transfer Destination');
- menuitem.setAttribute('oncommand','mark_volume("browse_list_tree");');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- }
- if (volume_flag > 0) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- if (volume_flag > 1) {
- menuitem.setAttribute('label','Edit Volumes');
- } else {
- menuitem.setAttribute('label','Edit Volume');
- }
- menuitem.setAttribute('command','cmd_volume_edit');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- menuitem.setAttribute('label','Add Copies');
- menuitem.setAttribute('command','cmd_copy_add');
- menuitem = document.createElement('menuitem');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- }
- if (copy_flag > 0) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- if (copy_flag > 1) {
- menuitem.setAttribute('label','Add Copies to Bucket');
- } else {
- menuitem.setAttribute('label','Add Copy to Bucket');
- }
- menuitem.setAttribute('oncommand','add_to_bucket("browse_list_tree");');
- popup.appendChild( document.createElement( 'menuseparator' ) );
-
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- if (copy_flag > 1) {
- menuitem.setAttribute('label','Edit Copies');
- } else {
- menuitem.setAttribute('label','Edit Copy');
- }
- menuitem.setAttribute('command','cmd_copy_edit');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- }
- if (volume_flag > 0) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- if (volume_flag > 1) {
- menuitem.setAttribute('label','Delete Volumes');
- } else {
- menuitem.setAttribute('label','Delete Volume');
- }
- menuitem.setAttribute('command','cmd_volume_delete');
- popup.appendChild( document.createElement( 'menuseparator' ) );
-
- }
- if (copy_flag > 0) {
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- if (copy_flag > 1) {
- menuitem.setAttribute('label','Delete Copies');
- } else {
- menuitem.setAttribute('label','Delete Copy');
- }
- menuitem.setAttribute('command','cmd_copy_delete');
- popup.appendChild( document.createElement( 'menuseparator' ) );
- }
-
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- menuitem.setAttribute('label','Refresh Listing');
- menuitem.setAttribute('command','cmd_refresh');
-}
-
-function volume_add(tab,params) {
- mw.sdump('D_CAT','trying to volume_add()\n');
- params['shortcut'] = 'volume_add';
- var w;
- //var items = get_selected_rows(tree);
- var items = get_list_from_tree_selection(params.tree);
- items = filter_list(
- items,
- function (obj) {
- return obj.getAttribute('object_type') == 'org_unit';
- }
- );
- var chrome = 'chrome://open_ils_staff_client/content/cat/volume_copy_add_wizard.xul';
- if (tab) {
- parentWindow.new_tab('main_tabbox');
- w = parentWindow.replace_tab('main_tabbox','Add Volume',chrome);
- } else {
- w = mw.new_window( chrome );
- }
- mw.sdump('D_CAT','setting use_this_tree\n');
- w.tree_items = items;
- w.record_id = find_this_id;
- w.params = params;
-}
-
-function copy_add(tab,params) {
- mw.sdump('D_CAT','trying to copy_add()\n');
- params['shortcut'] = 'copy_add';
- var w;
- //var items = get_selected_rows(tree);
- var items = get_list_from_tree_selection(params.tree);
- items = filter_list(
- items,
- function (obj) {
- return obj.getAttribute('object_type') == 'volume';
- }
- );
- var chrome = 'chrome://open_ils_staff_client/content/cat/copy_add_wizard.xul';
- if (tab) {
- parentWindow.new_tab('main_tabbox');
- w = parentWindow.replace_tab('main_tabbox','Add Copy',chrome);
- } else {
- w = mw.new_window( chrome );
- }
- mw.sdump('D_CAT','setting use_this_tree\n');
- w.tree_items = items;
- w.record_id = find_this_id;
- w.params = params;
-}
-
-function volume_edit(tab,params) {
- mw.sdump('D_CAT','trying to volume_edit()\n');
- params['shortcut'] = 'volume_edit';
- var w;
- //var items = get_selected_rows(tree);
- var items = get_list_from_tree_selection(params.tree);
- items = filter_list(
- items,
- function (obj) {
- return obj.getAttribute('object_type') == 'volume';
- }
- );
- var chrome = 'chrome://open_ils_staff_client/content/cat/volume_edit_wizard.xul';
- if (tab) {
- parentWindow.new_tab('main_tabbox');
- w = parentWindow.replace_tab('main_tabbox','Edit Volumes',chrome);
- } else {
- w = mw.new_window( chrome );
- }
- mw.sdump('D_CAT','setting use_this_tree\n');
- w.tree_items = items;
- w.record_id = find_this_id;
- w.params = params;
-
-}
-
-function volume_delete(tab,params) {
- var volumes = get_selected_rows_by_object_type(params.tree,'volume');
- var cn_list = [];
- for (var i = 0; i < volumes.length; i++) {
- var cn = new acn();
- cn.id( volumes[i].getAttribute('volume_id') );
- cn.isdeleted( '1' );
- cn_list.push( cn );
- }
- try {
- var result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.volume_tree.fleshed.batch.update',
- [ mw.G['auth_ses'][0], cn_list]
- );
- mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
- } catch(E) {
- handle_error(E);
- }
- refresh_browse_list();
-}
-
-function copy_delete(tab,params) {
- var copies = get_selected_rows_by_object_type(params.tree,'copy');
- var cn_list = [];
- for (var i = 0; i < copies.length; i++) {
- var cn = new acn();
- cn.id( copies[i].getAttribute('volume_id') );
-
- var cp = new acp();
- cp.id( copies[i].getAttribute('copy_id') );
- cp.isdeleted( '1' );
-
- cn.copies( [ cp ] );
- cn_list.push( cn );
- }
- try {
- var result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.volume_tree.fleshed.batch.update',
- [ mw.G['auth_ses'][0], cn_list]
- );
- mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
- } catch(E) {
- handle_error(E);
- }
- refresh_browse_list();
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="browse_list_win" title="&browse_list.win_title;"
- orient="vertical" style="overflow: scroll" width="800" height="500"
- onload="my_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/browse_list_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="browse_list_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="browse_list_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="browse_list_keys" />
-
- <!-- Context menus -->
- <popupset id="browse_list_popupset" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="browse_list_vbox" class="test_class"/>
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="browse_list_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="browse_list_js">
- <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
- <util id="util_js"/>
- <script src="browse_list.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="browse_list_cmds">
- <command id="cmd_edit_browse" oncommand="spawn_editors();"/>
- <command id="cmd_volume_add" oncommand="volume_add(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
- <command id="cmd_volume_edit" oncommand="volume_edit(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
- <command id="cmd_volume_delete" oncommand="volume_delete(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
- <command id="cmd_copy_add" oncommand="copy_add(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
- <!--<command id="cmd_copy_edit" oncommand="spawn_batch_copy_editor(window.app_shell, 'new_tab', 'main_tabbox', { 'tree' : document.getElementById('browse_list_tree') , 'refresh_func' : refresh_browse_list });"/>-->
- <command id="cmd_copy_edit" oncommand="spawn_batch_copy_editor(window.parent_window.document, 'replace_iframe', 'copy_editor', { 'tree' : document.getElementById('browse_list_tree') , 'refresh_func' : refresh_browse_list }); window.parent_window.document.getElementById('copy_editor_tab').disabled = false;"/>
- <command id="cmd_copy_delete" oncommand="copy_delete(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
- <command id="cmd_toggle_my_libs" oncommand="button_toggle_my_libraries(event);"/>
- <command id="cmd_toggle_libs" oncommand="button_toggle_libraries(event);"/>
- <command id="cmd_refresh" oncommand="refresh_browse_list();"/>
- <command id="cmd_alert" oncommand="alert('Not Yet Implemented');"/>
-</commandset>
-
-<!-- Context menus -->
-<popupset id="browse_list_popupset">
- <popup id="browse_menu" onpopupshowing="build_CopyBrowser_Context(event);">
- <!--
- <menuitem id="browse_menu1" label="Add Volume" command="cmd_volume_add"/>
- <menuitem id="browse_menu2" label="Edit Volume" command="cmd_alert" disabled="true"/>
- <menuseparator id="browse_menu_sep1"/>
- <menuitem id="browse_menu3" label="Add Copy" command="cmd_copy_add" disabled="true"/>
- <menuitem id="browse_menu4" label="Edit Copy" command="cmd_copy_edit"/>
- <menuseparator id="browse_menu_sep2"/>
- <menuitem id="browse_menu5" label="Refresh Display" command="cmd_refresh"/>
- -->
- </popup>
-</popupset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="browse_list_vbox" flex="1">
- <hbox id="browse_list_buttonbox"/>
- <tree id="browse_list_tree"/>
-</vbox>
-
-<hbox id="browse_list_buttonbox">
- <!--
- <button id="browse_list_button1" label="Hide My Libraries" alt_label="Show My Libraries" toggle="1" command="cmd_toggle_my_libs"/>
- -->
- <button id="browse_list_button3" label="Refresh" command="cmd_refresh"/>
- <button id="browse_list_button2" label="Show Other Libraries With Copies" alt_label="Show Just My Libraries" toggle="1" command="cmd_toggle_libs"/>
- <label id="browse_libs"/>
- <progressmeter id="browse_meter" mode="normal" value="0" flex="1"/>
-</hbox>
-
-<tree id="browse_list_tree" enableColumnDrag="true" flex="1">
- <treecols id="browse_list_treecols">
- <treecol id="browse1" label="&browse_list.location;" flex="2" primary="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse1b" label="Volumes" flex="0"/> <splitter class="tree-splitter"/>
- <treecol id="browse1a" label="Copies" flex="0"/> <splitter class="tree-splitter"/>
- <treecol id="browse2" label="&browse_list.library;" flex="1"/> <splitter class="tree-splitter"/>
- <treecol id="browse3" label="&browse_list.callnumber;" flex="1"/> <splitter class="tree-splitter"/>
- <treecol id="browse4" label="&browse_list.copy_number;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4aa" label="&browse_list.location2;" flex="1"/> <splitter class="tree-splitter"/>
- <treecol id="browse4a" label="&browse_list.circ_lib;" flex="1"/> <splitter class="tree-splitter"/>
- <treecol id="browse4b" label="&browse_list.circulate;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4bb" label="&browse_list.ref;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4bbb" label="&browse_list.opac_visible;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4c" label="&browse_list.circ_as_type;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4d" label="&browse_list.circ_modifier;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4e" label="&browse_list.loan_duration;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse4f" label="&browse_list.fine_level;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse5" label="&browse_list.create_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse6" label="&browse_list.creator;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse7" label="&browse_list.edit_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse8" label="&browse_list.editor;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse9" label="&browse_list.deposit;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse10" label="&browse_list.deposit_amount;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse11" label="&browse_list.price;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
- <treecol id="browse12" label="&browse_list.status;" flex="1" hidden="false"/> <splitter class="tree-splitter"/>
- </treecols>
- <treechildren id="browse_list_tree_children" context="browse_menu"/>
-</tree>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="browse_list_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-function my_init() {
- document.getElementById('search-entry-box').focus();
- mw.sdump('D_CAT','TESTING: cat.js: ' + mw.G['main_test_variable'] + '\n');
- populate_lib_list(
- 'search-copy-count-menu',
- 'search-copy-count-popup',
- mw.G.user_ou
- );
-}
-
-function search(s_type, s_loc, s_fmt, s_ord, s_term) {
- var w_type = document.getElementById(s_type);
- var w_loc = document.getElementById(s_loc);
- var w_fmt = document.getElementById(s_fmt);
- var w_term = document.getElementById(s_term);
- var w_order = document.getElementById(s_ord);
- var frame_box = document.getElementById('cat_result_box');
- while (frame_box.lastChild) { frame_box.removeChild(frame_box.lastChild); }
- switch(w_type.value) {
- case 'barcode':
- alert('Not Yet Implemented');
- break;
- case 'id':
- alert('Not Yet Implemented');
- break;
- case 'title': case 'author': case 'tcn': case 'subject':
- var frame = document.createElement('iframe');
- frame_box.appendChild(frame);
- frame.setAttribute('flex','1');
- frame.setAttribute('src','chrome://evergreen/content/cat/record_list.xul');
- frame.contentWindow.parentWindow = parentWindow;
- frame.contentWindow.search_term = w_term.value;
- frame.contentWindow.search_type = w_type.value;
- frame.contentWindow.search_location = w_loc.value;
- frame.contentWindow.search_order = w_order.value;
- frame.contentWindow.catWindow = this;
- frame.contentWindow.tabWindow = tabWindow;
- frame.contentWindow.mw = mw;
- frame.contentWindow.am_i_a_top_level_tab = false;
- mw.sdump('D_CAT','here ====>\n');
- frame.contentWindow.addEventListener('load',function (e) { mw.sdump('D_CAT','here1<==\n'); this.test_hash['hello1'] = 'boo'; }, false);
- frame.contentWindow.addEventListener('load',function (e) { mw.sdump('D_CAT','here2<==\n'); this.test_hash['hello2'] = 'boo'; }, false);
- break;
- case 'isbn':
- alert('Not Yet Implemented');
- break;
- case 'callnumber':
- alert('Not Yet Implemented');
- break;
- case 'all':
- alert('Not Yet Implemented');
- break;
- default:
- alert('This case is not handled: ' + w_type.value);
- break;
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="cat_win" title="&cat.title;"
- orient="vertical" style="overflow: scroll"
- onload="my_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/cat_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="cat_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="cat_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="cat_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="cat_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="cat_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="cat_js">
- <script>var ses;</script>
- <util id="util_js"/>
- <script src="cat.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="cat_cmds">
- <command id="cmd_search" oncommand="
- search(
- 'search-type-menu',
- 'search-copy-count-menu',
- 'search-format-menu',
- 'search-order-menu',
- 'search-entry-box'
- );
- "/>
- <command id="cmd_test" oncommand="
- /*spawn_copy_browser( document.getElementById('search-entry-box').value );*/
- spawn_marc_editor( document.getElementById('search-entry-box').value );
- "/>
- <command id="cmd_alert" oncommand="
- alert('Not Yet Implemented');
-
- "/>
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="cat_vbox" flex="1" style="min-width: 100px; overflow: scroll;">
- <vbox id="cat_search_box"/>
- <vbox id="cat_result_box" flex="1"/>
-</vbox>
-
-<!-- The search box -->
-<vbox id="cat_search_box">
- <groupbox id="search_groupbox"/>
-</vbox>
-
-<groupbox id="search_groupbox">
- <caption label="&cat.search_criteria;"/>
- <grid id="search_grid"/>
-</groupbox>
-
-<grid id="search_grid">
- <columns>
- <column/> <column/>
- <column/> <column/>
- <column/>
- <column flex="1"/>
- </columns>
- <rows>
- <row id="search_row1"/>
- <row id="search_row2"/>
- <row id="search_row3"/>
- </rows>
-</grid>
-
-<row id="search_row1">
- <label
- value="&cat.search_type;"
- control="search-type-menu"
- accesskey="&cat.search_type.key;"
- />
- <menulist id="search-type-menu"/>
-
- <label
- value="&cat.search_term;"
- control="search-entry-box"
- accesskey="&cat.search_term.key;"
- />
- <textbox id="search-entry-box" flex="1"/>
-
-
- <!--<label
- value="&cat.search_location;"
- control="search-location-menu"
- accesskey="&cat.search_location.key;"
- />
- <menulist id="search-location-menu"/>-->
-</row>
-<row id="search_row2">
- <label
- value="&cat.search_format;"
- control="search-format-menu"
- accesskey="&cat.search_format.key;"
- />
- <menulist id="search-format-menu"/>
- <label
- value="&cat.search_count_copy;"
- control="search-copy-count-menu"
- accesskey="&cat.search_count_copy.key;"
- />
- <menulist id="search-copy-count-menu"/>
-
-</row>
-<row id="search_row3">
- <label
- value="&cat.search_order;"
- control="search-order-menu"
- accesskey="&cat.search_order.key;"
- />
- <menulist id="search-order-menu"/>
- <spacer/>
- <hbox>
- <button label="&cat.search_submit;" accesskey="&cat.search_submit.key;" command="cmd_search"/>
- <button label="&cat.search_advanced;" accesskey="&cat.search_advanced.key;" command="cmd_alert"/>
- </hbox>
-
-
-</row>
-
-<!-- The search location -->
-<!-- This should be populated by a script -->
-<menulist id="search-location-menu">
- <menupopup id="search-location-popup">
- <menuitem label="This Library (Athens-Clarke County Library)" value="PINES.ARL.ATH" />
- <menuitem label="This Library System (Athens Regional Library)" value="PINES.ARL" />
- <menuitem label="All PINES Libraries" value="PINES" />
- </menupopup>
-</menulist>
-
-<menulist id="search-copy-count-menu">
- <menupopup id="search-copy-count-popup"/>
-</menulist>
-
-
-
-<!-- The search format -->
-<menulist id="search-format-menu">
- <menupopup id="search-format-popup" command="cmd_alert">
- <menuitem label="&cat.type_of_material;" value="all" />
- <menuitem label="&cat.fixed.BKS;" value="BKS" />
- <menuitem label="&cat.fixed.SER;" value="SER" />
- <menuitem label="&cat.fixed.VIS;" value="VIS" />
- <menuitem label="&cat.fixed.MIX;" value="MIX" />
- <menuitem label="&cat.fixed.MAP;" value="MAP" />
- <menuitem label="&cat.fixed.SCO;" value="SCO" />
- <menuitem label="&cat.fixed.REC;" value="REC" />
- <menuitem label="&cat.fixed.COM;" value="COM" />
- </menupopup>
-</menulist>
-
-<!-- The search order -->
-<menulist id="search-order-menu">
- <menupopup id="search-order-popup" command="cmd_alert">
- <menuitem label="&cat.search_title;" value="title" />
- <menuitem label="&cat.search_author;" value="author" />
- <menuitem label="&cat.search_pubyear;" value="pubyear" />
- </menupopup>
-</menulist>
-
-
-<!-- The search type -->
-<menulist id="search-type-menu">
- <menupopup id="search-type-popup">
- <menuitem label="&cat.search_barcode;" value="barcode" />
- <menuitem label="&cat.search_tcn;" value="tcn" />
- <menuitem label="&cat.search_isbn;" value="isbn" />
- <menuitem label="&cat.search_title;" value="title" selected="true"/>
- <menuitem label="&cat.search_author;" value="author" />
- <menuitem label="&cat.search_subject;" value="subject" />
- <menuitem label="&cat.search_callnumber;" value="callnumber" />
- <menuitem label="&cat.search_id;" value="id" />
- <menuitem label="&cat.search_all;" value="all" />
- </menupopup>
-</menulist>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="cat_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-var local_stat_cats;
-var local_stat_cat_entries = {};
-
-function my_init() {
- mw.sdump('D_CAT','entering my_init for copy.js\n');
- mw.sdump('D_CAT','TESTING: copy.js: ' + mw.G['main_test_variable'] + '\n');
- mw.sdump('D_CAT','real_parentWindow: ' + real_parentWindow + '\n');
- populate_copy_status_list('copy-status-menu','copy-status-popup','0');
- populate_copy_location_list('shelving-location-menu','shelving-location-popup');
- populate_lib_list_with_branch('circulating-library-menu','circulating-library-popup', mw.G.user_ou, mw.G.org_tree, true );
- mw.sdump('D_CAT','super_dump cn_list = ' + super_dump_norecurse(cn_list) + '\n');
- mw.sdump('D_CAT','my_init: cn_list = ' + js2JSON(cn_list) + '\n');
- /*cn_list = fixJSON(cn_list);
- mw.sdump('D_CAT','super_dump cn_list = ' + super_dump_norecurse(cn_list) + '\n');
- mw.sdump('D_CAT','my_init: cn_list = ' + js2JSON(cn_list) + '\n');*/
- var pertinent_libs = [];
- for (var i = 0; i < cn_list.length; i++) {
- var cn = cn_list[i];
- for (var j = 0; j < cn.copies().length; j++) {
- var cp = cn.copies()[j];
- add_to_listbox(
- i,j,
- mw.G.org_tree_hash[ cn.owning_lib() ].shortname(),
- cn.label(),
- cp.barcode()
- );
- }
- pertinent_libs.push( cn.owning_lib() );
- }
- local_stat_cats = mw.G.asc_list;
- populate_listbox_with_local_stat_cats_myself(
- local_stat_cats,
- local_stat_cat_entries,
- 'local_attr_listbox',
- pertinent_libs,
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.multirange.intersect.retrieve',
- false
- );
- /*
- if (params.select_all) {
- document.getElementById('ephemeral_listbox').selectAll();
- }
- */
- transfer_attributes();
- apply_attributes();
-}
-
-function transfer_attributes(event) {
- /*
- var items = event.target.selectedItems;
- mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
- if (items.length == 0) { return; }
- */
-
- // Dump items
-
- /*
- var dump_copies = map_list(
- items,
- function (obj) {
- var cnp = obj.getAttribute('cn_pos');
- var cpp = obj.getAttribute('cp_pos');
- return cn_list[cnp].copies()[cpp];
- }
- );
- */
-
- var dump_copies = map_flat_list(
- cn_list,
- function (cn) {
- return cn.copies();
- }
- );
-
- for (var i in dump_copies) {
- mw.sdump('D_CAT','\n\n\n,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_\n\n\n');
- mw.sdump('D_CAT', js2JSON(dump_copies[i]) );
- mw.sdump('D_CAT','\n\n\n,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_\n\n\n');
- }
-
- // Transfer values from first item to XUL
-
- /*
- var cp_pos = items[0].getAttribute('cp_pos');
- var cn_pos = items[0].getAttribute('cn_pos');
- var cp_list = cn_list[cn_pos].copies();
- var copy = cp_list[cp_pos];
- */
- var copy = cn_list[0].copies()[0];
- if (copy.circ_lib()) set_widget_value_for_display(
- document.getElementById('circulating-library-menu'),
- copy.circ_lib().id()
- );
- if (copy.location()) set_widget_value_for_display(
- document.getElementById('shelving-location-menu'),
- copy.location().id()
- );
- if (copy.status()) set_widget_value_for_display(
- document.getElementById('copy-status-menu'),
- copy.status().id()
- );
- if (copy.loan_duration()) set_widget_value_for_display(
- document.getElementById('loan-duration-menu'),
- copy.loan_duration()
- );
- if (copy.fine_level()) set_widget_value_for_display(
- document.getElementById('fine-level-menu'),
- copy.fine_level()
- );
- if (copy.circulate()) set_widget_value_for_display(
- document.getElementById('circulate_menu'),
- copy.circulate()
- );
- if (copy.deposit()) set_widget_value_for_display(
- document.getElementById('deposit_menu'),
- copy.deposit()
- );
- if (copy.deposit_amount()) set_widget_value_for_display(
- document.getElementById('deposit_amount'),
- copy.deposit_amount()
- );
- if (copy.price()) set_widget_value_for_display(
- document.getElementById('price'),
- copy.price()
- );
- if (copy.ref()) set_widget_value_for_display(
- document.getElementById('reference_menu'),
- copy.ref()
- );
- if (copy.opac_visible()) set_widget_value_for_display(
- document.getElementById('opac_visible_menu'),
- copy.opac_visible()
- );
-
- for (var i in copy.stat_cat_entries()) {
- var entry = copy.stat_cat_entries()[i];
- var menuitem = document.getElementById('menuitem_stat_cat_entry_' + entry.id());
- if (menuitem) {
- menuitem.parentNode.parentNode.selectedItem = menuitem;
- }
- }
- mw.sdump('D_CAT','select fired\n');
-}
-
-
-function save_attributes() {
- real_parentWindow.cn_list = cn_list;
- real_parentWindow.document.getElementById('volume_add').canAdvance = true;
- //window.close();
-}
-
-function apply_attributes() {
- var circ_lib = document.getElementById('circulating-library-menu').value;
- var shelving_loc = document.getElementById('shelving-location-menu').value;
- var copy_status = document.getElementById('copy-status-menu').value;
- var loan_duration = document.getElementById('loan-duration-menu').value;
- var fine_level = document.getElementById('fine-level-menu').value;
- var circulate = document.getElementById('circulate_menu').value;
- var deposit = document.getElementById('deposit_menu').value;
- var deposit_amount = document.getElementById('deposit_amount').value;
- var price = document.getElementById('price').value;
- var ref = document.getElementById('reference_menu').value;
- var opac = document.getElementById('opac_visible_menu').value;
- /*
- var listbox = document.getElementById('ephemeral_listbox');
- var items = listbox.selectedItems;
- mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
- */
- for (var i = 0; i < cn_list.length; i++) {
- for (var j = 0; j < cn_list[i].copies().length; j++) {
- /*
- var listitem = items[i];
- var cn_pos = listitem.getAttribute('cn_pos');
- var cp_pos = listitem.getAttribute('cp_pos');
- var copy_node = cn_list[cn_pos].copies()[cp_pos];
- */
- var copy_node = cn_list[i].copies()[j];
- copy_node.circ_lib( mw.G.org_tree_hash[ circ_lib ]);
- copy_node.location( mw.G.acpl_hash[ shelving_loc ]);
- copy_node.status( mw.G.ccs_hash[ copy_status ]);
- copy_node.loan_duration(loan_duration);
- copy_node.fine_level(fine_level);
- copy_node.circulate(circulate);
- copy_node.deposit(deposit);
- copy_node.deposit_amount(deposit_amount);
- copy_node.price(price);
- copy_node.ref(ref);
- copy_node.opac_visible(opac);
- copy_node.ischanged(1);
- }
- }
-
- mw.sdump('D_CAT','changed cn_list: ' + js2JSON(cn_list) + '\n');
-}
-
-function apply_attribute(ev) {
- mw.sdump('D_CAT','Entering apply_attribute with element id = ');
- var popup_id;
- if (ev.target.tagName == 'menuitem') {
- popup_id = ev.target.parentNode.getAttribute('id');
- } else {
- popup_id = ev.target.getAttribute('id');
- }
- mw.sdump('D_CAT',popup_id + '\n');
- mw.sdump('D_CAT','ev.target = ' + ev.target + ' .tagName = ' + ev.target.tagName + '\n');
-
- var circ_lib = document.getElementById('circulating-library-menu').value;
- var shelving_loc = document.getElementById('shelving-location-menu').value;
- var copy_status = document.getElementById('copy-status-menu').value;
- var loan_duration = document.getElementById('loan-duration-menu').value;
- var fine_level = document.getElementById('fine-level-menu').value;
- var circulate = document.getElementById('circulate_menu').value;
- var deposit = document.getElementById('deposit_menu').value;
- var deposit_amount = document.getElementById('deposit_amount').value;
- var price = document.getElementById('price').value;
- var ref = document.getElementById('reference_menu').value;
- var opac = document.getElementById('opac_visible_menu').value;
- /*
- var listbox = document.getElementById('ephemeral_listbox');
- var items = listbox.selectedItems;
-
- mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
- */
- mw.sdump('D_CAT','before cn_list: ' + js2JSON(cn_list) + '\n');
- for (var i = 0; i < cn_list.length; i++) {
- for (var j = 0; j < cn_list[i].copies().length; j++) {
- /*
- var listitem = items[i];
- var cn_pos = listitem.getAttribute('cn_pos');
- var cp_pos = listitem.getAttribute('cp_pos');
- var copy_node = cn_list[cn_pos].copies()[cp_pos];
- */
- var copy_node = cn_list[i].copies()[j];
-
- mw.sdump('D_CAT','\n\n\n\n+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+\n\n\n\n');
- mw.sdump('D_CAT','Setting copy ' + copy_node.id() + '...\n');
- switch(popup_id) {
- case 'circulating-library-popup':
- mw.sdump('D_CAT','\tbefore circ_lib = ' + js2JSON(copy_node.circ_lib()) + '\n');
- copy_node.circ_lib( mw.G.org_tree_hash[ circ_lib ] );
- mw.sdump('D_CAT','\tafter circ_lib = ' + js2JSON(copy_node.circ_lib()) + '\n');
- break;
- case 'shelving-location-popup':
- mw.sdump('D_CAT','\tbefore location = ' + js2JSON(copy_node.location()) + '\n');
- copy_node.location( mw.G.acpl_hash[ shelving_loc ] );
- mw.sdump('D_CAT','\tafter location = ' + js2JSON(copy_node.location()) + '\n');
- break;
- case 'copy-status-popup':
- mw.sdump('D_CAT','\tbefore status = ' + js2JSON(copy_node.status()) + '\n');
- copy_node.status( mw.G.ccs_hash[ copy_status ]);
- mw.sdump('D_CAT','\tafter status = ' + js2JSON(copy_node.status()) + '\n');
- break;
- case 'loan-duration-popup':
- mw.sdump('D_CAT','\tbefore loan_duration = ' + js2JSON(copy_node.loan_duration()) + '\n');
- copy_node.loan_duration(loan_duration);
- mw.sdump('D_CAT','\tafter loan_duration = ' + js2JSON(copy_node.loan_duration()) + '\n');
- break;
- case 'fine-level-popup':
- mw.sdump('D_CAT','\tbefore fine_level = ' + js2JSON(copy_node.fine_level()) + '\n');
- copy_node.fine_level(fine_level);
- mw.sdump('D_CAT','\tafter fine_level = ' + js2JSON(copy_node.fine_level()) + '\n');
- break;
- case 'circulate_popup':
- mw.sdump('D_CAT','\tbefore circulate = ' + js2JSON(copy_node.circulate()) + '\n');
- copy_node.circulate(circulate);
- mw.sdump('D_CAT','\tafter circulate = ' + js2JSON(copy_node.circulate()) + '\n');
- break;
- case 'deposit_popup':
- mw.sdump('D_CAT','\tbefore deposit = ' + js2JSON(copy_node.deposit()) + '\n');
- copy_node.deposit(deposit);
- mw.sdump('D_CAT','\tafter deposit = ' + js2JSON(copy_node.deposit()) + '\n');
- break;
- case 'deposit_amount':
- mw.sdump('D_CAT','\tbefore deposit_amount = ' + js2JSON(copy_node.deposit_amount()) + '\n');
- copy_node.deposit_amount(deposit_amount);
- mw.sdump('D_CAT','\tafter deposit_amount = ' + js2JSON(copy_node.deposit_amount()) + '\n');
- break;
- case 'price':
- mw.sdump('D_CAT','\tbefore price = ' + js2JSON(copy_node.price()) + '\n');
- copy_node.price(price);
- mw.sdump('D_CAT','\tafter price = ' + js2JSON(copy_node.price()) + '\n');
- break;
- case 'reference_popup':
- mw.sdump('D_CAT','\tbefore ref = ' + js2JSON(copy_node.ref()) + '\n');
- copy_node.ref(ref);
- mw.sdump('D_CAT','\tafter ref = ' + js2JSON(copy_node.ref()) + '\n');
- break;
- case 'opac_visible_popup':
- mw.sdump('D_CAT','\tbefore opac_visible = ' + js2JSON(copy_node.opac_visible()) + '\n');
- copy_node.opac_visible(opac);
- mw.sdump('D_CAT','\tafter opac_visible = ' + js2JSON(copy_node.opac_visible()) + '\n');
- break;
- default:
- mw.sdump('D_CAT','\t++++++++ Unhandled.. this should be a stat_cat: ' + popup_id + ' / ' + ev.target.tagName + '\n');
- update_stat_cat_entry(copy_node,ev.target);
- break;
- }
- mw.sdump('D_CAT','\n\n\n\n+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+\n\n\n\n');
- copy_node.ischanged(1);
- }
- }
-
- mw.sdump('D_CAT','changed cn_list: ' + js2JSON(cn_list) + '\n');
-}
-
-function update_stat_cat_entry(copy,menuitem) {
- mw.sdump('D_CAT','\tupdate_stat_cat_entry: value = ' + menuitem.value + '\n');
- var entries = copy.stat_cat_entries();
- //mw.sdump('D_CAT','\n\n\ncopy = ' + js2JSON(copy) + '\n');
- //mw.sdump('D_CAT','\n\n\ncopy.stat_cat_entries() = ' + js2JSON(copy.stat_cat_entries()) + '\n');
- var stat_cat_id = menuitem.getAttribute('stat_cat');
- var entry = find_attr_object_in_list(entries,'stat_cat',stat_cat_id);
- if (entry) {
- mw.sdump('D_CAT','\tReplacing old stat_cat_entry with ');
-
- entries = filter_list(
- entries,
- function (obj) {
- return (obj.id() != entry.id());
- }
- );
-
- } else {
- mw.sdump('D_CAT','\tAppending new stat_cat_entry = ');
- }
- mw.sdump('D_CAT',js2JSON(local_stat_cat_entries[menuitem.value]) + '\n');
- entries.push( local_stat_cat_entries[ menuitem.value ] );
- copy.stat_cat_entries( entries );
-}
-
-var add_to_listbox_first_comma = 0;
-
-function add_to_listbox(cn_pos,cp_pos,name,callnumber,barcode) {
- mw.sdump('D_CAT','xul: name = ' + name + ' cn = ' + callnumber + ' bc = ' + barcode + '\n');
- var desc = document.getElementById('description_box');
- if (add_to_listbox_first_comma++ == 0) {
- desc.appendChild( document.createTextNode( ' ' + barcode ) );
- } else {
- desc.appendChild( document.createTextNode( ', ' + barcode ) );
- }
- /*
- var listbox = document.getElementById('ephemeral_listbox');
- var listitem = document.createElement('listitem');
- listitem.setAttribute('cn_pos',cn_pos);
- listitem.setAttribute('cp_pos',cp_pos);
- listbox.appendChild(listitem);
- var listcell1 = document.createElement('listcell');
- listcell1.setAttribute('label',name);
- listitem.appendChild(listcell1);
- var listcell2 = document.createElement('listcell');
- listcell2.setAttribute('label',callnumber);
- listitem.appendChild(listcell2);
- var listcell3 = document.createElement('listcell');
- listcell3.setAttribute('label',barcode);
- listitem.appendChild(listcell3);
- */
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Copy Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="copy_win" title="©.title;"
- orient="vertical" style="overflow: scroll" persist="width height"
- onload="
- my_init();
- "
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/copy_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="copy_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="copy_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="copy_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="copy_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_add" title="©.wizard.title;"
- orient="vertical" style="overflow: auto"
- onload="my_init();" width="800" height="600"
- onwizardfinish="send_to_bill();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/volume_copy_add_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="volume_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="volume_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="volume_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <!--<wizardpage id="page1"/>-->
- <wizardpage id="page2"/>
- <wizardpage id="page3"/>
- <wizardpage id="page4"/>
-
-</wizard>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="copy_display_win" title="hello"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <OpenSRF id="OpenSRF_js"/>
- <util id="util_js"/>
-
- <vbox id="copy_display_vbox" flex="1" pack="center" align="center">
- <label name="click_label" datum="1" click_evt="click_evt"/>
- <label name="edit_date" datum="1" render_filter="^(.){10}" click_evt="click_evt" />
- <label name="call_number" datum="1" render_path="label" click_evt="click_evt" />
- <label name="fine_level" datum="1" click_evt="click_evt"/>
- <label name="creator" datum="1" render_path="usrname" click_evt="click_evt"/>
- <label name="creator" datum="1" render_path="home_ou/name" click_evt="click_evt"/>
- <textbox name="status" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
- <textbox name="circulate" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
- <label name="circ_as_type" datum="1" click_evt="click_evt"/>
- <label name="stat_cat_entries" datum="1" click_evt="click_evt"/>
- <label name="isnew" datum="1" click_evt="click_evt"/>
- <label name="editor" datum="1" render_path="usrname" click_evt="click_evt"/>
- <label name="ischanged" datum="1" click_evt="click_evt"/>
- <label name="id" datum="1" click_evt="click_evt"/>
- <label name="isdeleted" datum="1" click_evt="click_evt"/>
- <textbox name="deposit" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
- <label name="location" datum="1" click_evt="click_evt"/>
- <label name="loan_duration" datum="1" click_evt="click_evt"/>
- <label name="ref" datum="1" click_evt="click_evt"/>
- <label name="create_date" datum="1" click_evt="click_evt"/>
- <textbox name="barcode" datum="1" change_evt="validate_evt,edit_evt" click_evt="click_evt" />
- <label name="deposit_amount" datum="1" click_evt="click_evt"/>
- <textbox name="opac_visible" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
- <label name="copy_number" datum="1" click_evt="click_evt"/>
- <textbox name="price" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
- <label name="circ_modifier" datum="1" click_evt="click_evt"/>
- <label name="circ_lib" datum="1" render_path="name" click_evt="click_evt"/>
- </vbox>
-
-</window>
-
+++ /dev/null
-var cn_list;
-
-function copy_edit_init() {
- mw.sdump('D_CAT','entering my_init for copy_edit.js\n');
- mw.sdump('D_CAT','TESTING: copy_edit.js: ' + mw.G['main_test_variable'] + '\n');
- mw.sdump('D_CAT','Gathering copies to put in the acn object...\n');
- var id_mapped_list = [];
- var filtered_list = [];
- if (params.tree) {
- var list = get_list_from_tree_selection( params.tree );
- mw.sdump('D_CAT','list.length = ' + list.length + '\n');
- filtered_list = filtered_list.concat(
- filter_list(
- list,
- function (obj) {
- return (obj.getAttribute('object_type') == 'copy');
- }
- )
- );
- mw.sdump('D_CAT','filtered_list.length = ' + filtered_list.length + '\n');
- id_mapped_list = id_mapped_list.concat(
- map_list(
- filtered_list,
- function (obj) {
- return obj.getAttribute('copy_id');
- }
- )
- );
- mw.sdump('D_CAT','id_mapped_list.length = ' + id_mapped_list.length + '\n');
- }
- if (params.copy_ids) {
- id_mapped_list = id_mapped_list.concat( params.copy_ids );
- }
- var result = [];
- try {
- result = user_request(
- 'open-ils.search',
- 'open-ils.search.asset.copy.fleshed.batch.retrieve',
- [ id_mapped_list ]
- )[0];
- } catch(E) {
- handle_error(E);
- }
- mw.sdump('D_CAT','result.length = ' + result.length + '\n');
- cn_list = new Array();
- for (var i in result) {
- cn_list[i] = new acn();
- try { cn_list[i].label( filtered_list[i].getAttribute('callnumber') ); } catch(E) { cn_list[i].label( 'dummy callnumber' ); }
- try { cn_list[i].owning_lib( filtered_list[i].getAttribute('ou_id') ); } catch(E) { cn_list[i].owning_lib( 1 ); }
- cn_list[i].copies( [ result[i] ] );
- }
- mw.sdump('D_CAT','cn_list = ' + js2JSON(cn_list) + '\n');
- spawn_legacy_copy_editor();
-}
-
-function spawn_legacy_copy_editor() {
- mw.sdump('D_CAT','trying to spawn_copy_editor()\n');
- var params = { 'select_all' : true };
- var chrome = 'chrome://evergreen/content/cat/copy.xul';
- var frame = document.getElementById('copy_edit_frame');
- frame.setAttribute('src',chrome);
- frame.setAttribute('flex','1');
- frame.contentWindow.cn_list = cn_list;
- frame.contentWindow.mw = mw;
- frame.contentWindow.real_parentWindow = this;
- frame.contentWindow.parentWindow = window.app_shell;
- frame.contentWindow.params = params;
-}
-
-function save_edited_copies() {
- //mw.sdump('D_CAT','trying to save ====================================================================================\n\n\n');
- //mw.sdump('D_CAT','cn_list = ' + js2JSON(cn_list) + '\n\n');
- var copies = [];
- for (var i = 0; i < cn_list.length; i++) {
- var cn_copies = cn_list[i].copies();
- for (var j = 0; j < cn_copies.length; j++) {
- copies.push( cn_copies[j] );
- }
- }
- //mw.sdump('D_CAT','copies = ' + js2JSON(copies) + '\n\n');
- try {
- var result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.copy.fleshed.batch.update',
- [ mw.G.auth_ses[0], copies ]
- )[0];
- if (result == '1') {
- alert('Successfully updated these copies.\n');
- } else {
- throw('There was an error updating the copies.\n');
- }
- mw.sdump('D_CAT','Result = ' + js2JSON(result) + '\n');
- refresh_spawning_browse_list();
- } catch(E) {
- handle_error(E);
- }
-}
-
-function refresh_spawning_browse_list() {
- try {
- params.refresh_func();
- } catch(E) {
- mw.sdump('D_CAT','refresh_spawning_browse_list error: ' + js2JSON(E) + '\n');
- }
-}
-
-function spawn_marc_from_copy_editor() {
- try {
- var record_id = user_request(
- 'open-ils.search',
- 'open-ils.search.biblio.find_by_barcode',
- [ cn_list[0].copies()[0].barcode() ]
- )[0].ids[0];
- marc_view(app_shell,record_id);
- } catch(E) {
- handle_error(E);
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Copy Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="copy_edit_win" title="©.title;"
- orient="vertical" style="overflow: scroll" persist="width height"
- onload=" copy_edit_init(); "
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/copy_edit_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="copy_edit_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="copy_edit_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="copy_edit_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="copy_edit_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="copy_edit_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="copy_edit_js">
- <util id="util_js"/>
- <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
- <script src="chrome://evergreen/content/util/ses.js" />-->
- <script src="copy_edit.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="copy_edit_cmds">
- <command id="cmd_alert" oncommand="
- alert(event.target.tagName + ' Not Yet Implemented');
- "/>
- <command id="cmd_edit_save" oncommand="
- save_edited_copies();
- "/>
- <command id="cmd_edit_close" oncommand="
- mw.close_tab(app_shell,'main_tabbox');
- "/>
- <command id="cmd_view_marc" oncommand="
- spawn_marc_from_copy_editor();
- "/>
- <command id="cmd_refresh_parent" oncommand="
- refresh_spawning_browse_list();
- "/>
-</commandset>
-
-<vbox id="copy_edit_vbox" flex="1">
- <iframe id="copy_edit_frame" flex="1"/>
- <hbox id="copy_edit_hbox" flex="0">
- <button id="copy_edit_close" label="Close Editor" command="cmd_edit_close"/>
- <button id="copy_edit_marc" label="View MARC" command="cmd_view_marc"/>
- <spacer id="copy_edit_spacer" flex="1"/>
- <button id="copy_edit_save" label="Save Changes" command="cmd_edit_save"/>
- </hbox>
-</vbox>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="copy_edit_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="copy_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="copy_js">
- <util id="util_js"/>
- <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
- <script src="chrome://evergreen/content/util/ses.js" />-->
- <script src="copy.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="copy_cmds">
- <command id="cmd_alert" oncommand="
- alert(event.target.tagName + ' Not Yet Implemented');
- "/>
- <command id="cmd_apply" oncommand="
- apply_attribute(event);
- "/>
- <command id="cmd_save" oncommand="
- save_attributes();
- "/>
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="copy_vbox" flex="1">
- <vbox flex="1">
- <hbox flex="1">
- <deck id="pines_info_deck"/>
- <splitter collapse="after"> <grippy/> </splitter>
- <vbox>
- <deck id="local_info_deck"/>
- <!--
- <splitter collapse="after"> <grippy/> </splitter>
- <vbox>
- <listbox id="notes_listbox"/>
- <hbox id="note_button_box"/>
- </vbox>
- -->
- </vbox>
- </hbox>
- <hbox id="copy_button_box"/>
- </vbox>
- <splitter collapse="after"> <grippy/> </splitter>
- <vbox flex="1" hidden="false">
- <deck id="bottom_deck"/>
- </vbox>
-</vbox>
-
-<hbox id="copy_button_box">
- <!--
- <button label="©.save;" accesskey="©.save.key;" command="cmd_alert"/>
- <spacer flex="1"/>
- <button label="©.reload;" accesskey="©.reload.key;" command="cmd_alert"/>
- <button label="©.bucket;" accesskey="©.bucket.key;" command="cmd_alert"/>
- <button label="©.clone;" accesskey="©.clone.key;" command="cmd_alert"/>
- <button label="©.transfer;" accesskey="©.transfer.key;" command="cmd_alert"/>
- <button label="©.delete;" accesskey="©.delete.key;" command="cmd_alert"/>
- <button id="apply_attr_button" label="Apply these Attributes to the selected Copies" command="cmd_apply"/>
- <button id="save_attr_button" label="Save Changes" command="cmd_save"/>
- -->
-</hbox>
-
-<hbox id="note_button_box">
- <hbox flex="1">
- <button label="©.notes.delete;" accesskey="©.notes.delete.key;" command="cmd_alert"/>
- <button label="©.notes.add;" accesskey="©.notes.add.key;" command="cmd_alert"/>
- </hbox>
- <button label="©.close;" accesskey="©.close.key;" oncommand="window.close();"/>
-</hbox>
-
-<deck id="bottom_deck" flex="1">
- <vbox>
- <description id="description_box">Modifying the following copies:</description>
- <listbox id="ephemeral_listbox" flex="1" seltype="multiple" onselect="transfer_attributes(event);" hidden="true">
- <listhead>
- <listheader/>
- <listheader label="Location"/>
- <listheader label="Call Number"/>
- <listheader label="Barcode"/>
- </listhead>
- <listcols>
- <listcol/>
- <listcol flex="1"/>
- <listcol flex="1"/>
- <listcol flex="1"/>
- </listcols>
- </listbox>
- </vbox>
-</deck>
-
-
-<deck id="pines_info_deck" flex="1">
- <vbox>
- <listbox id="pines_attr_listbox"/>
- </vbox>
-</deck>
-
-<deck id="local_info_deck" flex="1">
- <vbox>
- <listbox id="local_attr_listbox"/>
- <hbox pack="end"><button disabled="true" label="©.edit_categories;" command="cmd_alert"/></hbox>
- </vbox>
-</deck>
-
-<!-- At some point we will programatically populate these grids and menus -->
-
-<menulist id="shelving-location-menu">
- <menupopup id="shelving-location-popup" command="cmd_apply">
- <menuitem id="shelving-location-prompt" label="Select one..." hidden="true"/>
- </menupopup>
-</menulist>
-
-<listbox id="notes_listbox" flex="1">
- <listhead>
- <listheader label="©.notes.opac;"/>
- <listheader label="©.notes.date;"/>
- <listheader label="©.notes.from;"/>
- <listheader label="©.notes;"/>
- </listhead>
- <listcols>
- <listcol/>
- <listcol/>
- <listcol/>
- <listcol flex="1"/>
- </listcols>
- <!--
- <listitem allowevents="true">
- <listcell>
- <checkbox/>
- </listcell>
- <listcell label="2004-12-01"/>
- <listcell label="Admin"/>
- <listcell label="Legacy Fields: Item Type = BOOK, Item Cat1 = FICTION, Item Cat2 = ADULT"/>
- </listitem>
- -->
-</listbox>
-
-<listbox id="local_attr_listbox" flex="1">
- <listhead>
- <listheader />
- <listheader label="©.local.attr;"/>
- <listheader label="©.local.attr.value;"/>
- </listhead>
- <listcols>
- <listcol />
- <listcol flex="1"/>
- <listcol flex="2"/>
- </listcols>
- <!--
- <listitem allowevents="true">
- <listcell label="©.attr.stat.genre;"/>
- <listcell>
- <menulist id="stat-genre-menu"/>
- <hbox pack="end" flex="1">
- <button disabled="true" label="©.edit_entries;" command="cmd_alert"/>
- </hbox>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.stat.audience;"/>
- <listcell>
- <menulist id="stat-audience-menu"/>
- <hbox pack="end" flex="1">
- <button disabled="true" label="©.edit_entries;" command="cmd_alert"/>
- </hbox>
- </listcell>
- </listitem>
- -->
-</listbox>
-
-<listbox id="pines_attr_listbox" flex="1">
- <listhead>
- <listheader label="©.pines.attr;"/>
- <listheader label="©.pines.attr.value;"/>
- </listhead>
- <listcols>
- <listcol flex="1"/>
- <listcol flex="2"/>
- </listcols>
- <listitem allowevents="true" hidden="true">
- <listcell label="©.attr.barcode;"/>
- <listcell label="330620563200"/>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.copy_status;"/>
- <listcell>
- <menulist id="copy-status-menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.shelving_location;"/>
- <listcell>
- <menulist id="shelving-location-menu"/>
- <!--<hbox pack="end" flex="1">
- <button disabled="true" label="©.edit_entries;" command="cmd_alert"/>
- </hbox>-->
- </listcell>
- </listitem>
-
- <listitem allowevents="true">
- <listcell label="©.attr.circulating_lib;"/>
- <listcell>
- <menulist id="circulating-library-menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.loan_duration;"/>
- <listcell>
- <menulist id="loan-duration-menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.fine_level;"/>
- <listcell>
- <menulist id="fine-level-menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.circulate;"/>
- <listcell>
- <menulist id="circulate_menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.deposit;"/>
- <listcell>
- <menulist id="deposit_menu"/>
- <label value="©.attr.deposit_amount;"/>
- <textbox id="deposit_amount" size="6" onchange="apply_attribute(event);" value="0.00"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.price;"/>
- <listcell>
- <textbox id="price" size="6" onchange="apply_attribute(event);" value="0.00"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.reference_material;"/>
- <listcell>
- <menulist id="reference_menu"/>
- </listcell>
- </listitem>
- <listitem allowevents="true">
- <listcell label="©.attr.opac_visible;"/>
- <listcell>
- <menulist id="opac_visible_menu"/>
- </listcell>
- </listitem>
-</listbox>
-
-<menulist id="opac_visible_menu">
- <menupopup id="opac_visible_popup" command="cmd_apply">
- <menuitem label="©.attr.opac_visible.yes;" value="1" selected="true"/>
- <menuitem label="©.attr.opac_visible.no;" value="0"/>
- </menupopup>
-</menulist>
-
-<menulist id="reference_menu">
- <menupopup id="reference_popup" command="cmd_apply" >
- <menuitem label="©.attr.reference_material.no;" value="0" selected="true"/>
- <menuitem label="©.attr.reference_material.yes;" value="1"/>
- </menupopup>
-</menulist>
-
-<menulist id="deposit_menu">
- <menupopup id="deposit_popup" command="cmd_apply">
- <menuitem label="©.attr.deposit.no;" value="0" selected="true"/>
- <menuitem label="©.attr.deposit.yes;" value="1"/>
- </menupopup>
-</menulist>
-
-<menulist id="circulate_menu">
- <menupopup id="circulate_popup" command="cmd_apply">
- <menuitem label="©.attr.circulate.yes;" value="1" selected="true"/>
- <menuitem label="©.attr.circulate.no;" value="0"/>
- </menupopup>
-</menulist>
-
-<menulist id="fine-level-menu">
- <menupopup id="fine-level-popup" command="cmd_apply">
- <menuitem label="©.attr.fine_level.normal;" value="2" selected="true"/>
- <menuitem label="©.attr.fine_level.high;" value="3"/>
- <menuitem label="©.attr.fine_level.low;" value="1"/>
- </menupopup>
-</menulist>
-
-<menulist id="loan-duration-menu">
- <menupopup id="loan-duration-popup" command="cmd_apply">
- <menuitem label="©.attr.loan_duration.normal;" value="2" selected="true"/>
- <menuitem label="©.attr.loan_duration.long;" value="3"/>
- <menuitem label="©.attr.loan_duration.short;" value="1"/>
- </menupopup>
-</menulist>
-
-<menulist id="circulating-library-menu">
- <menupopup id="circulating-library-popup" command="cmd_apply">
- </menupopup>
-</menulist>
-
-<menulist id="copy-status-menu">
- <menupopup id="copy-status-popup" command="cmd_apply">
- <!-- <menuitem label="©.attr.copy_status.example1;" value="©.attr.copy_status.example1;"/> -->
- </menupopup>
-</menulist>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="copy_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="details_win" title="Record Details"
- orient="vertical" style="overflow: scroll" width="800" height="500"
- onload="my_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
- <script>
- <![CDATA[
- var myPackageDir = "evergreen";
-
- function my_init() {
-
- /*document.getElementById('copy_editor_tab').disabled = true;*/
- chain_exec(
- my_init_spawn_brief_view,
- my_init_spawn_marc_view,
- my_init_spawn_copy_browser,
- /* my_init_spawn_opac_view, */
- my_init_spawn_marc_editor
- );
-
- }
-
- function my_init_spawn_brief_view() {
- spawn_brief_view(
- document, 'replace_iframe', 'brief_view', {
- 'find_this_id' : find_this_id
- }
- ).find_this_id = find_this_id;
- }
-
- function my_init_spawn_marc_view() {
- var html = user_request(
- "open-ils.search",
- "open-ils.search.biblio.record.html",
- [ find_this_id ]
- )[0];
- spawn_interface(
- document, 'replace_browser', 'marc_view',
- 'data:text/html,' + html,
- 'MARC View2', {}
- );
- }
-
- function my_init_spawn_marc_editor() {
- spawn_marc_editor(
- document, 'replace_iframe', 'marc_edit', {
- 'find_this_id' : find_this_id
- }
- ).find_this_id = find_this_id;
- }
-
- function my_init_spawn_copy_browser() {
- var w = spawn_copy_browser(
- document, 'replace_iframe', 'copy_browser', {
- 'find_this_id' : find_this_id
- }
- );
- w.find_this_id = find_this_id;
- w.parent_window = window;
- }
-
- function my_init_spawn_opac_view() {
- dump('trying to spawn: ' + params.opac_url + '\n');
- spawn_interface(
- document, 'replace_browser', 'opac_view',
- params.opac_url, 'OPAC View', {}
- );
- }
- ]]>
- </script>
-
- <vbox flex="1">
- <hbox id="brief_view"/>
- <tabbox flex="1">
- <tabs>
- <!-- <tab label="OPAC View"/> -->
- <tab label="MARC View"/>
- <tab label="MARC Edit"/>
- <tab label="Copy Browser"/>
- <tab label="Copy Editor" id="copy_editor_tab" />
- </tabs>
- <tabpanels flex="1">
- <!-- <tabpanel id="opac_view"/> -->
- <tabpanel id="marc_view"/>
- <tabpanel id="marc_edit"/>
- <tabpanel id="copy_browser"/>
- <tabpanel id="copy_editor">
- <description>
- Select some copies in the Copy Browser tab to edit.
- </description>
- </tabpanel>
- </tabpanels>
- </tabbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-mw.sdump('D_CAT','loading marc.js\n');
-
-var character_measure = {};
-var tree;
-var meta;
-var backup_tree;
-
-function my_init() {
- mw.sdump('D_CAT','Entering my_init() : ' + timer_elapsed('cat') + '\n');
- mw.sdump('D_CAT','TESTING: marc.js: ' + mw.G['main_test_variable'] + '\n');
-
- try {
- mw.sdump('D_CAT',"DOC ID " + find_this_id + "\n" );
- } catch(E) {
-
- }
-
- if (! params.import_tree ) {
- tree = retrieve_record( find_this_id );
- /*
- meta = retrieve_meta_record( find_this_id );
- document.getElementById('meta_create_date').setAttribute('value',
- meta.create_date().split('.')[0]
- );
- document.getElementById('meta_creator').setAttribute('value',
- meta.creator()
- );
- document.getElementById('meta_edit_date').setAttribute('value',
- meta.edit_date().split('.')[0]
- );
- document.getElementById('meta_editor').setAttribute('value',
- meta.editor()
- );
- document.getElementById('meta_tcn_publisher').setAttribute('value',
- meta.tcn_value()
- );
- if (params.record_columns) {
- var text = document.createTextNode(
- params.record_columns[1] + ' / ' + params.record_columns[2]
- );
- document.getElementById('meta_title_author').appendChild(
- text
- );
- }
- */
- } else {
- tree = params.import_tree;
- }
- if (tree.name() == 'collection') {
- tree = find_list(
- tree.children(),
- function (obj) {
- return (obj.name() == 'record');
- }
- );
- }
-
- //mw.sdump('D_CAT','Retrieved: ' + js2JSON(tree) + '\n');
- //mw.sdump('D_CAT','Retrieved: ' + js2JSON(meta) + '\n');
- build_grid(
- document.getElementById('ctrl_rows'),
- document.getElementById('data_rows'),
- tree
- );
- fixed_fields_show_only('fixed_grid','BKS');
- apply_event_listeners('fixed_grid','fixed');
- character_measure = measure_character('marc_win','M');
- window.addEventListener('resize',my_resize_handler,false);
- handle_tag_change();
- document.getElementById('data_rows').firstChild.firstChild.firstChild.focus();
- mw.sdump('D_CAT','Exiting my_init() : ' + timer_elapsed('cat') + '\n');
-}
-
-function measure_character(w,c) {
- var el = document.getElementById(w);
- var b = document.createElement('hbox');
- var l = document.createElement('label');
- l.setAttribute('class','marc');
- el.appendChild(b);
- b.appendChild(l);
- var lwidth = l.boxObject.width;
- l.value = c;
- lwidth = Math.abs( l.boxObject.width - lwidth);
- var lheight = l.boxObject.height;
- b.removeChild(l); el.removeChild(b);
- return { "width" : lwidth, "height" : lheight };
-}
-
-function my_resize_handler(ev) {
- mw.sdump('D_CAT','resize\n');
- resizeAllWrappers('ctrl_rows');
- resizeAllWrappers('data_rows');
-}
-
-function retrieve_record(id) {
- mw.sdump('D_CAT','Entering retrieve_record() : ' + timer_elapsed('cat') + '\n');
- var result;
- try {
- result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.tree.retrieve',
- [ id ]
- );
- } catch(E) {
- handle_error(E);
- }
- //var result = [ JSON2js( test_nodeset() ) ];
- /*var result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.tree.retrieve.test',
- [ id ]
- );*/
- if (typeof(result[0]) != 'object') {
- alert( 'user_request gave ' + js2JSON(result) );
- mw.sdump('D_CAT','Exiting retrieve_record() : ' + timer_elapsed('cat') + '\n');
- return 0;
- } else {
- /*
- mw.sdump('D_CAT','Entering nodeset2tree() : ' + timer_elapsed('cat') + '\n');
- result[0] = nodeset2tree( result[0] )[0];
- mw.sdump('D_CAT','Exiting nodeset2tree() : ' + timer_elapsed('cat') + '\n');
- */
- mw.sdump('D_CAT','Exiting retrieve_record() : ' + timer_elapsed('cat') + '\n');
- return result[0];
- }
-}
-
-function retrieve_meta_record(id) {
- mw.sdump('D_CAT','Entering retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
- var result;
- try {
- result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.metadata.retrieve',
- [ id ]
- );
- } catch(E) {
- handle_error(E);
- }
- if (typeof(result[0]) != 'object') {
- alert( 'user_request gave ' + js2JSON(result) );
- mw.sdump('D_CAT','Exiting retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
- return 0;
- } else {
- mw.sdump('D_CAT','Exiting retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
- return result[0][0];
- }
-}
-
-
-
-function empty_me(p) {
- while (p.lastChild) {
- //mw.sdump('D_CAT','emptying ' + p.lastChild.tagName + '\n');
- empty_me(p.lastChild);
- p.removeChild(p.lastChild);
- }
-}
-
-function empty_grid( ctrl_rows, data_rows ) {
- var rows = document.getElementById(ctrl_rows);
- empty_me(rows);
- rows = document.getElementById(data_rows);
- empty_me(rows);
-}
-
-function build_grid( ctrl_rows, data_rows, root ) {
- mw.sdump('D_CAT','Entering build_grid() : ' + timer_elapsed('cat') + '\n');
- var ctrl_count = 1; var data_count = 1;
- //mw.sdump('D_CAT', 'what is root?\n' + pretty_print(js2JSON(root)) + '\n');
- mw.sdump('D_CAT','root.children.length = ' + root.children.length + '\n');
- root_loop:
- var children = root.children();
- for (var i in children) {
- var node = children[i];
- var node_type = node.node_type();
- var row = {};
- switch(node_type) {
- case 18: case '18': /* namespace */
- break;
- case 1: case '1': /* element */
- row = get_row(node);
- switch(row.type) {
- case 'leader': case 'controlfield':
- populate_xul_row(
- ctrl_rows,
- row,
- 'ctrl_' + ctrl_count++
- );
- break;
- case 'datafield':
- populate_xul_row(
- data_rows,
- row,
- 'data_' + data_count++
- );
- break;
- default:
- mw.sdump('D_CAT','Unexpected row type: ' +
- js2JSON(node) + '\n');
- break;
- }
- break;
- default: /* eh? */
- mw.sdump('D_CAT', 'Did not expect node_type = ' + node_type +
- ' : ' + js2JSON(node) + '\n');
- break;
- }
- //mw.sdump('D_CAT', i + ' ' + dump_ns_node(node) + '\n');
- }
- mw.sdump('D_CAT','Exiting build_grid() : ' + timer_elapsed('cat') + '\n');
-}
-
-function get_row( top ) {
- var row = {
- 'field' : { 'id' : '1' },
- 'tag' : { 'value' : '', 'id' : '-1' },
- 'ind1' : { 'value' : '', 'id' : '-1' },
- 'ind2' : { 'value' : '', 'id' : '-1' },
- 'data' : { 'value' : '', 'id' : '-1' }
- };
- var name = top.name();
- var id = top.intra_doc_id();
- var children = top.children();
- row.field.id = id;
- mw.sdump('D_CAT','Making row.... row.field.id = <' + id + '>\n');
- if (name == 'leader') { row.tag.value = 'LDR'; row.tag.id = id; }
- row.type = name;
- top_loop:
- for (var i in children) {
- var node = children[i];
- var node_type = node.node_type();
- var node_name = node.name();
- var node_value = node.value();
- var node_id = node.intra_doc_id();
- var node_children = node.children();
- switch(node_type) {
- case 18: case '18': /* namespace */
- continue top_loop;
- case 2: case '2': /* attribute */
- switch(node_name) {
- case 'tag':
- row.tag.value = node_value;
- row.tag.id = node_id;
- break;
- case 'ind1':
- row.ind1.value = node_value;
- row.ind1.id = node_id;
- break;
- case 'ind2':
- row.ind2.value = node_value;
- row.ind2.id = node_id;
- break;
- default:
- mw.sdump('D_CAT','\tattribute surprise on node_name = ' +
- node_name + ' : '
- + js2JSON(node) + '\n');
- break;
- }
- break;
- case 1: case '1': /* element */
- switch(node_name) {
- case 'subfield':
- row.data.value = row.data.value +
- String.fromCharCode(8225) +
- node_children[0].value() + ' ' +
- node_children[1].value() + ' ';
- row.data.id = node_id;
- break;
- default:
- mw.sdump('D_CAT','\telement surprise on node_name = ' +
- node_name + ' : '
- + js2JSON(node) + '\n');
- break;
- }
- break;
- case 3: case '3': /* textNode */
- row.data.value = node_value;
- row.data.id = node_id;
- break;
- default: /* eh? */
- mw.sdump('D_CAT','\tunknown type surprise on node_type = ' +
- node_type + ' : ' +
- js2JSON(node) + '\n');
- break;
- }
- }
- //mw.sdump('D_CAT',js2JSON(row) + '\n');
- return row;
-}
-
-function build_xul_row( id, type ) {
- switch(type) {
- case 'leader': case 'controlfield':
- return build_ctrl_row( id );
- break;
- case 'datafield':
- return build_data_row( id );
- break;
- default:
- mw.sdump('D_CAT','Unexpected row type\n');
- break;
- }
-}
-
-function build_data_row( id ) {
- //mw.sdump('D_CAT','Entering build_xul_row() : ' + timer_elapsed('cat') + '\n');
- var xul_row = document.createElement('row');
- xul_row.setAttribute('id',id);
- xul_row.setAttribute('class','field_row data_row');
- //xul_rows.appendChild(xul_row);
-
- /* the elements in the row */
- var wrapper1 = document.createElement('hbox');
- wrapper1.setAttribute( 'class', 'marc_wrapper marc_tag_wrapper');
- var xul_col1 = document.createElement('textbox');
- xul_col1.setAttribute( 'cols', '3');
- xul_col1.setAttribute( 'rows', '1');
- xul_col1.setAttribute( 'multiline', 'true');
- xul_col1.setAttribute( 'size', '3');
- xul_col1.setAttribute( 'class', 'marc marc_tag');
- wrapper1.appendChild(xul_col1);
- xul_row.appendChild(wrapper1);
- var wrapper2 = document.createElement('hbox');
- wrapper2.setAttribute( 'class', 'marc_wrapper marc_ind_wrapper marc_ind1_wrapper');
- var xul_col2 = document.createElement('textbox');
- xul_col2.setAttribute( 'cols', '1');
- xul_col2.setAttribute( 'rows', '1');
- xul_col2.setAttribute( 'multiline', 'true');
- xul_col2.setAttribute( 'size', '1');
- xul_col2.setAttribute( 'class', 'marc marc_ind marc_ind1');
- wrapper2.appendChild(xul_col2);
- xul_row.appendChild(wrapper2);
- var wrapper3 = document.createElement('hbox');
- wrapper3.setAttribute( 'class', 'marc_wrapper marc_ind_wrapper marc_ind2_wrapper');
- var xul_col3 = document.createElement('textbox');
- xul_col3.setAttribute( 'cols', '1');
- xul_col3.setAttribute( 'rows', '1');
- xul_col3.setAttribute( 'multiline', 'true');
- xul_col3.setAttribute( 'size', '1');
- xul_col3.setAttribute( 'class', 'marc marc_ind marc_ind2');
- wrapper3.appendChild(xul_col3);
- xul_row.appendChild(wrapper3);
- var wrapper4 = document.createElement('hbox');
- wrapper4.setAttribute( 'class', 'marc_wrapper marc_data_wrapper');
- var xul_col4 = document.createElement('textbox');
- xul_col4.setAttribute( 'subfields', 'true');
- xul_col4.setAttribute( 'cols', '60');
- xul_col4.setAttribute( 'size', '60');
- xul_col4.setAttribute( 'rows', '1');
- xul_col4.setAttribute( 'multiline', 'true');
- xul_col4.setAttribute( 'class', 'marc marc_data resizable');
- xul_col4.setAttribute( 'flex', '1');
- wrapper4.appendChild(xul_col4);
- xul_row.appendChild(wrapper4);
-
- return xul_row;
- //mw.sdump('D_CAT','Exiting build_xul_row() : ' + timer_elapsed('cat') + '\n');
-}
-
-function build_ctrl_row( id ) {
- //mw.sdump('D_CAT','Entering build_xul_row() : ' + timer_elapsed('cat') + '\n');
- var xul_row = document.createElement('row');
- xul_row.setAttribute('class','field_row ctrl_row');
- xul_row.setAttribute('id',id);
- //xul_rows.appendChild(xul_row);
-
- /* the elements in the row */
- var wrapper1 = document.createElement('hbox');
- wrapper1.setAttribute( 'class', 'marc_wrapper marc_tag_wrapper ctrl_wrapper');
- var xul_col1 = document.createElement('textbox');
- xul_col1.setAttribute( 'cols', '3');
- xul_col1.setAttribute( 'rows', '1');
- xul_col1.setAttribute( 'multiline', 'true');
- xul_col1.setAttribute( 'size', '3');
- xul_col1.setAttribute( 'class', 'marc marc_tag ctrl');
- xul_col1.setAttribute( 'disabled', 'true');
- wrapper1.appendChild(xul_col1);
- xul_row.appendChild(wrapper1);
- var wrapper4 = document.createElement('hbox');
- wrapper4.setAttribute( 'class', 'marc_wrapper marc_data_wrapper ctrl_wrapper');
- var xul_col4 = document.createElement('textbox');
- xul_col4.setAttribute( 'cols', '60');
- xul_col4.setAttribute( 'size', '60');
- xul_col4.setAttribute( 'rows', '1');
- xul_col4.setAttribute( 'multiline', 'true');
- xul_col4.setAttribute( 'class', 'marc marc_data ctrl');
- xul_col4.setAttribute( 'flex', '1');
- xul_col4.setAttribute( 'disabled', 'true');
- wrapper4.appendChild(xul_col4);
- xul_row.appendChild(wrapper4);
-
- return xul_row;
- //mw.sdump('D_CAT','Exiting build_xul_row() : ' + timer_elapsed('cat') + '\n');
-}
-
-
-function apply_event_listeners(c,which) {
- switch(which) {
- case 'ctrl':
- break;
- case 'data':
- c[0].firstChild.addEventListener("change",handle_tag_change,false);
- c[0].firstChild.addEventListener("keypress",handle_keypress,false);
- c[1].firstChild.addEventListener("keypress",handle_keypress,false);
- c[1].firstChild.addEventListener("change",handle_tag_change,false);
- c[2].firstChild.addEventListener("keypress",handle_keypress,false);
- c[2].firstChild.addEventListener("change",handle_tag_change,false);
- c[3].firstChild.addEventListener("keypress",handle_keypress,false);
- c[3].firstChild.addEventListener("change",handle_tag_change,false);
- c[3].firstChild.addEventListener("change",handle_change,false);
- break;
- case 'fixed':
- var g = document.getElementById(c);
- var nl = g.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- nl[i].addEventListener("change",handle_fixed_change,false);
- }
- }
- break;
- }
-}
-
-function populate_xul_row( xul_rows, row, id ) {
-
- var r = document.getElementById(id);
- if (!r) {
- r = build_xul_row(id,row.type);
- xul_rows.appendChild(r);
- //r = document.getElementById(id);
- }
- r.setAttribute('notempty','true');
- r.setAttribute('mynode',row.field.id);
- var c = r.childNodes;
- switch(row.type) {
- case 'leader': case 'controlfield':
- c[0].firstChild.value = row.tag.value;
- c[0].firstChild.select();
- c[0].firstChild.setAttribute('mynode', row.tag.id);
- c[1].firstChild.value = row.data.value;
- c[1].firstChild.select();
- c[1].firstChild.setAttribute('mynode', row.data.id);
- apply_event_listeners(c,'ctrl');
- break;
- case 'datafield':
- c[0].firstChild.value = row.tag.value;
- c[0].firstChild.select();
- c[0].firstChild.setAttribute('mynode', row.tag.id);
- c[1].firstChild.value = row.ind1.value;
- c[1].firstChild.select();
- c[1].firstChild.setAttribute('mynode', row.ind1.id);
- c[2].firstChild.value = row.ind2.value;
- c[2].firstChild.select();
- c[2].firstChild.setAttribute('mynode', row.ind2.id);
- c[3].firstChild.value = row.data.value;
- c[3].firstChild.select();
- c[3].firstChild.setAttribute('mynode', row.data.id);
- apply_event_listeners(c,'data');
- break;
- }
- //resizeWrapper(c3);
-}
-
-function handle_change(ev) {
- mw.sdump('D_CAT','handle_change\n');
- var t = ev.target;
- // parse subfields
- resizeWrapper(t);
-}
-
-function resizeWrapper(t) {
- if (t.tagName != 'textbox') { return; }
- var wrapper = t.parentNode;
- var width = wrapper.boxObject.width;
- var height = wrapper.boxObject.height;
-
- /*var lwidth = character_measure.width * t.value.length; // linux */
- var lwidth = (character_measure.width*2+5) * t.value.length; // windows
- var lheight = character_measure.height;
-
- if (width == 0) { width = lwidth; }
- var xrows = Math.ceil( lwidth / width );
- if (xrows < 1) { xrows = 1; }
- var xheight = (xrows * (lheight+5));
-
- //mw.sdump('D_CAT',wrapper.parentNode.id + ' wrapper: ' + width + 'x' + height + ' label: ' + lwidth + 'x' + lheight + '\n');
- wrapper.setAttribute('style','min-height: ' + xheight + 'px;');
-}
-
-function resizeAllWrappers(rows) {
- mw.sdump('D_CAT','Entering resizeAllWrappers() : ' + timer_elapsed('cat') + '\n');
- var p = document.getElementById(rows);
- var c = p.childNodes;
- for (var r in c) {
- if (typeof(c[r])=='object') {
- if (c[r].getAttribute('notempty')) {
- resizeWrapper(c[r].lastChild.firstChild);
- } else {
- p.removeChild(c[r]);
- }
- }
- }
- mw.sdump('D_CAT','Exiting resizeAllWrappers() : ' + timer_elapsed('cat') + '\n');
-}
-
-function find_element_with_id(ns_slice,id) {
- // we might change this in the future to be a hash lookup
- // { node id => [lvl 1 index, lvl 2 index, lvl 3 index] }
- // with the hash being populated when the tree is generated
- // and updated when we go to insert nodes
- //mw.sdump('D_CAT','Find ' + id + ' in ' + js2JSON(ns_slice) + '\n');
- //mw.sdump('D_CAT','Find ' + id + '\n');
- for (i in ns_slice) {
- if (ns_slice[i].intra_doc_id() == id) {
- //mw.sdump('D_CAT','Found at index ' + i + '\n');
- return i;
- }
- }
- mw.sdump('D_CAT',id + 'not found in' + js2JSON(ns_slice) + '\n');
-}
-
-function delete_children(branch) {
- var children = branch.children();
- for (var c in children) {
- children[c].isdeleted(1);
- mw.sdump('D_CAT', children[c].name() + ':' +
- children[c].id() + ':' +
- children[c].intra_doc_id() + '.is_deleted = 1\n');
- if (children[c].children()) {
- delete_children(children[c]);
- }
- }
-}
-
-function submit_marc() {
- // walk through the marc grid and compare with the tree
- // 1) updates and deletes
-
-mw.sdump('D_CAT','Updates and Deletes\n');
- backup_tree = JSON2js( js2JSON( tree ) );
-
- var tree_fields = tree.children(); // LEVEL 1
- var ctrl_rows = document.getElementById('ctrl_rows').childNodes;
- for (var r = 0; r < ctrl_rows.length ; r++) {
- //if (r == 0) { continue; } // skip leader for now
- //mw.sdump('D_CAT', r + '\n');
- var tag_node_id;
- try {
- tag_node_id = ctrl_rows[r].getAttribute('mynode');
- } catch(E) {
- mw.sdump('D_CAT','Could not find mynode in ctrl_rows[' + r + ']\n');
- continue;
- }
- //mw.sdump('D_CAT', r + ':' + ctrl_rows[r].tagName + ':' + tag_node_id + '\n' );
- if (tag_node_id) {
-mw.sdump('D_CAT','Processing ctrl_rows[' + r + '], tag_node_id = ' + tag_node_id + '\n');
- if (tag_node_id < 0) { continue; } // new node, handle elsewhere
-mw.sdump('D_CAT','1st find =========================================\n')
- var tree_pos = find_element_with_id(tree_fields,tag_node_id);
- if (tree_pos == null) { alert('tree_pos problem!'); }
- var tree_field = tree_fields[tree_pos];
-
- if (ctrl_rows[r].getAttribute('hidden') == 'true') {
- tree_field.isdeleted(1);
- mw.sdump('D_CAT', tree_field.name() + ':' +
- tree_field.id() + ':' +
- tree_field.intra_doc_id() + '.isdeleted = 1\n');
- delete_children(tree_field);
- continue;
- }
-
- var col1 = ctrl_rows[r].childNodes[0].firstChild;
- var col2 = ctrl_rows[r].childNodes[1].firstChild;
- var id1 = col1.getAttribute('mynode');
- var id2 = col2.getAttribute('mynode');
- mw.sdump('D_CAT','id1 = ' + id1 + ' col1.value = ' + col1.value + ' id2 = ' + id2 + ' col2.value = ' + col2.value + '\n');
- var tree_field_children = tree_field.children(); // LEVEL 2
-
- if (r == 0) { // leader is special. Only one child
- if (tree_field_children[0].value() != col2.value) {
- tree_field_children[0].value(col2.value);
- tree_field_children[0].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[0].name() + ':' +
- tree_field_children[0].id() + ':' +
- tree_field_children[0].intra_doc_id() +
- '.ischanged = 1\n');
- }
- continue;
- }
-
-mw.sdump('D_CAT','2nd find =========================================\n')
- var tree_tag = find_element_with_id(tree_field_children,id1);
-mw.sdump('D_CAT','3rd find =========================================\n')
- var tree_value = find_element_with_id(tree_field_children,id2);
- if (tree_tag == null) { alert('tree_tag problem!'); }
- if (tree_value == null) { alert('tree_value problem!'); }
- if (tree_field_children[tree_tag].value() != col1.value) {
- tree_field_children[tree_tag].value(col1.value);
- tree_field_children[tree_tag].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[tree_tag].name() + ':' +
- tree_field_children[tree_tag].id() + ':' +
- tree_field_children[tree_tag].intra_doc_id() +
- '.ischanged = 1\n');
- }
- if (tree_field_children[tree_value].value() != col2.value) {
- tree_field_children[tree_value].value(col2.value);
- tree_field_children[tree_value].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[tree_value].name() + ':' +
- tree_field_children[tree_value].id() + ':' +
- tree_field_children[tree_value].intra_doc_id() +
- '.ischanged = 1\n');
- }
- }
- }
- var data_rows = document.getElementById('data_rows').childNodes;
- for (var r = 0; r < data_rows.length ; r++ ) {
- var tag_node_id;
- try {
- tag_node_id = data_rows[r].getAttribute('mynode');
- } catch(E) {
- continue;
- }
- //mw.sdump('D_CAT', r + ':' + data_rows[r].tagName + ':' + tag_node_id + '\n' );
- if (tag_node_id) {
-mw.sdump('D_CAT','Processing data_rows[' + r + '], tag_node_id = ' + tag_node_id + '\n');
- if (tag_node_id < 0) { continue; } // new node, handle elsewhere
-mw.sdump('D_CAT','4th find =========================================\n')
- var tree_pos = find_element_with_id(tree_fields,tag_node_id);
- if (tree_pos == null) { alert('tree_pos problem!'); }
- var tree_field = tree_fields[tree_pos];
-
- if (data_rows[r].getAttribute('hidden') == 'true') {
- tree_field.isdeleted(1);
- mw.sdump('D_CAT',tree_field.name() + ':' +
- tree_field.id() + ':' +
- tree_field.intra_doc_id() +
- '.isdeleted = 1\n');
- delete_children(tree_field);
- continue;
- }
-
- var col1 = data_rows[r].childNodes[0].firstChild;
- var col2 = data_rows[r].childNodes[1].firstChild;
- var col3 = data_rows[r].childNodes[2].firstChild;
- var col4 = data_rows[r].childNodes[3].firstChild;
- var id1 = col1.getAttribute('mynode');
- var id2 = col2.getAttribute('mynode');
- var id3 = col3.getAttribute('mynode');
- var id4 = col4.getAttribute('mynode');
- var tree_field_children = tree_field.children(); // LEVEL 2
-mw.sdump('D_CAT','5th find =========================================\n')
- var tree_tag = find_element_with_id(tree_field_children,id1);
-mw.sdump('D_CAT','6th find =========================================\n')
- var tree_ind1 = find_element_with_id(tree_field_children,id2);
-mw.sdump('D_CAT','7th find =========================================\n')
- var tree_ind2 = find_element_with_id(tree_field_children,id3);
-mw.sdump('D_CAT','8th find =========================================\n')
- var tree_data = find_element_with_id(tree_field_children,id4);
- if (tree_tag == null) { alert('tree_tag problem!'); }
- if (tree_ind1 == null) { alert('tree_ind1 problem!'); }
- if (tree_ind2 == null) { alert('tree_ind2 problem!'); }
- if (tree_data == null) { alert('tree_data problem!'); }
- if (tree_field_children[tree_tag].value() != col1.value) {
- tree_field_children[tree_tag].value(col1.value);
- tree_field_children[tree_tag].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[tree_tag].name() + ':' +
- tree_field_children[tree_tag].id() + ':' +
- tree_field_children[tree_tag].intra_doc_id() +
- '.is_changed = 1\n');
- }
- if (tree_field_children[tree_ind1].value() != col2.value) {
- tree_field_children[tree_ind1].value(col2.value);
- tree_field_children[tree_ind1].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[tree_ind1].name() + ':' +
- tree_field_children[tree_ind1].id() + ':' +
- tree_field_children[tree_ind1].intra_doc_id() +
- '.is_changed = 1\n');
- }
- if (tree_field_children[tree_ind2].value() != col3.value) {
- tree_field_children[tree_ind2].value(col3.value);
- tree_field_children[tree_ind2].ischanged(1);
- mw.sdump('D_CAT', tree_field_children[tree_ind2].name() + ':' +
- tree_field_children[tree_ind2].id() + ':' +
- tree_field_children[tree_ind2].intra_doc_id() +
- '.is_changed = 1\n');
- }
- process_subfields(tree_field_children,col4.value); // LEVEL 3
- }
- }
-
-
- // 2) inserts
-mw.sdump('D_CAT','Inserts\n');
-
- for (var r = 0; r < ctrl_rows.length ; r++) {
- var newnode;
- try {
- newnode = ctrl_rows[r].getAttribute('newnode');
- } catch(E) {
- continue;
- }
- if (newnode=='true') {
-mw.sdump('D_CAT','New node = ctrl_rows[' + r + ']');
- if (ctrl_rows[r].getAttribute('hidden')=='true') { continue; }
- var col1 = ctrl_rows[r].childNodes[0].firstChild.value;
- var col2 = ctrl_rows[r].childNodes[1].firstChild.value;
- var level1 = new brn();
- populate_node( level1, 1, 'controlfield' );
- var level2a = new brn();
- populate_node( level2a, 2, 'tag' );
- level2a.value(col1);
- var level2b = new brn();
- populate_node( level2b, 3, null );
- level2b.value(col2);
- level1.children([ level2a, level2b ]);
- ctrl_rows[r].setAttribute('mynode', level1.intra_doc_id());
-mw.sdump('D_CAT',' with intra_doc_id = ' + level1.intra_doc_id() + '\n');
- insert_into_tree(tree.children(),ctrl_rows[r],level1);
- }
- }
-
- for (var r = 0; r < data_rows.length ; r++) {
- var newnode;
- try {
- newnode = data_rows[r].getAttribute('newnode');
- } catch(E) {
- continue;
- }
- if (newnode=='true') {
-mw.sdump('D_CAT','New node = data_rows[' + r + ']');
- if (data_rows[r].getAttribute('hidden')=='true') { continue; }
- var col1 = data_rows[r].childNodes[0].firstChild.value;
- var col2 = data_rows[r].childNodes[1].firstChild.value;
- var col3 = data_rows[r].childNodes[2].firstChild.value;
- var col4 = data_rows[r].childNodes[3].firstChild.value;
- var level1 = new brn();
- populate_node( level1, 1, 'datafield' );
- var level2a = new brn();
- populate_node( level2a, 2, 'tag' );
- level2a.value(col1);
- var level2b = new brn();
- populate_node( level2b, 2, 'ind1' );
- level2b.value(col2);
- var level2c = new brn();
- populate_node( level2c, 2, 'ind2' );
- level2c.value(col3);
- level1.children([ level2a, level2b, level2c ]);
- process_subfields(level1.children(),col4);
- data_rows[r].setAttribute('mynode', level1.intra_doc_id());
-mw.sdump('D_CAT',' with intra_doc_id = ' + level1.intra_doc_id() + '\n');
- insert_into_tree(tree.children(),data_rows[r],level1);
- }
-
- }
- //mw.sdump('D_CAT','******\nSending: ' + pretty_print(js2JSON(tree)) + '\n');
- mw.sdump('D_CAT','Auth session: ' + mw.G['auth_ses'][0] + '\n');
- try {
- if (params.import_tree) {
-
- if (params.new_tree) {
- tree = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record_tree.create',
- [ mw.G.auth_ses[0], tree ]
- )[0];
- } else {
- tree = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.tree.import',
- [ mw.G['auth_ses'][0], tree ]
- )[0];
- }
- } else {
- tree = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.record.tree.commit',
- [ mw.G['auth_ses'][0], tree ]
- )[0];
- }
- if (typeof(tree) == 'object') {
- mw.sdump('D_CAT','\n\n\n\nnew tree = ' + js2JSON(tree) + '\n');
- params.import_tree = false;
- new_node_id = -1;
- empty_grid('ctrl_rows','data_rows');
- build_grid(
- document.getElementById('ctrl_rows'),
- document.getElementById('data_rows'),
- tree
- );
- handle_tag_change();
- my_resize_handler();
- alert('MARC record successfully updated.');
- } else {
- throw('result: ' + tree + '\n');
- }
- } catch(E) {
- mw.sdump('D_CAT','backup_tree\n');
- tree = backup_tree;
- handle_tag_change();
- my_resize_handler();
- handle_error(E);
- }
-}
-
-function insert_into_tree(branch,r,n) {
- var s = nextSibling_not_hidden(r);
- if (s) {
- mw.sdump('D_CAT','9th find =========================================\n')
- mw.sdump('D_CAT','s = ' + s + '\n');
- mw.sdump('D_CAT','s.getAttribute mynode = <' + s.getAttribute('mynode') + '>\n');
- var pos = find_element_with_id(branch,s.getAttribute('mynode'));
- branch.splice(pos,0,n);
- } else {
- branch.push(n);
- }
-}
-
-var new_node_id = -1;
-function populate_node(node,ntype,name) {
- node.intra_doc_id( new_node_id-- );
- node.isnew( 1 );
- node.node_type( ntype );
- node.name( name );
- mw.sdump('D_CAT', node.name() + ':' + node.intra_doc_id() + '.is_new = 1\n');
-}
-
-function process_subfields(tfc,datastring) {
- mw.sdump('D_CAT','process_subfields: <' + tfc + '> <' + datastring + '>\n');
- var orig_subfields = [];
- //mw.sdump('D_CAT','\n');
- for (var i in tfc) {
- mw.sdump('D_CAT',i + ' : ' + typeof(tfc[i]) + ' : ' + js2JSON(tfc[i]) + ' : node_type() = ' + tfc[i].node_type() + '\n');
- try {
- if (tfc[i].node_type() == 1) {
- var orig_data = tfc[i].children()[1].value();
- orig_data = orig_data.replace(/^\s+/,'').replace(/\s+$/,'');
- orig_subfields.push( [
- i, // subfield node index
- tfc[i].children()[0].value(), // subf indicator
- orig_data // data
- ] );
- }
-
- } catch(E) {
- mw.sdump('D_CAT','\tan error? gasp: ' + js2JSON(E) + '\n');
- continue;
- }
- }
- datastring = datastring.replace(/^\s+/,'').replace(/\s+$/,'');
- var local_subf_array = datastring.split(String.fromCharCode(8225));
- // Our validation routines should assert that the beginning of
- // a data string start with the subfield delimiter symbol. We're
- // passing the buck of the 'implicit' subfield-a check elsewhere.
- local_subf_array.shift();
- mw.sdump('D_CAT','orig_subfields = ' + js2JSON(orig_subfields) + '\n');
- mw.sdump('D_CAT','local_subfields = ' + js2JSON(local_subf_array) + '\n');
- for (var i in local_subf_array) {
- if ((local_subf_array[i]=='')||(local_subf_array==null)) { continue; }
- var s_ind = local_subf_array[i].substr(0,1);
- var s_data = local_subf_array[i].substr(1).replace(/^\s+/,'').replace(/\s+$/,'');
- mw.sdump('D_CAT','Processing code = ' + s_ind + ' and value = ' + s_data + '\n');
- if (!orig_subfields[i]) { // new subfield
- mw.sdump('D_CAT','making new subfield : i = ' + i + '\n');
- var level1 = new brn();
- populate_node( level1, 1, 'subfield' );
- var level2a = new brn();
- populate_node( level2a, 2, 'code' );
- level2a.value(s_ind);
- var level2b = new brn();
- populate_node( level2b, 3, null );
- level2b.value(s_data);
- level1.children([ level2a, level2b ]);
- tfc.push(level1);
- mw.sdump('D_CAT','New node = ' + js2JSON(level1) + '\n');
- } else {
- var orig_node = orig_subfields[i][0];
- var orig_ind = orig_subfields[i][1];
- var orig_data = orig_subfields[i][2];
- if (orig_ind != s_ind) { // update subf indicator
- tfc[orig_node].children()[0].value(s_ind);
- tfc[orig_node].children()[0].ischanged(1);
- mw.sdump('D_CAT', tfc[orig_node].children()[0].name() + ':' +
- tfc[orig_node].children()[0].id() + ':' +
- tfc[orig_node].children()[0].intra_doc_id() +
- '.is_changed = 1\n');
- mw.sdump('D_CAT','Updated node = ' + js2JSON(tfc[orig_node].children()[0]) + '\n');
- }
- if (orig_data != s_data) { // update subf data
- tfc[orig_node].children()[1].value(s_data);
- tfc[orig_node].children()[1].ischanged(1);
- mw.sdump('D_CAT', tfc[orig_node].children()[1].name() + ':' +
- tfc[orig_node].children()[1].id() + ':' +
- tfc[orig_node].children()[1].intra_doc_id() +
- '.is_changed = 1\n');
- mw.sdump('D_CAT','Updated node = ' + js2JSON(tfc[orig_node].children()[1]) + '\n');
- }
- }
- }
- // delete any remaining
- for (var i = local_subf_array.length; i < orig_subfields.length; i++) {
- var orig_node = orig_subfields[i][0];
- tfc[orig_node].isdeleted(1);
- mw.sdump('D_CAT', tfc[orig_node].name() + ':' +
- tfc[orig_node].id() + ':' +
- tfc[orig_node].intra_doc_id() + '.is_deleted = 1\n');
- delete_children(tfc[orig_node]);
- }
-}
-
-
-
-function test_nodeset() {
- return null;
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's MARC Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/marc.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="marc_win" title="&cat.title;"
- orient="vertical" style="overflow: scroll"
- width="800" height="600" persist="width height"
- onload="
- my_init();
- "
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/marc_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="marc_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="marc_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="marc_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="marc_vbox" class="test_class"/>
-
-</window>
-
+++ /dev/null
-function pad_fixed(value,field) {
- var padding = '';
- if (field == '008') {
- for (var i = value.length; i<40; i++) {
- padding = padding + ' ';
- }
- } else if (field == 'LDR') {
- for (var i = value.length; i<24; i++) {
- padding = padding + ' ';
- }
- }
- return padding;
-}
-
-
-function handle_fixed_change(ev) {
- mw.sdump('D_CAT','Entering handle_fixed_change\n');
- if (ev.target.tagName != 'textbox') { mw.sdump('D_CAT','early exit\n'); return; }
- var t = ev.target;
- var field = t.getAttribute('field');
- var spos = t.getAttribute('spos');
- var epos = t.getAttribute('epos');
- var size = t.getAttribute('size');
- if ( (epos - spos + 1) != size ) {
- mw.sdump('D_CAT','Invalid fixed field DTD: field='+field+' spos='+spos+
- ' epos='+epos+' size='+size+'\n');
- alert('Invalid fixed field DTD: field='+field+' spos='+spos+
- ' epos='+epos+' size='+size+'\n');
- }
- if (t.value.length > size) {
- t.value = t.value.substr(0,size);
- } else if (t.value.length < size) {
- var padding = '';
- for (var i = 0; i<(size-t.value.length); i++) {
- padding = padding + ' ';
- }
- t.value = t.value + padding;
- }
- var fixed = find_textbox('ctrl_rows', field);
- //mw.sdump('D_CAT','length of fixed: ' + fixed.value.length + '\n');
- fixed.value = fixed.value + pad_fixed(fixed.value,field);
- mw.sdump('D_CAT','length of fixed: ' + fixed.value.length + '\n');
-
- //mw.sdump('D_CAT','field='+field+' spos='+spos+' epos='+epos+' size='+size+' t="'+t.value+'"\n');
- mw.sdump('D_CAT','replacing "'+fixed.value+'"\n');
- fixed.value = fixed.value.substr(0,spos) + t.value + fixed.value.substr(1+Number(epos));
- mw.sdump('D_CAT',' with "'+fixed.value+'"\n');
-}
-
-function find_textbox(where, field) {
- var rows = document.getElementById(where).childNodes;
- var ideal_sibling;
- for (var r in rows) {
- if (typeof(rows[r])=='object') {
- //mw.sdump('D_CAT',r + ':' + rows[r] + '\n');
- var t = rows[r].childNodes[0].firstChild;
- if (t.value == field) {
- return rows[r].childNodes[1].firstChild;
- } else if (t.value < field) {
- ideal_sibling = rows[r];
- }
- }
- }
- var new_r = build_ctrl_row('ctrl_' + new_row_id--);
- new_r.setAttribute('notempty','true');
- new_r.setAttribute('newnode','true');
- if (ideal_sibling.nextSibling) {
- rows.insertBefore(new_r,ideal_sibling.nextSibling);
- } else {
- rows.appendChild(new_r);
- }
- new_r.childNodes[0].firstChild.value = field;
- new_r.childNodes[1].firstChild.value = padding;
- return new_r.childNodes[1].firstChild;
-}
-
-function fixed_fields_update_all(grid) {
- var g = document.getElementById(grid);
- var nl = g.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- var t = nl[i];
- var field = t.getAttribute('field');
- var spos = t.getAttribute('spos');
- var epos = t.getAttribute('epos');
- var size = t.getAttribute('size');
- var data = find_textbox('ctrl_rows',field);
- data.value = data.value + pad_fixed(data.value,field);
- t.value = data.value.substr(spos,size);
- }
- }
-}
-
-
-function fixed_fields_hide_all(grid) {
- var g = document.getElementById(grid);
- var nl = g.getElementsByTagName('label');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- nl[i].setAttribute('hidden','true');
- }
- }
- nl = g.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- nl[i].setAttribute('hidden','true');
- }
- }
-}
-
-function fixed_fields_show_all(grid) {
- var g = document.getElementById(grid);
- var nl = g.getElementsByTagName('label');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- nl[i].setAttribute('hidden','false');
- }
- }
- nl = g.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- nl[i].setAttribute('hidden','false');
- }
- }
-}
-
-function fixed_fields_show_only(grid,attr) {
- fixed_fields_hide_all(grid);
- fixed_fields_update_all(grid);
- var g = document.getElementById(grid);
- var nl = g.getElementsByTagName('label');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- if (nl[i].getAttribute(attr) == 'true') {
- nl[i].setAttribute('hidden','false');
- }
- }
- }
- nl = g.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- if (nl[i].getAttribute(attr) == 'true') {
- nl[i].setAttribute('hidden','false');
- }
- }
- }
-}
-
-
+++ /dev/null
-function handle_keyup(ev) {
- if (ev.target.tagName != 'textbox') { return; }
- //mw.sdump('D_CAT','keyCode:' + ev.keyCode + ' charCode:' + ev.charCode + ' shift:' + ev.shiftKey + ' ctrl:' + ev.ctrlKey + ' meta:' + ev.metaKey + '\n');
- resizeWrapper(ev.target);
-}
-
-function handle_keypress(ev) {
- mw.sdump('D_CAT','keyCode:' + ev.keyCode + ' charCode:' + ev.charCode + ' shift:' + ev.shiftKey + ' ctrl:' + ev.ctrlKey + ' meta:' + ev.metaKey + '\n');
- if (ev.target.tagName != 'textbox') { return; }
- var rstatus = false;
- if (ev.charCode) {
- switch(ev.charCode) {
- case 100:
- if (ev.ctrlKey) { /* control+d */
- rstatus = handle_key_c_d(ev);
- }
- break;
- }
- } else if (ev.keyCode) {
- switch(ev.keyCode) {
- case 13: /* enter */
- case 77: /* mac enter */
- rstatus = handle_key_enter(ev);
- break;
- case 46:
- if (ev.ctrlKey) { /* control+del */
- rstatus = handle_key_c_del(ev);
- }
- break;
- case 9:
- if (ev.shiftKey) { /* shift+tab */
- rstatus = navigate_col_left(ev.target,true);
- } else { /* tab */
- rstatus = navigate_col_right(ev.target,true);
- }
- break;
- }
- }
- resizeWrapper(ev.target);
- if (rstatus) {
- ev.preventDefault();
- }
- return rstatus;
-}
-
-function handle_key_c_d(ev) {
- if (ev.target.tagName != 'textbox') { return; }
- var t = ev.target;
- if ((ev.ctrlKey)&&(ev.charCode==100)&&(t.getAttribute('subfields')=='true')) {
- var n_ev = document.createEvent("KeyEvents");
- if (n_ev) { /* the best way... fake a keypress */
- n_ev.initKeyEvent("keypress", 1, 1, null, 0, 0, 0, 0, 0, 8225);
- t.inputField.dispatchEvent(n_ev);
- } else { /* this destroys the widget's undo buffer */
- var s_start = t.selectionStart; var s_end = t.selectionEnd;
- var first_half = t.value.substr(0,s_start);
- var second_half = t.value.substr(s_end);
- t.value = first_half + String.fromCharCode(8225) + second_half;
- t.setSelectionRange(s_start+1,s_start+1);
- }
- return true;
- } else {
- return false;
- }
-}
-
-function handle_key_c_del(ev) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- if (ev.target.tagName != 'textbox') { return; }
- var t = ev.target;
- var r = t.parentNode.parentNode;
- if ((ev.ctrlKey)&&(ev.keyCode==46)) {
- r.setAttribute('hidden','true');
- handle_tag_change(ev);
- if (! navigate_row_down(t,which_col_am_i(t),false) ) {
- navigate_row_up(t,which_col_am_i(t),false);
- mw.sdump('D_CAT',"let's go up\n");
- }
- return true;
- } else {
- return false;
- }
-}
-
-var new_row_id = -1;
-function handle_key_enter(ev) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- if (ev.target.tagName != 'textbox') { return; }
- var t = ev.target;
- if ((ev.keyCode == 13) || (ev.keyCode == 77)) {
- if (ev.ctrlKey) { // add new row
- var new_r = build_data_row('data_' + new_row_id--);
- new_r.setAttribute('notempty','true');
- new_r.setAttribute('newnode','true');
- var w = t.parentNode;
- var r = w.parentNode;
- var rows = r.parentNode;
- var sibling_row;
- if (ev.shiftKey) {
- sibling_row = r;
- } else {
- sibling_row = r.nextSibling;
- }
- if (sibling_row) {
- rows.insertBefore(new_r,sibling_row);
- } else {
- rows.appendChild(new_r);
- }
- var c = new_r.childNodes;
- apply_event_listeners(c,'data');
- c[1].firstChild.value = ' '; // indicator 1
- c[2].firstChild.value = ' '; // indicator 2
- c[0].firstChild.focus();
- return true;
- } else { // move to next row
- navigate_row_down(t,which_col_am_i(t),true);
- return true;
- }
- } else {
- return false;
- }
-}
-
-function which_col_am_i(t) {
- var r = t.parentNode.parentNode;
- for (var i in r.childNodes) {
- if (t == r.childNodes[i].firstChild) {
- return i;
- }
- }
-}
-
-function nextSibling_not_hidden(e) {
- var s = e.nextSibling;
- while ((s)&&(s.getAttribute('hidden')=='true')) {
- s = s.nextSibling;
- }
- return s;
-}
-
-function previousSibling_not_hidden(e) {
- var s = e.previousSibling;
- while ((s)&&(s.getAttribute('hidden')=='true')) {
- s = s.previousSibling;
- }
- return s;
-}
-
-function navigate_row_down(t,c,wrap) {
- // rows -> row (r) -> wrapper -> textbox (t)
- var r = t.parentNode.parentNode;
- var sibling_row = nextSibling_not_hidden(r);
- if (sibling_row) {
- sibling_row.childNodes[c].firstChild.focus();
- if (c == 0) {
- sibling_row.childNodes[c].firstChild.select();
- }
- } else {
- if (wrap) {
- r.parentNode.firstChild.childNodes[c].firstChild.focus();
- } else {
- return false;
- }
- }
- return true;
-}
-
-function navigate_row_up(t,c,wrap) {
- // rows -> row (r) -> wrapper -> textbox (t)
- var r = t.parentNode.parentNode;
- var sibling_row = previousSibling_not_hidden(r);
- if (sibling_row) {
- sibling_row.childNodes[c].firstChild.focus();
- } else {
- if (wrap) {
- r.parentNode.lastChild.childNodes[c].firstChild.focus();
- } else {
- return false;
- }
- }
- return true;
-}
-
-function navigate_col_left(t,wrap) {
- // rows -> row -> wrapper (w) -> textbox (t)
- var w = t.parentNode;
- var sibling_wrapper = w.previousSibling;
- if (sibling_wrapper) {
- sibling_wrapper.firstChild.focus();
- if (sibling_wrapper.parentNode.childNodes[3] != sibling_wrapper) {
- sibling_wrapper.firstChild.select();
- }
- } else {
- if (wrap) {
- return navigate_row_up(t,3,false);
- } else {
- return false;
- }
- }
- return true;
-}
-
-function navigate_col_right(t,wrap) {
- // rows -> row -> wrapper (w) -> textbox (t)
- var w = t.parentNode;
- var sibling_wrapper = w.nextSibling;
- if (sibling_wrapper) {
- sibling_wrapper.firstChild.focus();
- if (sibling_wrapper.parentNode.childNodes[3] != sibling_wrapper) {
- sibling_wrapper.firstChild.select();
- }
- } else {
- if (wrap) {
- return navigate_row_down(t,0);
- } else {
- return false;
- }
- }
- return true;
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="marc_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="marc_js">
- <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
- <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
- <script src="chrome://evergreen/content/util/ses.js" />-->
- <util id="util_js"/>
- <script src="marc_rules.js" />
- <script src="marc_validate.js" />
- <script src="marc_fixed.js" />
- <script src="marc_keys.js" />
- <script src="marc.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="marc_cmds">
- <command id="cmd_marc_validate" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- validate_marc();
- "/>
- <command id="cmd_marc_explain" oncommand="
- explain_marc();
- "/>
- <command id="cmd_marc_submit" oncommand="
- submit_marc();
- "/>
- <command id="cmd_marc_reload" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- reload_marc();
- "/>
- <command id="cmd_marc_export" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- export_marc();
- "/>
- <command id="cmd_marc_legend" oncommand="
- legend_marc();
- "/>
- <command id="cmd_close_window" oncommand="
- mw.close_tab(app_shell,'main_tabbox');
- "/>
- <command id="cmd_marc_fixed_BKS" oncommand="
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','BKS');
- "/>
- <command id="cmd_marc_fixed_SER" oncommand="
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','SER');
- "/>
- <command id="cmd_marc_fixed_VIS" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','VIS');
- "/>
- <command id="cmd_marc_fixed_MIX" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','MIX');
- "/>
- <command id="cmd_marc_fixed_MAP" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','MAP');
- "/>
- <command id="cmd_marc_fixed_SCO" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','SCO');
- "/>
- <command id="cmd_marc_fixed_REC" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','REC');
- "/>
- <command id="cmd_marc_fixed_COM" disabled="true" oncommand="
- alert('Feature Not Yet Implemented');
- document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
- fixed_fields_show_only('fixed_grid','COM');
- "/>
- <command id="cmd_marc_control_fields" oncommand="
- var deck = document.getElementById('data_deck');
- if (deck.getAttribute('selectedIndex') == '1') {
- deck.setAttribute('selectedIndex','0');
- } else {
- deck.setAttribute('selectedIndex','1');
- }
- "/>
- <command id="cmd_marc_cover_art" oncommand="
- var box = document.getElementById('art_groupbox');
- if (box.getAttribute('hidden') == 'true') {
- box.setAttribute('hidden','false');
- } else {
- box.setAttribute('hidden','true');
- }
- "/>
- <command id="cmd_marc_meta_data" oncommand="
- var box = document.getElementById('meta_groupbox');
- if (box.getAttribute('hidden') == 'true') {
- box.setAttribute('hidden','false');
- } else {
- box.setAttribute('hidden','true');
- }
- "/>
-
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="marc_vbox" flex="1">
- <toolbox id="marc_toolbox"/>
-<!-- <deck id="meta_deck"/>
- <splitter collapse="before"> <grippy/> </splitter> -->
- <deck id="ctrl_deck"/>
- <splitter collapse="before"> <grippy/> </splitter>
- <deck id="data_deck"/>
- <hbox id="marc_buttons_box"/>
-</vbox>
-
-<hbox id="marc_buttons_box" class="marc_buttons_box">
- <button label="&marc.file.close;" accesskey="&marc.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
- <button label="&marc.file.reload;" accesskey="&marc.file.reload.key;" key="file-reload-key" observes="cmd_marc_reload"/>
- <button label="&marc.file.publish;" accesskey="&marc.file.publish.key;" key="file-publish-key" observes="cmd_marc_submit"/>
-</hbox>
-
-<!-- The main top level menubar -->
-<toolbox id="marc_toolbox">
- <menubar id="marc_menubar">
- <menu id="marc-file" label="&marc.file;" accesskey="&marc.file.key;"/>
- <menu id="marc-display" label="&marc.display;" accesskey="&marc.display.key;"/>
- </menubar>
-</toolbox>
-
-<!-- The File menu on the marc menu -->
-<menu id="marc-file">
- <menupopup id="marc-popup">
- <menuitem label="&marc.file.validate;" accesskey="&marc.file.validate.key;" key="file-validate-key" observes="cmd_marc_validate"/>
- <menuseparator />
- <menuitem label="&marc.file.reload;" accesskey="&marc.file.reload.key;" key="file-reload-key" observes="cmd_marc_reload"/>
- <menuitem label="&marc.file.export;" accesskey="&marc.file.export.key;" key="file-export-key" observes="cmd_marc_export"/>
- <menuitem label="&marc.file.publish;" accesskey="&marc.file.publish.key;" key="file-publish-key" observes="cmd_marc_submit"/>
- <menuseparator />
- <menuitem label="&marc.file.close;" accesskey="&marc.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
- </menupopup>
-</menu>
-
-<!-- The Display menu on the marc menu -->
-<menu id="marc-display">
- <menupopup id="display-popup">
- <menuitem id="explain_marc" label="&marc.display.explain;" accesskey="&marc.display.explain.key;" key="display-explain-key" observes="cmd_marc_explain"/>
- <menuitem label="&marc.display.legend;" accesskey="&marc.display.legend.key;" key="file-legend-key" observes="cmd_marc_legend"/>
- <menuseparator />
- <menuitem label="&marc.display.cover_art;" accesskey="&marc.display.cover_art.key;" key="file-cover-art-key" observes="cmd_marc_cover_art"/>
- <menuitem label="&marc.display.meta_data;" accesskey="&marc.display.meta_data.key;" key="file-meta-data-key" observes="cmd_marc_meta_data"/>
- <menuitem label="&marc.display.control_fields;" accesskey="&marc.display.control_fields.key;" key="file-control-fields-key" observes="cmd_marc_control_fields"/>
- <menuseparator />
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.BKS;" accesskey="&marc.display.fixed.BKS.key;" key="file-fixed-BKS-key" observes="cmd_marc_fixed_BKS"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.SER;" accesskey="&marc.display.fixed.SER.key;" key="file-fixed-SER-key" observes="cmd_marc_fixed_SER"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.VIS;" accesskey="&marc.display.fixed.VIS.key;" key="file-fixed-VIS-key" observes="cmd_marc_fixed_VIS"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.MIX;" accesskey="&marc.display.fixed.MIX.key;" key="file-fixed-MIX-key" observes="cmd_marc_fixed_MIX"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.MAP;" accesskey="&marc.display.fixed.MAP.key;" key="file-fixed-MAP-key" observes="cmd_marc_fixed_MAP"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.SCO;" accesskey="&marc.display.fixed.SCO.key;" key="file-fixed-SCO-key" observes="cmd_marc_fixed_SCO"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.REC;" accesskey="&marc.display.fixed.REC.key;" key="file-fixed-REC-key" observes="cmd_marc_fixed_REC"/>
- <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.COM;" accesskey="&marc.display.fixed.COM.key;" key="file-fixed-COM-key" observes="cmd_marc_fixed_COM"/>
- </menupopup>
-</menu>
-
-<deck id="meta_deck" flex="0">
-</deck>
-
-<deck id="ctrl_deck" flex="1">
- <hbox flex="1">
- <groupbox id="art_groupbox" hidden="true"/>
- <vbox flex="1" style="overflow: auto;">
- <groupbox id="meta_groupbox"/>
- <groupbox id="fixed_groupbox"/>
- </vbox>
- </hbox>
-</deck>
-
-<deck id="data_deck" flex="1">
- <groupbox id="data_groupbox"/>
- <groupbox id="ctrl_groupbox"/>
- <groupbox id="help_groupbox"/>
-</deck>
-
-<groupbox id="meta_groupbox" flex="1" hidden="true">
- <caption label="&marc.groupbox.meta;"/>
- <grid id="meta_grid"/>
-</groupbox>
-
-<groupbox id="data_groupbox">
- <caption label="&marc.groupbox.data;"/>
- <grid id="data_grid"/>
-</groupbox>
-
-<groupbox id="ctrl_groupbox">
- <caption label="&marc.groupbox.control;"/>
- <grid id="ctrl_grid"/>
-</groupbox>
-
-<groupbox id="fixed_groupbox">
- <caption label="&marc.groupbox.fixed;"/>
- <grid id="fixed_grid"/>
-</groupbox>
-
-<groupbox id="art_groupbox">
- <caption label="&marc.groupbox.cover;"/>
- <image src="chrome://evergreen/content/images/noimage.jpg"/>
-</groupbox>
-
-<grid id="meta_grid" flex="1" class="meta_grid">
- <columns class="fixed_columns">
- <column/>
- <column flex="1"/>
- <column/> <column /> <column/> <column />
- </columns>
- <rows>
- <row id="meta_row1"/>
- <row id="meta_row2"/>
- </rows>
-</grid>
-
-<row id="meta_row1">
- <label value="Title/Author"/>
- <description id="meta_title_author"/>
- <label value="Creation Date"/>
- <label id="meta_create_date"/>
- <label value="Created By"/>
- <label id="meta_creator"/>
-</row>
-<row id="meta_row2">
- <label value="TCN/Publisher/etc"/>
- <label id="meta_tcn_publisher"/>
- <label value="Modification Date"/>
- <label id="meta_edit_date"/>
- <label value="Last Modified By"/>
- <label id="meta_editor"/>
-</row>
-
-<grid id="fixed_grid" flex="1" class="fixed_grid">
- <columns class="fixed_columns">
- <column/> <column flex="1"/> <column/> <column flex="1"/>
- <column/> <column flex="1"/> <column/> <column flex="1"/>
- <column/> <column flex="1"/> <column/> <column flex="1"/>
- </columns>
- <rows class="fixed_rows">
- <row id="fixed_row1" class="fixed_row"/>
- <row id="fixed_row2" class="fixed_row"/>
- <row id="fixed_row3" class="fixed_row"/>
- <row id="fixed_row4" class="fixed_row"/>
- </rows>
-</grid>
-
-<row id="fixed_row1">
- <hbox>
- <label
- value="&marc.LDR.type.short;"
- tooltiptext="&marc.LDR.type.desc;"
- onclick="window.open('&marc.LDR.type.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.LDR.type.field;"
- spos="&marc.LDR.type.field_start_pos;"
- epos="&marc.LDR.type.field_end_pos;"
- size="&marc.LDR.type.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.LDR.elvl.short;"
- tooltiptext="&marc.LDR.elvl.desc;"
- onclick="window.open('&marc.LDR.elvl.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.LDR.elvl.field;"
- spos="&marc.LDR.elvl.field_start_pos;"
- epos="&marc.LDR.elvl.field_end_pos;"
- size="&marc.LDR.elvl.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.srce.short;"
- tooltiptext="&marc.008.srce.desc;"
- onclick="window.open('&marc.008.srce.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.srce.field;"
- spos="&marc.008.srce.field_start_pos;"
- epos="&marc.008.srce.field_end_pos;"
- size="&marc.008.srce.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.VIS.SCO.REC.COM.audn.short;"
- tooltiptext="&marc.008.BKS.VIS.SCO.REC.COM.audn.desc;"
- onclick="window.open('&marc.008.BKS.VIS.SCO.REC.COM.audn.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.BKS.SER.VIS.MAP.COM.gpub.short;"
- tooltiptext="&marc.008.BKS.SER.VIS.MAP.COM.gpub.desc;"
- onclick="window.open('&marc.008.BKS.SER.VIS.MAP.COM.gpub.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.VIS.SCO.REC.COM.audn.field;"
- spos="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_start_pos;"
- epos="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_end_pos;"
- size="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field;"
- spos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos;"
- epos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos;"
- size="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.LDR.ctrl.short;"
- tooltiptext="&marc.LDR.ctrl.desc;"
- onclick="window.open('&marc.LDR.ctrl.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.LDR.ctrl.field;"
- spos="&marc.LDR.ctrl.field_start_pos;"
- epos="&marc.LDR.ctrl.field_end_pos;"
- size="&marc.LDR.ctrl.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.lang.short;"
- tooltiptext="&marc.008.lang.desc;"
- onclick="window.open('&marc.008.lang.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.lang.field;"
- spos="&marc.008.lang.field_start_pos;"
- epos="&marc.008.lang.field_end_pos;"
- size="&marc.008.lang.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
-</row>
-<row id="fixed_row2">
- <hbox>
- <label
- value="&marc.LDR.blvl.short;"
- tooltiptext="&marc.LDR.blvl.desc;"
- onclick="window.open('&marc.LDR.blvl.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.LDR.blvl.field;"
- spos="&marc.LDR.blvl.field_start_pos;"
- epos="&marc.LDR.blvl.field_end_pos;"
- size="&marc.LDR.blvl.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.SER.MIX.SCO.REC.form.short;"
- tooltiptext="&marc.008.BKS.SER.MIX.SCO.REC.form.desc;"
- onclick="window.open('&marc.008.BKS.SER.MIX.SCO.REC.form.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.SER.MIX.SCO.REC.form.field;"
- spos="&marc.008.BKS.SER.MIX.SCO.REC.form.field_start_pos;"
- epos="&marc.008.BKS.SER.MIX.SCO.REC.form.field_end_pos;"
- size="&marc.008.BKS.SER.MIX.SCO.REC.form.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.SER.conf.short;"
- tooltiptext="&marc.008.BKS.SER.conf.desc;"
- onclick="window.open('&marc.008.BKS.SER.conf.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.SER.conf.field;"
- spos="&marc.008.BKS.SER.conf.field_start_pos;"
- epos="&marc.008.BKS.SER.conf.field_end_pos;"
- size="&marc.008.BKS.SER.conf.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.biog.short;"
- tooltiptext="&marc.008.BKS.biog.desc;"
- onclick="window.open('&marc.008.BKS.biog.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.freq.short;"
- tooltiptext="&marc.008.SER.freq.desc;"
- onclick="window.open('&marc.008.SER.freq.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.biog.field;"
- spos="&marc.008.BKS.biog.field_start_pos;"
- epos="&marc.008.BKS.biog.field_end_pos;"
- size="&marc.008.BKS.biog.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.freq.field;"
- spos="&marc.008.SER.freq.field_start_pos;"
- epos="&marc.008.SER.freq.field_end_pos;"
- size="&marc.008.SER.freq.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.mrec.short;"
- tooltiptext="&marc.008.mrec.desc;"
- onclick="window.open('&marc.008.mrec.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.mrec.field;"
- spos="&marc.008.mrec.field_start_pos;"
- epos="&marc.008.mrec.field_end_pos;"
- size="&marc.008.mrec.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.ctry.short;"
- tooltiptext="&marc.008.ctry.desc;"
- onclick="window.open('&marc.008.ctry.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.ctry.field;"
- spos="&marc.008.ctry.field_start_pos;"
- epos="&marc.008.ctry.field_end_pos;"
- size="&marc.008.ctry.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
-</row>
-
-<row id="fixed_row3">
- <hbox>
- <label
- value="&marc.008.SER.succ.short;"
- tooltiptext="&marc.008.SER.succ.desc;"
- onclick="window.open('&marc.008.SER.succ.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.SER.succ.field;"
- spos="&marc.008.SER.succ.field_start_pos;"
- epos="&marc.008.SER.succ.field_end_pos;"
- size="&marc.008.SER.succ.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.cont.short;"
- tooltiptext="&marc.008.BKS.cont.desc;"
- onclick="window.open('&marc.008.BKS.cont.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.orig.short;"
- tooltiptext="&marc.008.SER.orig.desc;"
- onclick="window.open('&marc.008.SER.orig.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.cont.field;"
- spos="&marc.008.BKS.cont.field_start_pos;"
- epos="&marc.008.BKS.cont.field_end_pos;"
- size="&marc.008.BKS.cont.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.orig.field;"
- spos="&marc.008.SER.orig.field_start_pos;"
- epos="&marc.008.SER.orig.field_end_pos;"
- size="&marc.008.SER.orig.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.SER.VIS.MAP.COM.gpub.short;"
- tooltiptext="&marc.008.BKS.SER.VIS.MAP.COM.gpub.desc;"
- onclick="window.open('&marc.008.BKS.SER.VIS.MAP.COM.gpub.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.entw.short;"
- tooltiptext="&marc.008.SER.entw.desc;"
- onclick="window.open('&marc.008.SER.entw.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field;"
- spos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos;"
- epos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos;"
- size="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.entw.field;"
- spos="&marc.008.SER.entw.field_start_pos;"
- epos="&marc.008.SER.entw.field_end_pos;"
- size="&marc.008.SER.entw.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.litf.short;"
- tooltiptext="&marc.008.BKS.litf.desc;"
- onclick="window.open('&marc.008.BKS.litf.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.regl.short;"
- tooltiptext="&marc.008.SER.regl.desc;"
- onclick="window.open('&marc.008.SER.regl.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.litf.field;"
- spos="&marc.008.BKS.litf.field_start_pos;"
- epos="&marc.008.BKS.litf.field_end_pos;"
- size="&marc.008.BKS.litf.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.regl.field;"
- spos="&marc.008.SER.regl.field_start_pos;"
- epos="&marc.008.SER.regl.field_end_pos;"
- size="&marc.008.SER.regl.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.MAP.indx.short;"
- tooltiptext="&marc.008.BKS.MAP.indx.desc;"
- onclick="window.open('&marc.008.BKS.MAP.indx.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.issn.short;"
- tooltiptext="&marc.008.SER.issn.desc;"
- onclick="window.open('&marc.008.SER.issn.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.MAP.indx.field;"
- spos="&marc.008.BKS.MAP.indx.field_start_pos;"
- epos="&marc.008.BKS.MAP.indx.field_end_pos;"
- size="&marc.008.BKS.MAP.indx.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.issn.field;"
- spos="&marc.008.SER.issn.field_start_pos;"
- epos="&marc.008.SER.issn.field_end_pos;"
- size="&marc.008.SER.issn.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.SER.alph.short;"
- tooltiptext="&marc.008.SER.alph.desc;"
- onclick="window.open('&marc.008.SER.alph.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.SER.alph.field;"
- spos="&marc.008.SER.alph.field_start_pos;"
- epos="&marc.008.SER.alph.field_end_pos;"
- size="&marc.008.SER.alph.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
-</row>
-
-<row id="fixed_row4">
- <hbox>
- <label
- value="&marc.LDR.desc.short;"
- tooltiptext="&marc.LDR.desc.desc;"
- onclick="window.open('&marc.LDR.desc.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.LDR.desc.field;"
- spos="&marc.LDR.desc.field_start_pos;"
- epos="&marc.LDR.desc.field_end_pos;"
- size="&marc.LDR.desc.field_size;"
- BKS="true" SER="true" VIS="true" MIX="true"
- MAP="true" SCO="true" REC="true" COM="true"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.ills.short;"
- tooltiptext="&marc.008.BKS.ills.desc;"
- onclick="window.open('&marc.008.BKS.ills.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.srtp.short;"
- tooltiptext="&marc.008.SER.srtp.desc;"
- onclick="window.open('&marc.008.SER.srtp.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.ills.field;"
- spos="&marc.008.BKS.ills.field_start_pos;"
- epos="&marc.008.BKS.ills.field_end_pos;"
- size="&marc.008.BKS.ills.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.srtp.field;"
- spos="&marc.008.SER.srtp.field_start_pos;"
- epos="&marc.008.SER.srtp.field_end_pos;"
- size="&marc.008.SER.srtp.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.BKS.fest.short;"
- tooltiptext="&marc.008.BKS.fest.desc;"
- onclick="window.open('&marc.008.BKS.fest.help;');"
- class="fixed_label"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- <label
- value="&marc.008.SER.cont.short;"
- tooltiptext="&marc.008.SER.cont.desc;"
- onclick="window.open('&marc.008.SER.cont.help;');"
- class="fixed_label"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.BKS.fest.field;"
- spos="&marc.008.BKS.fest.field_start_pos;"
- epos="&marc.008.BKS.fest.field_end_pos;"
- size="&marc.008.BKS.fest.field_size;"
- BKS="true" SER="false" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- <textbox
- field="&marc.008.SER.cont.field;"
- spos="&marc.008.SER.cont.field_start_pos;"
- epos="&marc.008.SER.cont.field_end_pos;"
- size="&marc.008.SER.cont.field_size;"
- BKS="false" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.dtst.short;"
- tooltiptext="&marc.008.dtst.desc;"
- onclick="window.open('&marc.008.dtst.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.dtst.field;"
- spos="&marc.008.dtst.field_start_pos;"
- epos="&marc.008.dtst.field_end_pos;"
- size="&marc.008.dtst.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.date1.short;"
- tooltiptext="&marc.008.date1.desc;"
- onclick="window.open('&marc.008.dates.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.date1.field;"
- spos="&marc.008.date1.field_start_pos;"
- epos="&marc.008.date1.field_end_pos;"
- size="&marc.008.date1.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
- <hbox>
- <label
- value="&marc.008.date2.short;"
- tooltiptext="&marc.008.date2.desc;"
- onclick="window.open('&marc.008.dates.help;');"
- class="fixed_label"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- />
- </hbox>
- <hbox>
- <textbox
- field="&marc.008.date2.field;"
- spos="&marc.008.date2.field_start_pos;"
- epos="&marc.008.date2.field_end_pos;"
- size="&marc.008.date2.field_size;"
- BKS="true" SER="true" VIS="false" MIX="false"
- MAP="false" SCO="false" REC="false" COM="false"
- onclick="this.select();"
- />
- </hbox>
-</row>
-
-<grid id="ctrl_grid" flex="1" class="ctrl_grid">
- <columns id="ctrl_columns">
- <column id="ctrl_column1"/>
- <column id="ctrl_column2" flex="1"/>
- </columns>
- <rows id="ctrl_rows"/>
-</grid>
-
-<grid id="data_grid" flex="1" class="data_grid">
- <columns id="data_columns">
- <column id="data_column1"/>
- <column id="data_column2"/>
- <column id="data_column3"/>
- <column id="data_column4" flex="1"/>
- </columns>
- <rows id="data_rows"/>
-</grid>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="marc_keys">
- <key id="marc-close-editor-key" modifiers="accel" key="&marc.close.editor.key;" command="cmd_close_window"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-
-var marc_rules = {"001":{"desc":"CONTROL NUMBER","repeat":"NR"},"002":{"desc":"LOCALLY DEFINED (UNOFFICIAL)","repeat":"NR"},"003":{"desc":"CONTROL NUMBER IDENTIFIER","repeat":"NR"},"005":{"desc":"DATE AND TIME OF LATEST TRANSACTION","repeat":"NR"},"006":{"desc":"FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS--GENERAL INFORMATION","repeat":"R"},"007":{"desc":"PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION","repeat":"R"},"008":{"desc":"FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION","repeat":"NR"},"010":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"LC control number ","repeat":"NR"},"b":{"desc":"NUCMC control number ","repeat":"R"},"desc":"LIBRARY OF CONGRESS CONTROL NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR","z":{"desc":"Canceled/invalid LC control number ","repeat":"R"}},"013":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Number ","repeat":"NR"},"b":{"desc":"Country ","repeat":"NR"},"c":{"desc":"Type of number ","repeat":"NR"},"d":{"desc":"Date ","repeat":"R"},"desc":"PATENT CONTROL INFORMATION","e":{"desc":"Status ","repeat":"R"},"f":{"desc":"Party to document ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"015":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"National bibliography number ","repeat":"R"},"desc":"NATIONAL BIBLIOGRAPHY NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"016":{"2":{"desc":"Source ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Record control number ","repeat":"NR"},"desc":"NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER","ind1":{"allowed":" 7","desc":"National bibliographic agency"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled or invalid record control number ","repeat":"R"}},"017":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Copyright registration number ","repeat":"R"},"b":{"desc":"Assigning agency ","repeat":"NR"},"desc":"COPYRIGHT OR LEGAL DEPOSIT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"018":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Copyright article-fee code ","repeat":"NR"},"desc":"COPYRIGHT ARTICLE-FEE CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"020":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"International Standard Book Number ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"NR"},"desc":"INTERNATIONAL STANDARD BOOK NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid ISBN ","repeat":"R"}},"022":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"International Standard Serial Number ","repeat":"NR"},"desc":"INTERNATIONAL STANDARD SERIAL NUMBER","ind1":{"allowed":" 01","desc":"Level of international interest"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","y":{"desc":"Incorrect ISSN ","repeat":"R"},"z":{"desc":"Canceled ISSN ","repeat":"R"}},"024":{"2":{"desc":"Source of number or code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Standard number or code ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"NR"},"d":{"desc":"Additional codes following the standard number or code ","repeat":"NR"},"desc":"OTHER STANDARD IDENTIFIER","ind1":{"allowed":"0123478","desc":"Type of standard number or code"},"ind2":{"allowed":" 01","desc":"Difference indicator"},"repeat":"R","z":{"desc":"Canceled/invalid standard number or code ","repeat":"R"}},"025":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Overseas acquisition number ","repeat":"R"},"desc":"OVERSEAS ACQUISITION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"026":{"2":{"desc":"Source ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"First and second groups of characters ","repeat":"R"},"b":{"desc":"Third and fourth groups of characters ","repeat":"R"},"c":{"desc":"Date ","repeat":"NR"},"d":{"desc":"Number of volume or part ","repeat":"R"},"desc":"FINGERPRINT IDENTIFIER","e":{"desc":"Unparsed fingerprint ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"027":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Standard technical report number ","repeat":"NR"},"desc":"STANDARD TECHNICAL REPORT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid number ","repeat":"R"}},"028":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publisher number ","repeat":"NR"},"b":{"desc":"Source ","repeat":"NR"},"desc":"PUBLISHER NUMBER","ind1":{"allowed":"012345","desc":"Type of publisher number"},"ind2":{"allowed":"0123","desc":"Note/added entry controller"},"repeat":"R"},"030":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"CODEN ","repeat":"NR"},"desc":"CODEN DESIGNATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid CODEN ","repeat":"R"}},"032":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Postal registration number ","repeat":"NR"},"b":{"desc":"Source (agency assigning number) ","repeat":"NR"},"desc":"POSTAL REGISTRATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"033":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Formatted date/time ","repeat":"R"},"b":{"desc":"Geographic classification area code ","repeat":"R"},"c":{"desc":"Geographic classification subarea code ","repeat":"R"},"desc":"DATE/TIME AND PLACE OF AN EVENT","ind1":{"allowed":" 012","desc":"Type of date in subfield $a"},"ind2":{"allowed":" 012","desc":"Type of event"},"repeat":"R"},"034":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Category of scale ","repeat":"NR"},"b":{"desc":"Constant ratio linear horizontal scale ","repeat":"R"},"c":{"desc":"Constant ratio linear vertical scale ","repeat":"R"},"d":{"desc":"Coordinates--westernmost longitude ","repeat":"NR"},"desc":"CODED CARTOGRAPHIC MATHEMATICAL DATA","e":{"desc":"Coordinates--easternmost longitude ","repeat":"NR"},"f":{"desc":"Coordinates--northernmost latitude ","repeat":"NR"},"g":{"desc":"Coordinates--southernmost latitude ","repeat":"NR"},"h":{"desc":"Angular scale ","repeat":"R"},"ind1":{"allowed":"013","desc":"Type of scale"},"ind2":{"allowed":" 01","desc":"Type of ring"},"j":{"desc":"Declination--northern limit ","repeat":"NR"},"k":{"desc":"Declination--southern limit ","repeat":"NR"},"m":{"desc":"Right ascension--eastern limit ","repeat":"NR"},"n":{"desc":"Right ascension--western limit ","repeat":"NR"},"p":{"desc":"Equinox ","repeat":"NR"},"repeat":"R","s":{"desc":"G-ring latitude ","repeat":"R"},"t":{"desc":"G-ring longitude ","repeat":"R"}},"035":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"System control number ","repeat":"NR"},"desc":"SYSTEM CONTROL NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid control number ","repeat":"R"}},"036":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Original study number ","repeat":"NR"},"b":{"desc":"Source (agency assigning number) ","repeat":"NR"},"desc":"ORIGINAL STUDY NUMBER FOR COMPUTER DATA FILES","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"037":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Stock number ","repeat":"NR"},"b":{"desc":"Source of stock number/acquisition ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"R"},"desc":"SOURCE OF ACQUISITION","f":{"desc":"Form of issue ","repeat":"R"},"g":{"desc":"Additional format characteristics ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Note ","repeat":"R"},"repeat":"R"},"038":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Record content licensor ","repeat":"NR"},"desc":"RECORD CONTENT LICENSOR","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"040":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Original cataloging agency ","repeat":"NR"},"b":{"desc":"Language of cataloging ","repeat":"NR"},"c":{"desc":"Transcribing agency ","repeat":"NR"},"d":{"desc":"Modifying agency ","repeat":"R"},"desc":"CATALOGING SOURCE","e":{"desc":"Description conventions ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"041":{"2":{"desc":"Source of code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Language code of text/sound track or separate title ","repeat":"R"},"b":{"desc":"Language code of summary or abstract/overprinted title or subtitle ","repeat":"R"},"d":{"desc":"Language code of sung or spoken text ","repeat":"R"},"desc":"LANGUAGE CODE","e":{"desc":"Language code of librettos ","repeat":"R"},"f":{"desc":"Language code of table of contents ","repeat":"R"},"g":{"desc":"Language code of accompanying material other than librettos ","repeat":"R"},"h":{"desc":"Language code of original and/or intermediate translations of text ","repeat":"R"},"ind1":{"allowed":"01","desc":"Translation indication"},"ind2":{"allowed":" 7","desc":"Source of code"},"repeat":"R"},"042":{"a":{"desc":"Authentication code ","repeat":"R"},"desc":"AUTHENTICATION CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"043":{"2":{"desc":"Source of local code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic area code ","repeat":"R"},"b":{"desc":"Local GAC code ","repeat":"R"},"c":{"desc":"ISO code ","repeat":"R"},"desc":"GEOGRAPHIC AREA CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"044":{"2":{"desc":"Source of local subentity code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"MARC country code ","repeat":"R"},"b":{"desc":"Local subentity code ","repeat":"R"},"c":{"desc":"ISO country code ","repeat":"R"},"desc":"COUNTRY OF PUBLISHING/PRODUCING ENTITY CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"045":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Time period code ","repeat":"R"},"b":{"desc":"Formatted 9999 B.C. through C.E. time period ","repeat":"R"},"c":{"desc":"Formatted pre-9999 B.C. time period ","repeat":"R"},"desc":"TIME PERIOD OF CONTENT","ind1":{"allowed":" 012","desc":"Type of time period in subfield $b or $c"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"046":{"2":{"desc":"Source of date ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of date code ","repeat":"NR"},"b":{"desc":"Date 1 (B.C. date) ","repeat":"NR"},"c":{"desc":"Date 1 (C.E. date) ","repeat":"NR"},"d":{"desc":"Date 2 (B.C. date) ","repeat":"NR"},"desc":"SPECIAL CODED DATES","e":{"desc":"Date 2 (C.E. date) ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Date resource modified ","repeat":"NR"},"k":{"desc":"Beginning or single date created ","repeat":"NR"},"l":{"desc":"Ending date created ","repeat":"NR"},"m":{"desc":"Beginning of date valid ","repeat":"NR"},"n":{"desc":"End of date valid ","repeat":"NR"},"repeat":"R"},"047":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Form of musical composition code ","repeat":"R"},"desc":"FORM OF MUSICAL COMPOSITION CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"048":{"8":{"desc":"Field link and sequence number","repeat":"R"},"a":{"desc":"Performer or ensemble ","repeat":"R"},"b":{"desc":"Soloist ","repeat":"R"},"desc":"NUMBER OF MUSICAL INSTRUMENTS OR VOICES CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"050":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"LIBRARY OF CONGRESS CALL NUMBER","ind1":{"allowed":" 01","desc":"Existence in LC collection"},"ind2":{"allowed":"04","desc":"Source of call number"},"repeat":"R"},"051":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"LIBRARY OF CONGRESS COPY, ISSUE, OFFPRINT STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"052":{"2":{"desc":"Code source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic classification area code ","repeat":"NR"},"b":{"desc":"Geographic classification subarea code ","repeat":"R"},"d":{"desc":"Populated place name ","repeat":"R"},"desc":"GEOGRAPHIC CLASSIFICATION","ind1":{"allowed":" 17","desc":"Code source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"055":{"2":{"desc":"Source of call/class number ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"CLASSIFICATION NUMBERS ASSIGNED IN CANADA","ind1":{"allowed":" 01","desc":"Existence in NLC collection"},"ind2":{"allowed":"0123456789","desc":"Type, completeness, source of class/call number"},"repeat":"R"},"060":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"NATIONAL LIBRARY OF MEDICINE CALL NUMBER","ind1":{"allowed":" 01","desc":"Existence in NLM collection"},"ind2":{"allowed":"04","desc":"Source of call number"},"repeat":"R"},"061":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"NATIONAL LIBRARY OF MEDICINE COPY STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"066":{"a":{"desc":"Primary G0 character set ","repeat":"NR"},"b":{"desc":"Primary G1 character set ","repeat":"NR"},"c":{"desc":"Alternate G0 or G1 character set ","repeat":"R"},"desc":"CHARACTER SETS PRESENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"070":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"NATIONAL AGRICULTURAL LIBRARY CALL NUMBER","ind1":{"allowed":"01","desc":"Existence in NAL collection"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"071":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"NATIONAL AGRICULTURAL LIBRARY COPY STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"072":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Subject category code ","repeat":"NR"},"desc":"SUBJECT CATEGORY CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"07","desc":"Source specified in subfield $2"},"repeat":"R","x":{"desc":"Subject category code subdivision ","repeat":"R"}},"074":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"GPO item number ","repeat":"NR"},"desc":"GPO ITEM NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid GPO item number ","repeat":"R"}},"080":{"2":{"desc":"Edition identifier ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Universal Decimal Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"UNIVERSAL DECIMAL CLASSIFICATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Common auxiliary subdivision ","repeat":"R"}},"082":{"2":{"desc":"Edition number ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"DEWEY DECIMAL CLASSIFICATION NUMBER","ind1":{"allowed":"01","desc":"Type of edition"},"ind2":{"allowed":" 04","desc":"Source of classification number"},"repeat":"R"},"084":{"2":{"desc":"Source of number ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"OTHER CLASSIFICATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"086":{"2":{"desc":"Number source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"desc":"GOVERNMENT DOCUMENT CLASSIFICATION NUMBER","ind1":{"allowed":" 01","desc":"Number source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid classification number ","repeat":"R"}},"088":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Report number ","repeat":"NR"},"desc":"REPORT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid report number ","repeat":"R"}},"100":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"MAIN ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"110":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"MAIN ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"111":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"MAIN ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"130":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"MAIN ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"}},"210":{"2":{"desc":"Source ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Abbreviated title ","repeat":"NR"},"b":{"desc":"Qualifying information ","repeat":"NR"},"desc":"ABBREVIATED TITLE","ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":" 0","desc":"Type"},"repeat":"R"},"222":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Key title ","repeat":"NR"},"b":{"desc":"Qualifying information ","repeat":"NR"},"desc":"KEY TITLE","ind1":{"allowed":" ","desc":"Specifies whether variant title and/or added entry is required"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"repeat":"R"},"240":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Uniform title printed or displayed"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"242":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"c":{"desc":"Statement of responsibility, etc. ","repeat":"NR"},"desc":"TRANSLATION OF TITLE BY CATALOGING AGENCY","h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","y":{"desc":"Language code of translated title ","repeat":"NR"}},"243":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"COLLECTIVE UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Uniform title printed or displayed"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"245":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"c":{"desc":"Statement of responsibility, etc. ","repeat":"NR"},"desc":"TITLE STATEMENT","f":{"desc":"Inclusive dates ","repeat":"NR"},"g":{"desc":"Bulk dates ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"246":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title proper/short title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"desc":"VARYING FORM OF TITLE","f":{"desc":"Date or sequential designation ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"0123","desc":"Note/added entry controller"},"ind2":{"allowed":" 012345678","desc":"Type of title"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R"},"247":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"desc":"FORMER TITLE","f":{"desc":"Date or sequential designation ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"01","desc":"Note controller"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"250":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Edition statement ","repeat":"NR"},"b":{"desc":"Remainder of edition statement ","repeat":"NR"},"desc":"EDITION STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"254":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Musical presentation statement ","repeat":"NR"},"desc":"MUSICAL PRESENTATION STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"255":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Statement of scale ","repeat":"NR"},"b":{"desc":"Statement of projection ","repeat":"NR"},"c":{"desc":"Statement of coordinates ","repeat":"NR"},"d":{"desc":"Statement of zone ","repeat":"NR"},"desc":"CARTOGRAPHIC MATHEMATICAL DATA","e":{"desc":"Statement of equinox ","repeat":"NR"},"f":{"desc":"Outer G-ring coordinate pairs ","repeat":"NR"},"g":{"desc":"Exclusion G-ring coordinate pairs ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"256":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Computer file characteristics ","repeat":"NR"},"desc":"COMPUTER FILE CHARACTERISTICS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"257":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Country of producing entity ","repeat":"NR"},"desc":"COUNTRY OF PRODUCING ENTITY FOR ARCHIVAL FILMS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"260":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Place of publication, distribution, etc. ","repeat":"R"},"b":{"desc":"Name of publisher, distributor, etc. ","repeat":"R"},"c":{"desc":"Date of publication, distribution, etc. ","repeat":"R"},"d":{"desc":"Plate or publisher's number for music (Pre-AACR 2) ","repeat":"NR"},"desc":"PUBLICATION, DISTRIBUTION, ETC. (IMPRINT)","e":{"desc":"Place of manufacture ","repeat":"NR"},"f":{"desc":"Manufacturer ","repeat":"NR"},"g":{"desc":"Date of manufacture ","repeat":"NR"},"ind1":{"allowed":" 23","desc":"Sequence of publishing statements"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"261":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Producing company ","repeat":"R"},"b":{"desc":"Releasing company (primary distributor) ","repeat":"R"},"d":{"desc":"Date of production, release, etc. ","repeat":"R"},"desc":"IMPRINT STATEMENT FOR FILMS (Pre-AACR 1 Revised)","e":{"desc":"Contractual producer ","repeat":"R"},"f":{"desc":"Place of production, release, etc. ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"262":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Place of production, release, etc. ","repeat":"NR"},"b":{"desc":"Publisher or trade name ","repeat":"NR"},"c":{"desc":"Date of production, release, etc. ","repeat":"NR"},"desc":"IMPRINT STATEMENT FOR SOUND RECORDINGS (Pre-AACR 2)","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Serial identification ","repeat":"NR"},"l":{"desc":"Matrix and/or take number ","repeat":"NR"},"repeat":"NR"},"263":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Projected publication date ","repeat":"NR"},"desc":"PROJECTED PUBLICATION DATE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"270":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Address ","repeat":"R"},"b":{"desc":"City ","repeat":"NR"},"c":{"desc":"State or province ","repeat":"NR"},"d":{"desc":"Country ","repeat":"NR"},"desc":"ADDRESS","e":{"desc":"Postal code ","repeat":"NR"},"f":{"desc":"Terms preceding attention name ","repeat":"NR"},"g":{"desc":"Attention name ","repeat":"NR"},"h":{"desc":"Attention position ","repeat":"NR"},"i":{"desc":"Type of address ","repeat":"NR"},"ind1":{"allowed":" 12","desc":"Level"},"ind2":{"allowed":" 07","desc":"Type of address"},"j":{"desc":"Specialized telephone number ","repeat":"R"},"k":{"desc":"Telephone number ","repeat":"R"},"l":{"desc":"Fax number ","repeat":"R"},"m":{"desc":"Electronic mail address ","repeat":"R"},"n":{"desc":"TDD or TTY number ","repeat":"R"},"p":{"desc":"Contact person ","repeat":"R"},"q":{"desc":"Title of contact person ","repeat":"R"},"r":{"desc":"Hours ","repeat":"R"},"repeat":"R","z":{"desc":"Public note ","repeat":"R"}},"300":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Extent ","repeat":"R"},"b":{"desc":"Other physical details ","repeat":"NR"},"c":{"desc":"Dimensions ","repeat":"R"},"desc":"PHYSICAL DESCRIPTION","e":{"desc":"Accompanying material ","repeat":"NR"},"f":{"desc":"Type of unit ","repeat":"R"},"g":{"desc":"Size of unit ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"306":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Playing time ","repeat":"R"},"desc":"PLAYING TIME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"307":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Hours ","repeat":"NR"},"b":{"desc":"Additional information ","repeat":"NR"},"desc":"HOURS, ETC.","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"310":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Current publication frequency ","repeat":"NR"},"b":{"desc":"Date of current publication frequency ","repeat":"NR"},"desc":"CURRENT PUBLICATION FREQUENCY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"321":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Former publication frequency ","repeat":"NR"},"b":{"desc":"Dates of former publication frequency ","repeat":"NR"},"desc":"FORMER PUBLICATION FREQUENCY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"340":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Material base and configuration ","repeat":"R"},"b":{"desc":"Dimensions ","repeat":"R"},"c":{"desc":"Materials applied to surface ","repeat":"R"},"d":{"desc":"Information recording technique ","repeat":"R"},"desc":"PHYSICAL MEDIUM","e":{"desc":"Support ","repeat":"R"},"f":{"desc":"Production rate/ratio ","repeat":"R"},"h":{"desc":"Location within medium ","repeat":"R"},"i":{"desc":"Technical specifications of medium ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"342":{"2":{"desc":"Reference method used ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name ","repeat":"NR"},"b":{"desc":"Coordinate or distance units ","repeat":"NR"},"c":{"desc":"Latitude resolution ","repeat":"NR"},"d":{"desc":"Longitude resolution ","repeat":"NR"},"desc":"GEOSPATIAL REFERENCE DATA","e":{"desc":"Standard parallel or oblique line latitude ","repeat":"R"},"f":{"desc":"Oblique line longitude ","repeat":"R"},"g":{"desc":"Longitude of central meridian or projection center ","repeat":"NR"},"h":{"desc":"Latitude of projection origin or projection center ","repeat":"NR"},"i":{"desc":"False easting ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Geospatial reference dimension"},"ind2":{"allowed":"012345678","desc":"Geospatial reference method"},"j":{"desc":"False northing ","repeat":"NR"},"k":{"desc":"Scale factor ","repeat":"NR"},"l":{"desc":"Height of perspective point above surface ","repeat":"NR"},"m":{"desc":"Azimuthal angle ","repeat":"NR"},"o":{"desc":"Landsat number and path number ","repeat":"NR"},"p":{"desc":"Zone identifier ","repeat":"NR"},"q":{"desc":"Ellipsoid name ","repeat":"NR"},"r":{"desc":"Semi-major axis ","repeat":"NR"},"repeat":"R","s":{"desc":"Denominator of flattening ratio ","repeat":"NR"},"t":{"desc":"Vertical resolution ","repeat":"NR"},"u":{"desc":"Vertical encoding method ","repeat":"NR"},"v":{"desc":"Local planar, local, or other projection or grid description ","repeat":"NR"},"w":{"desc":"Local planar or local georeference information ","repeat":"NR"}},"343":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Planar coordinate encoding method ","repeat":"NR"},"b":{"desc":"Planar distance units ","repeat":"NR"},"c":{"desc":"Abscissa resolution ","repeat":"NR"},"d":{"desc":"Ordinate resolution ","repeat":"NR"},"desc":"PLANAR COORDINATE DATA","e":{"desc":"Distance resolution ","repeat":"NR"},"f":{"desc":"Bearing resolution ","repeat":"NR"},"g":{"desc":"Bearing units ","repeat":"NR"},"h":{"desc":"Bearing reference direction ","repeat":"NR"},"i":{"desc":"Bearing reference meridian ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"351":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Organization ","repeat":"R"},"b":{"desc":"Arrangement ","repeat":"R"},"c":{"desc":"Hierarchical level ","repeat":"NR"},"desc":"ORGANIZATION AND ARRANGEMENT OF MATERIALS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"352":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Direct reference method ","repeat":"NR"},"b":{"desc":"Object type ","repeat":"R"},"c":{"desc":"Object count ","repeat":"R"},"d":{"desc":"Row count ","repeat":"NR"},"desc":"DIGITAL GRAPHIC REPRESENTATION","e":{"desc":"Column count ","repeat":"NR"},"f":{"desc":"Vertical count ","repeat":"NR"},"g":{"desc":"VPF topology level ","repeat":"NR"},"i":{"desc":"Indirect reference description ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"q":{"desc":"Format of the digital image ","repeat":"R"},"repeat":"R"},"355":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Security classification ","repeat":"NR"},"b":{"desc":"Handling instructions ","repeat":"R"},"c":{"desc":"External dissemination information ","repeat":"R"},"d":{"desc":"Downgrading or declassification event ","repeat":"NR"},"desc":"SECURITY CLASSIFICATION CONTROL","e":{"desc":"Classification system ","repeat":"NR"},"f":{"desc":"Country of origin code ","repeat":"NR"},"g":{"desc":"Downgrading date ","repeat":"NR"},"h":{"desc":"Declassification date ","repeat":"NR"},"ind1":{"allowed":"0123458","desc":"Controlled element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Authorization ","repeat":"R"},"repeat":"R"},"357":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Originator control term ","repeat":"NR"},"b":{"desc":"Originating agency ","repeat":"R"},"c":{"desc":"Authorized recipients of material ","repeat":"R"},"desc":"ORIGINATOR DISSEMINATION CONTROL","g":{"desc":"Other restrictions ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"362":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Dates of publication and/or sequential designation ","repeat":"NR"},"desc":"DATES OF PUBLICATION AND/OR SEQUENTIAL DESIGNATION","ind1":{"allowed":"01","desc":"Format of date"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Source of information ","repeat":"NR"}},"365":{"2":{"desc":"Source of price type code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Price type code ","repeat":"NR"},"b":{"desc":"Price amount ","repeat":"NR"},"c":{"desc":"Currency code ","repeat":"NR"},"d":{"desc":"Unit of pricing ","repeat":"NR"},"desc":"TRADE PRICE","e":{"desc":"Price note ","repeat":"NR"},"f":{"desc":"Price effective from ","repeat":"NR"},"g":{"desc":"Price effective until ","repeat":"NR"},"h":{"desc":"Tax rate 1 ","repeat":"NR"},"i":{"desc":"Tax rate 2 ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"ISO country code ","repeat":"NR"},"k":{"desc":"MARC country code ","repeat":"NR"},"m":{"desc":"Identification of pricing entity ","repeat":"NR"},"repeat":"R"},"366":{"2":{"desc":"Source of availability status code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publishers' compressed title identification ","repeat":"NR"},"b":{"desc":"Detailed date of publication ","repeat":"NR"},"c":{"desc":"Availability status code ","repeat":"NR"},"d":{"desc":"Expected next availability date ","repeat":"NR"},"desc":"TRADE AVAILABILITY INFORMATION","e":{"desc":"Note ","repeat":"NR"},"f":{"desc":"Publishers' discount category ","repeat":"NR"},"g":{"desc":"Date made out of print ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"ISO country code ","repeat":"NR"},"k":{"desc":"MARC country code ","repeat":"NR"},"m":{"desc":"Identification of agency ","repeat":"NR"},"repeat":"R"},"400":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--PERSONAL NAME ","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"410":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SERIES STATEMENT/ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"411":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"440":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--TITLE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","v":{"desc":"Volume number/sequential designation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"490":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Series statement ","repeat":"R"},"desc":"SERIES STATEMENT","ind1":{"allowed":"01","desc":"Specifies whether series is traced"},"ind2":{"allowed":" ","desc":"Undefined"},"l":{"desc":"Library of Congress call number ","repeat":"NR"},"repeat":"R","v":{"desc":"Volume number/sequential designation ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"500":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"General note ","repeat":"NR"},"desc":"GENERAL NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"501":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"With note ","repeat":"NR"},"desc":"WITH NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"502":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Dissertation note ","repeat":"NR"},"desc":"DISSERTATION NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"504":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Bibliography, etc. note ","repeat":"NR"},"b":{"desc":"Number of references ","repeat":"NR"},"desc":"BIBLIOGRAPHY, ETC. NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"505":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Formatted contents note ","repeat":"NR"},"desc":"FORMATTED CONTENTS NOTE","g":{"desc":"Miscellaneous information ","repeat":"R"},"ind1":{"allowed":"0128","desc":"Display constant controller"},"ind2":{"allowed":" 0","desc":"Level of content designation"},"r":{"desc":"Statement of responsibility ","repeat":"R"},"repeat":"R","t":{"desc":"Title ","repeat":"R"},"u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"506":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Terms governing access ","repeat":"NR"},"b":{"desc":"Jurisdiction ","repeat":"R"},"c":{"desc":"Physical access provisions ","repeat":"R"},"d":{"desc":"Authorized users ","repeat":"R"},"desc":"RESTRICTIONS ON ACCESS NOTE","e":{"desc":"Authorization ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"507":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Representative fraction of scale note ","repeat":"NR"},"b":{"desc":"Remainder of scale note ","repeat":"NR"},"desc":"SCALE NOTE FOR GRAPHIC MATERIAL","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"508":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Creation/production credits note ","repeat":"NR"},"desc":"CREATION/PRODUCTION CREDITS NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"510":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name of source ","repeat":"NR"},"b":{"desc":"Coverage of source ","repeat":"NR"},"c":{"desc":"Location within source ","repeat":"NR"},"desc":"CITATION/REFERENCES NOTE","ind1":{"allowed":"01234","desc":"Coverage/location in source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"511":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Participant or performer note ","repeat":"NR"},"desc":"PARTICIPANT OR PERFORMER NOTE","ind1":{"allowed":"01","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"513":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of report ","repeat":"NR"},"b":{"desc":"Period covered ","repeat":"NR"},"desc":"TYPE OF REPORT AND PERIOD COVERED NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"514":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Attribute accuracy report ","repeat":"NR"},"b":{"desc":"Attribute accuracy value ","repeat":"R"},"c":{"desc":"Attribute accuracy explanation ","repeat":"R"},"d":{"desc":"Logical consistency report ","repeat":"NR"},"desc":"DATA QUALITY NOTE","e":{"desc":"Completeness report ","repeat":"NR"},"f":{"desc":"Horizontal position accuracy report ","repeat":"NR"},"g":{"desc":"Horizontal position accuracy value ","repeat":"R"},"h":{"desc":"Horizontal position accuracy explanation ","repeat":"R"},"i":{"desc":"Vertical positional accuracy report ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Vertical positional accuracy value ","repeat":"R"},"k":{"desc":"Vertical positional accuracy explanation ","repeat":"R"},"m":{"desc":"Cloud cover ","repeat":"NR"},"repeat":"NR","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"z":{"desc":"Display note ","repeat":"R"}},"515":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Numbering peculiarities note ","repeat":"NR"},"desc":"NUMBERING PECULIARITIES NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"516":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of computer file or data note ","repeat":"NR"},"desc":"TYPE OF COMPUTER FILE OR DATA NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"518":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Date/time and place of an event note ","repeat":"NR"},"desc":"DATE/TIME AND PLACE OF AN EVENT NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"520":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Summary, etc. note ","repeat":"NR"},"b":{"desc":"Expansion of summary note ","repeat":"NR"},"desc":"SUMMARY, ETC.","ind1":{"allowed":" 01238","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"521":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Target audience note ","repeat":"R"},"b":{"desc":"Source ","repeat":"NR"},"desc":"TARGET AUDIENCE NOTE","ind1":{"allowed":" 012348","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"522":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic coverage note ","repeat":"NR"},"desc":"GEOGRAPHIC COVERAGE NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"524":{"2":{"desc":"Source of schema used ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Preferred citation of described materials note ","repeat":"NR"},"desc":"PREFERRED CITATION OF DESCRIBED MATERIALS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"525":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Supplement note ","repeat":"NR"},"desc":"SUPPLEMENT NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"526":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Program name ","repeat":"NR"},"b":{"desc":"Interest level ","repeat":"NR"},"c":{"desc":"Reading level ","repeat":"NR"},"d":{"desc":"Title point value ","repeat":"NR"},"desc":"STUDY PROGRAM INFORMATION NOTE","i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"530":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Additional physical form available note ","repeat":"NR"},"b":{"desc":"Availability source ","repeat":"NR"},"c":{"desc":"Availability conditions ","repeat":"NR"},"d":{"desc":"Order number ","repeat":"NR"},"desc":"ADDITIONAL PHYSICAL FORM AVAILABLE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"533":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Fixed-length data elements of reproduction ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of reproduction ","repeat":"NR"},"b":{"desc":"Place of reproduction ","repeat":"R"},"c":{"desc":"Agency responsible for reproduction ","repeat":"R"},"d":{"desc":"Date of reproduction ","repeat":"NR"},"desc":"REPRODUCTION NOTE","e":{"desc":"Physical description of reproduction ","repeat":"NR"},"f":{"desc":"Series statement of reproduction ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"m":{"desc":"Dates and/or sequential designation of issues reproduced ","repeat":"R"},"n":{"desc":"Note about reproduction ","repeat":"R"},"repeat":"R"},"534":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry of original ","repeat":"NR"},"b":{"desc":"Edition statement of original ","repeat":"NR"},"c":{"desc":"Publication, distribution, etc. of original ","repeat":"NR"},"desc":"ORIGINAL VERSION NOTE","e":{"desc":"Physical description, etc. of original ","repeat":"NR"},"f":{"desc":"Series statement of original ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Key title of original ","repeat":"R"},"l":{"desc":"Location of original ","repeat":"NR"},"m":{"desc":"Material specific details ","repeat":"NR"},"n":{"desc":"Note about original ","repeat":"R"},"p":{"desc":"Introductory phrase ","repeat":"NR"},"repeat":"R","t":{"desc":"Title statement of original ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"R"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"535":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Custodian ","repeat":"NR"},"b":{"desc":"Postal address ","repeat":"R"},"c":{"desc":"Country ","repeat":"R"},"d":{"desc":"Telecommunications address ","repeat":"R"},"desc":"LOCATION OF ORIGINALS/DUPLICATES NOTE","g":{"desc":"Repository location code ","repeat":"NR"},"ind1":{"allowed":"12","desc":"Additional information about custodian"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"536":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Text of note ","repeat":"NR"},"b":{"desc":"Contract number ","repeat":"R"},"c":{"desc":"Grant number ","repeat":"R"},"d":{"desc":"Undifferentiated number ","repeat":"R"},"desc":"FUNDING INFORMATION NOTE","e":{"desc":"Program element number ","repeat":"R"},"f":{"desc":"Project number ","repeat":"R"},"g":{"desc":"Task number ","repeat":"R"},"h":{"desc":"Work unit number ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"538":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"System details note ","repeat":"NR"},"desc":"SYSTEM DETAILS NOTE","i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"540":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Terms governing use and reproduction ","repeat":"NR"},"b":{"desc":"Jurisdiction ","repeat":"NR"},"c":{"desc":"Authorization ","repeat":"NR"},"d":{"desc":"Authorized users ","repeat":"NR"},"desc":"TERMS GOVERNING USE AND REPRODUCTION NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"541":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Source of acquisition ","repeat":"NR"},"b":{"desc":"Address ","repeat":"NR"},"c":{"desc":"Method of acquisition ","repeat":"NR"},"d":{"desc":"Date of acquisition ","repeat":"NR"},"desc":"IMMEDIATE SOURCE OF ACQUISITION NOTE","e":{"desc":"Accession number ","repeat":"NR"},"f":{"desc":"Owner ","repeat":"NR"},"h":{"desc":"Purchase price ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Extent ","repeat":"R"},"o":{"desc":"Type of unit ","repeat":"R"},"repeat":"R"},"544":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Custodian ","repeat":"R"},"b":{"desc":"Address ","repeat":"R"},"c":{"desc":"Country ","repeat":"R"},"d":{"desc":"Title ","repeat":"R"},"desc":"LOCATION OF OTHER ARCHIVAL MATERIALS NOTE","e":{"desc":"Provenance ","repeat":"R"},"ind1":{"allowed":" 01","desc":"Relationship"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Note ","repeat":"R"},"repeat":"R"},"545":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Biographical or historical note ","repeat":"NR"},"b":{"desc":"Expansion ","repeat":"NR"},"desc":"BIOGRAPHICAL OR HISTORICAL DATA","ind1":{"allowed":" 01","desc":"Type of data"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"546":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Language note ","repeat":"NR"},"b":{"desc":"Information code or alphabet ","repeat":"R"},"desc":"LANGUAGE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"547":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Former title complexity note ","repeat":"NR"},"desc":"FORMER TITLE COMPLEXITY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"550":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Issuing body note ","repeat":"NR"},"desc":"ISSUING BODY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"552":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Entity type label ","repeat":"NR"},"b":{"desc":"Entity type definition and source ","repeat":"NR"},"c":{"desc":"Attribute label ","repeat":"NR"},"d":{"desc":"Attribute definition and source ","repeat":"NR"},"desc":"ENTITY AND ATTRIBUTE INFORMATION NOTE","e":{"desc":"Enumerated domain value ","repeat":"R"},"f":{"desc":"Enumerated domain value definition and source ","repeat":"R"},"g":{"desc":"Range domain minimum and maximum ","repeat":"NR"},"h":{"desc":"Codeset name and source ","repeat":"NR"},"i":{"desc":"Unrepresentable domain ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribute units of measurement and resolution ","repeat":"NR"},"k":{"desc":"Beginning date and ending date of attribute values ","repeat":"NR"},"l":{"desc":"Attribute value accuracy ","repeat":"NR"},"m":{"desc":"Attribute value accuracy explanation ","repeat":"NR"},"n":{"desc":"Attribute measurement frequency ","repeat":"NR"},"o":{"desc":"Entity and attribute overview ","repeat":"R"},"p":{"desc":"Entity and attribute detail citation ","repeat":"R"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"z":{"desc":"Display note ","repeat":"R"}},"555":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Cumulative index/finding aids note ","repeat":"NR"},"b":{"desc":"Availability source ","repeat":"R"},"c":{"desc":"Degree of control ","repeat":"NR"},"d":{"desc":"Bibliographic reference ","repeat":"NR"},"desc":"CUMULATIVE INDEX/FINDING AIDS NOTE","ind1":{"allowed":" 08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"556":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Information about documentation note ","repeat":"NR"},"desc":"INFORMATION ABOUT DOCUMENTATION NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"International Standard Book Number ","repeat":"R"}},"561":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"History ","repeat":"NR"},"desc":"OWNERSHIP AND CUSTODIAL HISTORY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"562":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Identifying markings ","repeat":"R"},"b":{"desc":"Copy identification ","repeat":"R"},"c":{"desc":"Version identification ","repeat":"R"},"d":{"desc":"Presentation format ","repeat":"R"},"desc":"COPY AND VERSION IDENTIFICATION NOTE","e":{"desc":"Number of copies ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"563":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Binding note ","repeat":"NR"},"desc":"BINDING INFORMATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"565":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Number of cases/variables ","repeat":"NR"},"b":{"desc":"Name of variable ","repeat":"R"},"c":{"desc":"Unit of analysis ","repeat":"R"},"d":{"desc":"Universe of data ","repeat":"R"},"desc":"CASE FILE CHARACTERISTICS NOTE","e":{"desc":"Filing scheme or code ","repeat":"R"},"ind1":{"allowed":" 08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"567":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Methodology note ","repeat":"NR"},"desc":"METHODOLOGY NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"580":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Linking entry complexity note ","repeat":"NR"},"desc":"LINKING ENTRY COMPLEXITY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"581":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publications about described materials note","repeat":"NR"},"desc":"PUBLICATIONS ABOUT DESCRIBED MATERIALS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"International Standard Book Number ","repeat":"R"}},"583":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Action ","repeat":"NR"},"b":{"desc":"Action identification ","repeat":"R"},"c":{"desc":"Time/date of action ","repeat":"R"},"d":{"desc":"Action interval ","repeat":"R"},"desc":"ACTION NOTE","e":{"desc":"Contingency for action ","repeat":"R"},"f":{"desc":"Authorization ","repeat":"R"},"h":{"desc":"Jurisdiction ","repeat":"R"},"i":{"desc":"Method of action ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Site of action ","repeat":"R"},"k":{"desc":"Action agent ","repeat":"R"},"l":{"desc":"Status ","repeat":"R"},"n":{"desc":"Extent ","repeat":"R"},"o":{"desc":"Type of unit ","repeat":"R"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"584":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Accumulation ","repeat":"R"},"b":{"desc":"Frequency of use ","repeat":"R"},"desc":"ACCUMULATION AND FREQUENCY OF USE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"585":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Exhibitions note ","repeat":"NR"},"desc":"EXHIBITIONS NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"586":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Awards note ","repeat":"NR"},"desc":"AWARDS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"600":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"610":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"611":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"630":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"648":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Chronological term ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--CHRONOLOGICAL TERM","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"650":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Topical term or geographic name as entry element ","repeat":"NR"},"b":{"desc":"Topical term following geographic name as entry element ","repeat":"NR"},"c":{"desc":"Location of event ","repeat":"NR"},"d":{"desc":"Active dates ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--TOPICAL TERM","e":{"desc":"Relator term ","repeat":"NR"},"ind1":{"allowed":" 012","desc":"Level of subject"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"651":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic name ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--GEOGRAPHIC NAME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"653":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uncontrolled term ","repeat":"R"},"desc":"INDEX TERM--UNCONTROLLED","ind1":{"allowed":" 012","desc":"Level of index term"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"654":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Focus term ","repeat":"R"},"b":{"desc":"Non-focus term ","repeat":"R"},"c":{"desc":"Facet/hierarchy designation ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--FACETED TOPICAL TERMS","ind1":{"allowed":" 012","desc":"Level of subject"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"655":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Genre/form data or focus term ","repeat":"NR"},"b":{"desc":"Non-focus term ","repeat":"R"},"c":{"desc":"Facet/hierarchy designation ","repeat":"R"},"desc":"INDEX TERM--GENRE/FORM","ind1":{"allowed":" 0","desc":"Type of heading"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"656":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Occupation ","repeat":"NR"},"desc":"INDEX TERM--OCCUPATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"7","desc":"Source of term"},"k":{"desc":"Form ","repeat":"NR"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"657":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Function ","repeat":"NR"},"desc":"INDEX TERM--FUNCTION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"7","desc":"Source of term"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"658":{"2":{"desc":"Source of term or code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main curriculum objective ","repeat":"NR"},"b":{"desc":"Subordinate curriculum objective ","repeat":"R"},"c":{"desc":"Curriculum code ","repeat":"NR"},"d":{"desc":"Correlation factor ","repeat":"NR"},"desc":"INDEX TERM--CURRICULUM OBJECTIVE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"700":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"710":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"711":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"720":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name ","repeat":"NR"},"desc":"ADDED ENTRY--UNCONTROLLED NAME","e":{"desc":"Relator term ","repeat":"R"},"ind1":{"allowed":" 12","desc":"Type of name"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"730":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"740":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uncontrolled related/analytical title ","repeat":"NR"},"desc":"ADDED ENTRY--UNCONTROLLED RELATED/ANALYTICAL TITLE","h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R"},"752":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Country ","repeat":"NR"},"b":{"desc":"State, province, territory ","repeat":"NR"},"c":{"desc":"County, region, islands area ","repeat":"NR"},"d":{"desc":"City ","repeat":"NR"},"desc":"ADDED ENTRY--HIERARCHICAL PLACE NAME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"753":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Make and model of machine ","repeat":"NR"},"b":{"desc":"Programming language ","repeat":"NR"},"c":{"desc":"Operating system ","repeat":"NR"},"desc":"SYSTEM DETAILS ACCESS TO COMPUTER FILES","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"754":{"2":{"desc":"Source of taxonomic identification ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Taxonomic name ","repeat":"R"},"c":{"desc":"Taxonomic category ","repeat":"R"},"d":{"desc":"Common or alternative name ","repeat":"R"},"desc":"ADDED ENTRY--TAXONOMIC IDENTIFICATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Non-public note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"760":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"MAIN SERIES ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"762":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUBSERIES ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"765":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ORIGINAL LANGUAGE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"767":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"TRANSLATION ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"770":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUPPLEMENT/SPECIAL ISSUE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"772":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUPPLEMENT PARENT ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 08","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Stan dard Book Number ","repeat":"R"}},"773":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"HOST ITEM ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"p":{"desc":"Abbreviated title ","repeat":"NR"},"q":{"desc":"Enumeration and first page ","repeat":"NR"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"774":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"CONSTITUENT UNIT ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"775":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"OTHER EDITION ENTRY","e":{"desc":"Language code ","repeat":"NR"},"f":{"desc":"Country code ","repeat":"NR"},"g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"776":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ADDITIONAL PHYSICAL FORM ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"777":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ISSUED WITH ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"780":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"PRECEDING ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":"01234567","desc":"Type of relationship"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"785":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUCCEEDING ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":"012345678","desc":"Type of relationship"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standa rd Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"786":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"DATA SOURCE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"j":{"desc":"Period of content ","repeat":"NR"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"p":{"desc":"Abbreviated title ","repeat":"NR"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"v":{"desc":"Source Contribution ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"787":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"NONSPECIFIC RELATIONSHIP ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"800":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SERIES ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"810":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SERIES ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"811":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SERIES ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"830":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"SERIES ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"841":{"desc":"HOLDINGS CODED DATA VALUES","repeat":"NR"},"842":{"desc":"TEXTUAL PHYSICAL FORM DESIGNATOR","repeat":"NR"},"843":{"desc":"REPRODUCTION NOTE","repeat":"R"},"844":{"desc":"NAME OF UNIT","repeat":"NR"},"845":{"desc":"TERMS GOVERNING USE AND REPRODUCTION NOTE","repeat":"R"},"850":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Holding institution ","repeat":"R"},"desc":"HOLDING INSTITUTION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"852":{"2":{"desc":"Source of classification or shelving scheme ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Sequence number ","repeat":"NR"},"a":{"desc":"Location ","repeat":"NR"},"b":{"desc":"Sublocation or collection ","repeat":"R"},"c":{"desc":"Shelving location ","repeat":"R"},"desc":"LOCATION","e":{"desc":"Address ","repeat":"R"},"f":{"desc":"Coded location qualifier ","repeat":"R"},"g":{"desc":"Non-coded location qualifier ","repeat":"R"},"h":{"desc":"Classification part ","repeat":"NR"},"i":{"desc":"Item part ","repeat":"R"},"ind1":{"allowed":" 012345678","desc":"Shelving scheme"},"ind2":{"allowed":" 012","desc":"Shelving order"},"j":{"desc":"Shelving control number ","repeat":"NR"},"k":{"desc":"Call number prefix ","repeat":"R"},"l":{"desc":"Shelving form of title ","repeat":"NR"},"m":{"desc":"Call number suffix ","repeat":"R"},"n":{"desc":"Country code ","repeat":"NR"},"p":{"desc":"Piece designation ","repeat":"NR"},"q":{"desc":"Piece physical condition ","repeat":"NR"},"repeat":"R","s":{"desc":"Copyright article-fee code ","repeat":"R"},"t":{"desc":"Copy number ","repeat":"NR"},"x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"853":{"desc":"CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"854":{"desc":"CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL","repeat":"R"},"855":{"desc":"CAPTIONS AND PATTERN--INDEXES","repeat":"R"},"856":{"2":{"desc":"Access method ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Host name ","repeat":"R"},"b":{"desc":"Access number ","repeat":"R"},"c":{"desc":"Compression information ","repeat":"R"},"d":{"desc":"Path ","repeat":"R"},"desc":"ELECTRONIC LOCATION AND ACCESS","f":{"desc":"Electronic name ","repeat":"R"},"h":{"desc":"Processor of request ","repeat":"NR"},"i":{"desc":"Instruction ","repeat":"R"},"ind1":{"allowed":" 012347","desc":"Access method"},"ind2":{"allowed":" 0128","desc":"Relationship"},"j":{"desc":"Bits per second ","repeat":"NR"},"k":{"desc":"Password ","repeat":"NR"},"l":{"desc":"Logon ","repeat":"NR"},"m":{"desc":"Contact for access assistance ","repeat":"R"},"n":{"desc":"Name of location of host ","repeat":"NR"},"o":{"desc":"Operating system ","repeat":"NR"},"p":{"desc":"Port ","repeat":"NR"},"q":{"desc":"Electronic format type ","repeat":"NR"},"r":{"desc":"Settings ","repeat":"NR"},"repeat":"R","s":{"desc":"File size ","repeat":"R"},"t":{"desc":"Terminal emulation ","repeat":"R"},"u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"v":{"desc":"Hours access method available ","repeat":"R"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"Nonpublic note ","repeat":"R"},"y":{"desc":"Link text ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"863":{"desc":"ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"864":{"desc":"ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL","repeat":"R"},"865":{"desc":"ENUMERATION AND CHRONOLOGY--INDEXES","repeat":"R"},"866":{"desc":"TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"867":{"desc":"TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL","repeat":"R"},"868":{"desc":"TEXTUAL HOLDINGS--INDEXES","repeat":"R"},"876":{"desc":"ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"877":{"desc":"ITEM INFORMATION--SUPPLEMENTARY MATERIAL","repeat":"R"},"878":{"desc":"ITEM INFORMATION--INDEXES","repeat":"R"},"880":{"6":{"desc":"Linkage","repeat":"NR"},"desc":"ALTERNATE GRAPHIC REPRESENTATION","repeat":"R"},"886":{"0":{"desc":"Foreign MARC subfield","repeat":"NR"},"1":{"desc":"Foreign MARC subfield","repeat":"NR"},"2":{"desc":"Source of data","repeat":"NR"},"3":{"desc":"Source of data","repeat":"NR"},"4":{"desc":"Source of data","repeat":"NR"},"5":{"desc":"Source of data","repeat":"NR"},"6":{"desc":"Source of data","repeat":"NR"},"7":{"desc":"Source of data","repeat":"NR"},"8":{"desc":"Source of data","repeat":"NR"},"9":{"desc":"Source of data","repeat":"NR"},"a":{"desc":"Tag of the foreign MARC field","repeat":"NR"},"b":{"desc":"Content of the foreign MARC field","repeat":"NR"},"c":{"desc":"Foreign MARC subfield","repeat":"NR"},"d":{"desc":"Foreign MARC subfield","repeat":"NR"},"desc":"FOREIGN MARC INFORMATION FIELD","e":{"desc":"Foreign MARC subfield","repeat":"NR"},"f":{"desc":"Foreign MARC subfield","repeat":"NR"},"g":{"desc":"Foreign MARC subfield","repeat":"NR"},"h":{"desc":"Foreign MARC subfield","repeat":"NR"},"i":{"desc":"Foreign MARC subfield","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of field"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Foreign MARC subfield","repeat":"NR"},"k":{"desc":"Foreign MARC subfield","repeat":"NR"},"l":{"desc":"Foreign MARC subfield","repeat":"NR"},"m":{"desc":"Foreign MARC subfield","repeat":"NR"},"n":{"desc":"Foreign MARC subfield","repeat":"NR"},"o":{"desc":"Foreign MARC subfield","repeat":"NR"},"p":{"desc":"Foreign MARC subfield","repeat":"NR"},"q":{"desc":"Foreign MARC subfield","repeat":"NR"},"r":{"desc":"Foreign MARC subfield","repeat":"NR"},"repeat":"R","s":{"desc":"Foreign MARC subfield","repeat":"NR"},"t":{"desc":"Foreign MARC subfield","repeat":"NR"},"u":{"desc":"Foreign MARC subfield","repeat":"NR"},"v":{"desc":"Foreign MARC subfield","repeat":"NR"},"w":{"desc":"Foreign MARC subfield","repeat":"NR"},"x":{"desc":"Foreign MARC subfield","repeat":"NR"},"y":{"desc":"Foreign MARC subfield","repeat":"NR"},"z":{"desc":"Foreign MARC subfield","repeat":"NR"}},"887":{"2":{"desc":"Source of data","repeat":"NR"},"a":{"desc":"Content of non-MARC field","repeat":"NR"},"desc":"NON-MARC INFORMATION FIELD","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"}};
+++ /dev/null
-var rule_warnings = [];
-var tag_seen;
-
-function explain_marc() {
- var s = '';
- for (var w in rule_warnings) {
- s = s + rule_warnings[w];
- }
- alert(s);
-}
-
-function legend_marc() {
- var s = '';
- var rows = document.getElementById('ctrl_rows').childNodes;
- for (var r in rows) {
- if ( (typeof(rows[r]) == 'object') &&
- (rows[r].tagName == 'row') &&
- (rows[r].getAttribute('hidden') != 'true')
- ) {
- var tagnumber = rows[r].firstChild.firstChild.value;
- if ((marc_rules[tagnumber])&&(marc_rules[tagnumber].desc)) {
- s = s + tagnumber + '\t' + marc_rules[tagnumber].desc + '\n';
- } else {
- s = s + tagnumber + '\n';
- }
- }
- }
- rows = document.getElementById('data_rows').childNodes;
- for (var r in rows) {
- if ( (typeof(rows[r]) == 'object') &&
- (rows[r].tagName == 'row') &&
- (rows[r].getAttribute('hidden') != 'true')
- ) {
- var tagnumber = rows[r].firstChild.firstChild.value;
- if ((marc_rules[tagnumber])&&(marc_rules[tagnumber].desc)) {
- s = s + tagnumber + '\t' + marc_rules[tagnumber].desc + '\n';
- } else {
- s = s + tagnumber + '\n';
- }
- }
- }
- alert(s);
-
-}
-
-function handle_tag_change(ev) {
- mw.sdump('D_CAT','Entering handle_tag_change: ' + timer_elapsed('cat') + '\n');
- try {
- rule_warnings = []; disable_widgets('explain_marc');
- tag_seen = {};
- var rows = document.getElementById('ctrl_rows').childNodes;
- for (var r in rows) {
- if ((typeof(rows[r]) == 'object')&&(rows[r].tagName == 'row')) {
- test_tagnumber_rule(rows[r]);
- }
- }
- rows = document.getElementById('data_rows').childNodes;
- for (var r in rows) {
- if ( (typeof(rows[r]) == 'object') &&
- (rows[r].tagName == 'row') &&
- (rows[r].getAttribute('hidden') != 'true')
- ) {
- test_tagnumber_rule(rows[r]);
- test_ind1_rule(rows[r]);
- test_ind2_rule(rows[r]);
- test_subfield_rule(rows[r]);
- }
- }
- if (rule_warnings.length > 0) {
- enable_widgets('explain_marc'); }
- } catch(E) {
- handle_error(E);
- }
- mw.sdump('D_CAT','Exiting handle_tag_change: ' + timer_elapsed('cat') + '\n');
-}
-
-function test_tagnumber_rule(r) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- try {
- var t = r.firstChild.firstChild;
- if (t.value.length > 3) {
- t.value = t.value.substr(0,3);
- } else if (t.value.length < 3) {
- switch(t.value.length) {
- case 2: t.value = '0' + t.value; break;
- case 1: t.value = '00' + t.value; break;
- case 0: t.value = '000'; break;
- }
- }
- removeCSSClass(t,'invalid');
- if (marc_rules[t.value]) {
- var rule = marc_rules[t.value];
- if (tag_seen[t.value]) { tag_seen[t.value]++; } else { tag_seen[t.value] = 1; }
- if ( (rule.repeat == 'NR') && (tag_seen[t.value] > 1) ) {
- addCSSClass(t,'invalid');
- var s = 'Tag ' + t.value + ' should be Non-Repeating\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- } else if (t.value != 'LDR') {
- addCSSClass(t,'invalid');
- var s = 'Tag ' + t.value + ' is unknown.\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- } catch(E) {
- handle_error();
- }
-}
-
-function test_ind1_rule(r) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- var tagnumber = r.childNodes[0].firstChild.value;
- var ind1 = r.childNodes[1].firstChild;
- removeCSSClass(ind1,'invalid');
- if ((marc_rules[tagnumber]) && (marc_rules[tagnumber].ind1)) {
- var regex = '/^[' + marc_rules[tagnumber].ind1.allowed + ']$/';
- if (! ind1.value.match(eval(regex)) ) {
- addCSSClass(ind1,'invalid');
- var s = 'Tag ' + tagnumber + ' Indicator 1 should be one of these characters: "' + marc_rules[tagnumber].ind1.allowed + '"\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- }
-}
-
-function test_ind2_rule(r) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- var tagnumber = r.childNodes[0].firstChild.value;
- var ind2 = r.childNodes[2].firstChild;
- removeCSSClass(ind2,'invalid');
- if ((marc_rules[tagnumber]) && (marc_rules[tagnumber].ind2)) {
- var regex = '/^[' + marc_rules[tagnumber].ind2.allowed + ']$/';
- if (! ind2.value.match(eval(regex)) ) {
- addCSSClass(ind2,'invalid');
- var s = 'Tag ' + tagnumber + ' Indicator 2 should be one of these characters: "' + marc_rules[tagnumber].ind2.allowed + '"\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- }
-}
-
-function test_subfield_rule(r) {
- // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
- var tagnumber = r.childNodes[0].firstChild.value;
- var data = r.childNodes[3].firstChild;
- removeCSSClass(data,'invalid');
- if (marc_rules[tagnumber]) {
- var datastring = data.value.replace(/^\s+/,'').replace(/\s+$/,'');
- var subf_array = datastring.split(String.fromCharCode(8225));
- if ( (subf_array[0] == '')||(subf_array[0] == null) ) {
- subf_array.shift();
- } else {
- addCSSClass(data,'invalid');
- var s = 'DEBUG: Need to add code to make an implicit subfield-a\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- subf_array.shift();
- }
- var subf_seen = {};
- for (var i in subf_array) {
- if ((subf_array[i]=='')||(subf_array==null)) {
- addCSSClass(data,'invalid');
- var s = 'You have incomplete subfield delimiters.\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- continue;
- }
- var s_ind = subf_array[i].substr(0,1);
- if (subf_seen[s_ind]) { subf_seen[s_ind]++; } else { subf_seen[s_ind] = 1; }
- var rule = marc_rules[tagnumber][s_ind];
- if (rule) {
- if ( (rule.repeat == 'NR') && (subf_seen[s_ind]>1) ) {
- addCSSClass(data,'invalid');
- var s = 'Tag ' + tagnumber + ' subfield-' + s_ind + ' should be Non-Repeating\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- } else {
- addCSSClass(data,'invalid');
- var s = 'Tag ' + tagnumber + ' does not have a subfield-' + s_ind + '\n';
- rule_warnings.push(s); mw.sdump('D_CAT',s);
- }
- }
- }
-}
+++ /dev/null
-mw.sdump('D_CAT','Parsing record_list.js\n');
-
-var test_hash = { 'a' : '123' } ;
-
-function my_init() {
- timer_init('cat');
- mw.sdump('D_CAT','TESTING: record_list.js: ' + mw.G['main_test_variable'] + '\n');
- mw.sdump('D_CAT','test_hash = ' + js2JSON(test_hash) + '\n');
- mw.sdump('D_CAT','search_term = ' + search_term + ' search_type = ' + search_type + ' search_order = ' + search_order + ' search_location = ' + search_location + '\n');
- var b = document.getElementById('count_copy_toggle');
- b.setAttribute('label','Click to Show Records for All Libraries');
- b.setAttribute('alt_label','Click to Show Only Records with Copies at ' + find_ou(mw.G['org_tree'],search_location).name());
- b.setAttribute('value','-1');
- b.setAttribute('oncommand','toggle_view(event);');
-
- search();
-}
-
-function toggle_view(ev) {
- var b = ev.target;
- var value = b.getAttribute('value');
- var label = b.getAttribute('label');
- var alt_label = b.getAttribute('alt_label');
- var temp = label; label = alt_label; alt_label = temp;
- b.setAttribute('label',label); b.setAttribute('alt_label',alt_label);
- b.setAttribute('value',-value);
- var rows = document.getElementById('record_list_tree_children');
- var nl = rows.getElementsByTagName('treeitem');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- var treeitem = nl[i];
- var treerow = treeitem.firstChild;
- var copy_count_cell = treerow.lastChild;
- var copy_count = copy_count_cell.getAttribute('label');
- if (value == '-1') {
- treeitem.setAttribute('hidden','false');
- } else {
- if (copy_count == '0') {
- treeitem.setAttribute('hidden','true');
- }
- }
- }
- }
-}
-
-function search() {
- var result;
- mw.sdump('D_CAT','search_type = ' + search_type + ' search_order = ' + search_order + ' search_term = ' + search_term + '\n');
- switch(search_type) {
- case 'tcn':
- try {
- result = user_request(
- 'open-ils.search',
- 'open-ils.search.cat.biblio.tcn',
- [ search_term ]
- );
- } catch(E) {
- handle_error(E);
- }
- break;
- default:
- try {
- result = user_request(
- 'open-ils.search',
- 'open-ils.search.cat.biblio.class',
- [ search_location, search_type, search_order, search_term ]
- );
- } catch(E) {
- handle_error(E);
- }
- break;
- }
- // populate record_list with results
- //mw.sdump('D_CAT', js2JSON( result ) + '\n');
- var tc = document.getElementById('record_list_tree_children');
- for (var i in result) {
- if (typeof(result[i])=='object') {
- var data = result[i];
- var item = make_treeitem(data['doc_id']);
- var row = make_treerow(
- data['title'],
- data['author'],
- data['tcn'],
- data['publisher'],
- data['pubdate'],
- data['isbn'],
- data['isbn'],
- data['copy_count']
- );
- if (data['copy_count'] == 0) {
- item.setAttribute('hidden','true');
- }
- item.appendChild( row );
- tc.appendChild( item );
- } else {
- //mw.sdump('D_CAT','unexpected typeof(result['+i+']) = ' + typeof(result[i]) + ' : ' + result[i] + '\n');
- }
- }
-}
-
-function make_treeitem(owner_doc) {
- var treeitem = document.createElement('treeitem');
- treeitem.setAttribute('id',owner_doc);
- //mw.sdump('D_CAT','treeitem = ' + treeitem + '\n');
- return treeitem;
-}
-
-function make_treerow() {
- var treerow = document.createElement('treerow');
- //mw.sdump('D_CAT','treerow = ' + treerow + '\n');
- //mw.sdump('D_CAT','arguments.length = ' + arguments.length + ' arguments = ' + js2JSON(arguments) + '\n');
- for (var i = 0; i < arguments.length; i++) {
- //mw.sdump('D_CAT',i + ' : ' + arguments[i] + '\n');
- var treecell = document.createElement('treecell');
- //mw.sdump('D_CAT','treecell = ' + treecell + '\n');
- var text = '';
- if (typeof(arguments[i])=='object') {
- for (var j in arguments[i]) {
- text = text + arguments[i][j] + ' / ';
- }
- } else {
- text = arguments[i];
- }
- treecell.setAttribute('label',text);
- treerow.appendChild(treecell);
- }
- return treerow;
-}
-
-function spawn_editors(tab) {
- var hitlist = document.getElementById('record_list_tree');
- var start = new Object();
- var end = new Object();
- var numRanges = hitlist.view.selection.getRangeCount();
- for (var t=0; t<numRanges; t++){
- hitlist.view.selection.getRangeAt(t,start,end);
- for (var v=start.value; v<=end.value; v++){
- var i = hitlist.contentView.getItemAtIndex(v);
- mw.sdump('D_CAT',i.tagName + '\n');
- var params = [
- i.getAttribute('id'),
- i.firstChild.childNodes[0].getAttribute('label'),
- i.firstChild.childNodes[1].getAttribute('label'),
- i.firstChild.childNodes[2].getAttribute('label'),
- i.firstChild.childNodes[3].getAttribute('label'),
- i.firstChild.childNodes[4].getAttribute('label'),
- i.firstChild.childNodes[5].getAttribute('label'),
- i.firstChild.childNodes[6].getAttribute('label')
- ];
- var w = spawn_marc_editor(
- window.app_shell,'new_tab','main_tabbox', {
- 'find_this_id' : params[0],
- 'record_columns' : params
- }
- );
- w.find_this_id = params[0];
- w.record_columns = params;
- }
- }
-}
-
-function spawn_browsers(tab) {
- var hitlist = document.getElementById('record_list_tree');
- var start = new Object();
- var end = new Object();
- var numRanges = hitlist.view.selection.getRangeCount();
- for (var t=0; t<numRanges; t++){
- hitlist.view.selection.getRangeAt(t,start,end);
- for (var v=start.value; v<=end.value; v++){
- var i = hitlist.contentView.getItemAtIndex(v);
- mw.sdump('D_CAT',i.tagName + '\n');
- var params = [ i.getAttribute('id') ];
- var w = spawn_copy_browser(
- window.app_shell,'new_tab','main_tabbox', {
- 'find_this_id' : params[0],
- 'record_columns' : params
- }
- );
- w.find_this_id = params[0];
- w.record_columns = params;
- }
- }
-}
-
-/*
-function spawn_copy_browser(tab,params) {
- mw.sdump('D_CAT','trying to spawn_marc_editor('+params[0]+')\n');
- var w;
- var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
- if (tab) {
- tabWindow.new_tab('main_tabbox');
- w = tabWindow.replace_tab('main_tabbox','COPIES',chrome);
- } else {
- w = mw.new_window( chrome );
- }
- w.find_this_id = params[0];
- w.record_columns = params;
-}
-
-
-function spawn_marc_editor(tab,params) {
- mw.sdump('D_CAT','trying to spawn_marc_editor('+params[0]+')\n');
- var w;
- var chrome = 'chrome://evergreen/content/cat/marc.xul';
- if (tab) {
- tabWindow.new_tab('main_tabbox');
- w = tabWindow.replace_tab('main_tabbox','MARC',chrome);
- } else {
- w = mw.new_window( chrome );
- }
- w.find_this_id = params[0];
- w.record_columns = params;
-}
-*/
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="record_list_win" title="&record_list.win_title;"
- orient="vertical" style="overflow: scroll"
- onload="my_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/record_list_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="record_list_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="record_list_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="record_list_keys" />
-
- <!-- Context menus -->
- <popupset id="record_list_popupset" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="record_list_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="record_list_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="record_list_js">
- <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
- <util id="util_js"/>
- <script src="record_list.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="record_list_cmds">
- <command id="cmd_edit_record" oncommand="spawn_editors(false);"/>
- <command id="cmd_edit_record_tab" oncommand="spawn_editors(true);"/>
- <command id="cmd_browse_record" oncommand="spawn_browsers(false);"/>
- <command id="cmd_browse_record_tab" oncommand="spawn_browsers(true);"/>
- <command id="cmd_alert" oncommand="alert('Not Yet Implemented');"/>
-</commandset>
-
-<!-- Context menus -->
-<popupset id="record_list_popupset">
- <popup id="record_menu">
- <menuitem label="&cat.popup.edit_record.tab;" command="cmd_edit_record_tab"/>
- <menuitem label="&cat.popup.edit_record.window;" command="cmd_edit_record"/>
- <menuitem label="&cat.popup.browse_record.tab;" command="cmd_browse_record_tab"/>
- <menuitem label="&cat.popup.browse_record.window;" command="cmd_browse_record"/>
- <menuitem label="&cat.popup.add_to_bucket;" oncommand="
- alert('Not Yet Implemented');
- "/>
- </popup>
-</popupset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="record_list_vbox" flex="1">
- <button id="count_copy_toggle" label="Show Results For All Libraries"/>
- <tree id="record_list_tree"/>
-</vbox>
-
-<tree id="record_list_tree" enableColumnDrag="true" flex="1">
- <treecols>
- <treecol id="record_list_title" label="&record_list.title;" flex="2"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_author" label="&record_list.author;" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_tcn" label="&record_list.tcn;" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_publisher" label="&record_list.publisher;" flex="1" hidden="true"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_pubyear" label="&record_list.pubyear;" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_isbn" label="&record_list.isbn;" flex="1" hidden="true"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_issn" label="&record_list.issn;" flex="1" hidden="true"/>
- <splitter class="tree-splitter"/>
- <treecol id="record_list_copy_count" label="&record_list.copy_count;" flex="1" hidden="true"/>
- </treecols>
- <treechildren id="record_list_tree_children" context="record_menu"/>
-</tree>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="record_list_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="spine_label" title="Spine Label Wizard"
- orient="vertical" style="overflow: auto"
- onload="spine_label_init()" width="800" height="600"
- onwizardfinish="print_all_labels()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <script>
- <![CDATA[
-
- var spine_labels;
-
- function spine_label_init() {
- try { spine_labels = params.spine_labels; } catch(E) { sdump('D_ERROR',js2JSON(E) + '\n'); }
- if (!spine_labels) spine_labels = [ [ 'A Call Number', '1' ] ];
- var rows = document.getElementById('page1_rows');
- for (var i = 0; i < spine_labels.length; i++) {
- var sl = spine_labels[i];
- var label = sl[0];
- var count = sl[1];
- var row = document.createElement('row'); rows.appendChild(row);
- var btn = document.createElement('button'); row.appendChild(btn);
- btn.setAttribute('label','Test Print');
- var label_tb = document.createElement('textbox'); row.appendChild(label_tb);
- label_tb.setAttribute('multiline','true');
- label_tb.setAttribute('value',label);
- label_tb.setAttribute('name','label_' + i);
- var count_tb = document.createElement('textbox'); row.appendChild(count_tb);
- count_tb.setAttribute('multiline','true');
- count_tb.setAttribute('value',count);
- count_tb.setAttribute('name','count_' + i);
- btn.addEventListener('command',
- function() {
- sPrint(label2html(label_tb.value), false, { 'marginLeft' : document.getElementById('margin') } );
- }, false
- );
- }
- }
-
- function print_all_labels() {
- var html = '';
- for (var i = 0; i < spine_labels.length; i++) {
- var label = document.getElementsByAttribute('name','label_'+i)[0].value;
- var count = document.getElementsByAttribute('name','count_'+i)[0].value;
- for (var j = 0; j < count; j++) {
- html += label2html(label);
- }
- }
- sPrint(html, false);
- }
-
- function label2html(s) {
- var html = '';
- var a = s.split('\n');
- for (var i = 0; i < document.getElementById('rows').value; i++) {
- if (typeof a[i] != 'undefined' ) {
- html += a[i].substr(0,document.getElementById('cols').value);
- }
- html += print_crlf;
- }
- for (var i = 0; i < document.getElementById('between').value; i++) {
- html += print_crlf;
- }
- return html;
- }
-
- ]]>
- </script>
-
-
- <wizardpage id="page1" description="Printing Spine Labels" onpageadvanced="">
- <grid>
- <columns> <column flex="0" /> <column flex="1" /> <column flex="0" /> </columns>
- <rows id="page1_rows">
- <row><spacer/><description>For this Pre-Beta release, we're focusing on the dot-matrix printers used by PINES (OKI MICROLINE 320 Turbo 9 Pin Printer). In the future, we will support all manner of label sheets with various printers. We'll also have optional template variables for things like shelving location, copy number, and barcode. For now, please check the character dimensions for a spine label, the number of lines between labels, and the left-margin for the printer:</description><grid><columns><column/><column/></columns><rows><row><label value="Left Margin"/><textbox id="margin" value=".63"/></row><row><label value="Columns"/><textbox id="cols" value="9"/></row><row><label value="Rows"/><textbox id="rows" value="9"/></row><row><label value="Lines Between"/><textbox id="between" value="2"/></row></rows></grid></row>
- <row><spacer/></row>
- <row><spacer/><label value="Label" /><label value="Print This Many"/></row>
- </rows>
- </grid>
- </wizardpage>
-
-</wizard>
-
-
+++ /dev/null
-var data = {}; var data_backup; var cn_list = [];
-var new_id = -1;
-
-function my_init() {
- mw.sdump('D_CAT','entering my_init for volume.js\n');
- mw.sdump('D_CAT','TESTING: volume.js: ' + mw.G['main_test_variable'] + '\n');
- mw.sdump('D_CAT','record_id = ' + record_id + '\n');
- mw.sdump('D_CAT','tree_items: ' + tree_items + '\n');
- if (params.shortcut == 'volume_add') {
- build_page_one();
- } else if (params.shortcut == 'copy_add') {
- build_page_two();
- } else {
- mw.sdump('D_CAT','broken\n');
- }
- listen_for_enter('volume_add');
- mw.sdump('D_CAT','exiting my_init for volume.js\n');
-}
-
-function listen_for_enter(w) {
- if (typeof(w) != 'object') {
- w = document.getElementById(w);
- }
- w.addEventListener('keypress',
- function (ev) {
- mw.sdump('D_CAT','wizard: ev.target.tagName = ' + ev.target.tagName + '\n');
- mw.sdump('D_CAT','\tev.keyCode = ' + ev.keyCode + '\n');
- mw.sdump('D_CAT','\tev.charCode = ' + ev.charCode + '\n');
- if ((ev.target.tagName == 'textbox') && (ev.keyCode == 13)) {
- ev.preventDefault();
- ev.stopPropagation(); // XBL bindings? bleh
- fake_tab_for_textboxes(w,ev.target);
- return true;
- }
- },
- true
- );
-}
-
-function page1_add_volume_row(ou) {
- var row = document.createElement('row');
- row.setAttribute('id','p1_' + ou.id());
- document.getElementById('page1_rows').appendChild(row);
- var label = document.createElement('label');
- label.setAttribute('value',ou.name());
- row.appendChild(label);
- var textbox = document.createElement('textbox');
- textbox.setAttribute('size','1');
- textbox.setAttribute('value','0');
- row.appendChild(textbox);
-}
-
-function page2_add_volume_row(ou,ti) {
- mw.sdump('D_CAT','page2_add_volume_row...\n');
- var desired_volumes =
- document.getElementById('p1_' + ou.id()).lastChild.value;
- mw.sdump('D_CAT','ou = ' + ou.name() + ' desired = ' + desired_volumes + '\n');
- if (desired_volumes > 0) { } else { return; }
- var rows = document.getElementById('page2_rows');
- var row = document.createElement('row');
- rows.appendChild(row);
- var label = document.createElement('label');
- label.setAttribute('value',ou.name());
- row.appendChild(label);
- for (var i = 0; i < desired_volumes; i++) {
- var cn_row = document.createElement('row');
- //cn_row.setAttribute('id','p2_'+ou.id());
- cn_row.setAttribute('ou_name',ou.name());
- cn_row.setAttribute('ou_id',ou.id());
- //cn_row.setAttribute('spine_row','1');
- rows.appendChild(cn_row);
- cn_row.appendChild( document.createElement('label') );
- var cn_text1 = document.createElement('textbox');
- cn_text1.setAttribute('size','20');
- cn_text1.setAttribute('value','A Call Number');
- //cn_text1.setAttribute('spine_cn','1');
- cn_row.appendChild( cn_text1 );
- var cn_text2 = document.createElement('textbox');
- cn_text2.setAttribute('size','4');
- cn_text2.setAttribute('value','0');
- cn_row.appendChild( cn_text2 );
- /*
- var cn_text3 = document.createElement('textbox');
- cn_text3.setAttribute('size','4');
- cn_text3.setAttribute('value','0');
- cn_text3.setAttribute('spine_label_count','1');
- cn_row.appendChild( cn_text3 );
- */
- }
-}
-
-function copy_add_page2_add_volume_row(ou,ti) {
- mw.sdump('D_CAT','copy_add_page2_add_volume_row...\n');
- var rows = document.getElementById('page2_rows');
- var row = document.getElementById('page2_row_cn_' + ou.id() );
- if (!row) {
- row = document.createElement('row');
- row.setAttribute('id','page2_row_cn' + ou.id() );
- rows.appendChild(row);
- }
- var label = document.createElement('label');
- label.setAttribute('value',ou.name());
- row.appendChild(label);
- var cn_row = document.createElement('row');
- //cn_row.setAttribute('id','p2_'+ou.id());
- cn_row.setAttribute('ou_name',ou.name());
- cn_row.setAttribute('ou_id',ou.id());
- cn_row.setAttribute('volume_id',ti.getAttribute('volume_id'));
- //cn_row.setAttribute('spine_row','1');
- rows.appendChild(cn_row);
- cn_row.appendChild( document.createElement('label') );
- var cn_text1 = document.createElement('textbox');
- cn_text1.setAttribute('size','20');
- cn_text1.setAttribute('volume_id',ti.getAttribute('volume_id'));
- cn_text1.setAttribute('value',ti.getAttribute('callnumber'));
- //cn_text1.setAttribute('spine_cn','1');
- cn_row.appendChild( cn_text1 );
- cn_text1.disabled = true;
- var cn_text2 = document.createElement('textbox');
- cn_text2.setAttribute('size','4');
- cn_text2.setAttribute('value','0');
- cn_row.appendChild( cn_text2 );
- /*
- var cn_text3 = document.createElement('textbox');
- cn_text3.setAttribute('size','4');
- cn_text3.setAttribute('value','0');
- cn_text3.setAttribute('spine_label_count','1');
- cn_row.appendChild( cn_text3 );
- */
-}
-
-function page3_add_volume_row(id,data) {
- if (data.length>0) { } else { return; }
- var rows = document.getElementById('page3_rows');
- var org_row = document.createElement('row');
- rows.appendChild(org_row);
- var org_label = document.createElement('label');
- org_label.setAttribute('value',data[0].name);
- org_row.appendChild(org_label);
- for (var i in data) {
- var callnumber = data[i].callnumber;
- var desired_copies = data[i].copies;
- var cn_row = document.createElement('row');
- rows.appendChild(cn_row);
- var cn_box = document.createElement('hbox');
- cn_row.appendChild(cn_box);
- cn_box.appendChild( document.createElement('spacer') );
- var cn_label = document.createElement('label');
- cn_label.setAttribute('value',callnumber);
- cn_box.appendChild(cn_label);
- for (var c = 0; c < desired_copies; c++) {
- var bc_row = document.createElement('row');
- rows.appendChild(bc_row);
- bc_row.appendChild( document.createElement('label') );
- var bc_text = document.createElement('textbox');
- bc_text.setAttribute('size','15');
- bc_text.setAttribute('ou_name',data[i].name);
- bc_text.setAttribute('ou_id',id);
- bc_text.setAttribute('volume_id',data[i].volume_id);
- bc_text.setAttribute('callnumber',callnumber);
- bc_row.appendChild(bc_text);
- }
- }
-}
-
-function page_four_add_volume_row(name,callnumber,barcode) {
- mw.sdump('D_CAT','xul: name = ' + name + ' cn = ' + callnumber + ' bc = ' + barcode + '\n');
- var listbox = document.getElementById('ephemeral_listbox');
- var listitem = document.createElement('listitem');
- listbox.appendChild(listitem);
- var listcell1 = document.createElement('listcell');
- listcell1.setAttribute('label',name);
- listitem.appendChild(listcell1);
- var listcell2 = document.createElement('listcell');
- listcell2.setAttribute('label',callnumber);
- listitem.appendChild(listcell2);
- var listcell3 = document.createElement('listcell');
- listcell3.setAttribute('label',barcode);
- listitem.appendChild(listcell3);
-
-}
-
-function build_page_one() {
- mw.sdump('D_CAT','build_page_one\n');
- for (var i in tree_items) {
- var ti = tree_items[i];
- switch( ti.getAttribute('object_type') ) {
- case 'org_unit' :
- if (params.shortcut == 'volume_add') {
- var id = ti.getAttribute('id').split('_')[2];
- var ou = mw.G.org_tree_hash[id];
- var check_ou = check_volume_ou_perm( id );
- if ( check_ou ) {
- page1_add_volume_row( check_ou );
- }
- }
- break;
- }
- }
-}
-
-function build_page_two() {
- mw.sdump('D_CAT','build_page_two\n');
- for (var i in tree_items) {
- var ti = tree_items[i];
- mw.sdump('D_CAT','Considering item with object_type = ' + ti.getAttribute('object_type') + '\n');
- switch( ti.getAttribute('object_type') ) {
- case 'org_unit' :
- var id = ti.getAttribute('id').split('_')[2];
- var ou = mw.G.org_tree_hash[id];
- var check_ou = check_volume_ou_perm( id );
- if ( check_ou ) {
- page2_add_volume_row( check_ou, ti );
- }
- break;
- case 'volume' :
- if (params.shortcut == 'copy_add') {
- var check_ou = find_ou( mw.G.user_ou , ti.getAttribute('ou_id') );
- if (check_ou) {
- copy_add_page2_add_volume_row( check_ou, ti );
- }
- }
- break;
- }
- }
-}
-
-function build_page_three() {
- mw.sdump('D_CAT','build_page_three\n');
- var rows = document.getElementById('page2_rows');
- for (var i = 0; i < rows.childNodes.length; i++) {
- var row = rows.childNodes[i];
- mw.sdump('D_CAT',row + '\n');
- var ou_id = row.getAttribute('ou_id');
- var ou_name = row.getAttribute('ou_name');
- var volume_id = row.getAttribute('volume_id');
- if (ou_id) {
- var call_number = row.childNodes[1].value;
- if (!call_number) { continue; }
- var desired_copies = row.childNodes[2].value;
- if (!data[ou_id]) { data[ou_id] = []; }
- data[ou_id].push(
- {
- 'callnumber' : call_number,
- 'copies' : desired_copies,
- 'name' : ou_name,
- 'volume_id' : volume_id
- }
- );
- }
- }
- for (var i in data) {
- mw.sdump('D_CAT','i: ' + i + ' data[i]: ' + js2JSON(data[i]) + '\n');
- page3_add_volume_row( i, data[i]);
- }
-}
-
-function build_page_four() {
- mw.sdump('D_CAT','build page four\n');
- document.getElementById('volume_add').canAdvance = false;
- var new_data = [];
- var rows = document.getElementById('page3_rows');
- var nl = rows.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- var t = nl[i];
- var ou_id = t.getAttribute('ou_id');
- var ou_name = t.getAttribute('ou_name');
- var callnumber = t.getAttribute('callnumber');
- var volume_id = t.getAttribute('volume_id');
- var barcode = t.value;
- //page_four_add_volume_row(ou_name,callnumber,barcode);
- mw.sdump('D_CAT','t.tagName = ' + t.tagName + ' ou_id = ' + ou_id + ' cn = ' + callnumber + ' volume_id = ' + volume_id + ' bc = ' + barcode + '\n');
- if (! new_data[ou_id] ) { new_data[ou_id] = {}; }
- if (! new_data[ou_id][callnumber] ) {
- new_data[ou_id][callnumber] = [];
- }
- if (! new_data[ou_id][callnumber]['barcode'] ) {
- new_data[ou_id][callnumber]['barcode'] = [];
- }
- new_data[ou_id][callnumber].barcode.push(barcode);
- if (params.shortcut == 'copy_add') {
- new_data[ou_id][callnumber].volume_id = volume_id;
- }
- }
- }
- cn_list = [];
- for (var ou_id in new_data) {
- for (var cnum in new_data[ou_id]) {
- //var ou_shortname = find_ou(mw.G['org_tree'],ou_id).shortname();
- //var ou_shortname = mw.G.org_tree_hash[ou_id].shortname();
- var cn = new acn();
- cn.label(cnum);
- cn.owning_lib(ou_id);
- cn.record(record_id);
- if (params.shortcut == 'volume_add') {
- cn.isnew(1);
- cn.id(new_id--);
- } else if (params.shortcut == 'copy_add') {
- cn.id( new_data[ou_id][cnum].volume_id );
- }
- cn.copies([]);
-
- for (var c in new_data[ou_id][cnum].barcode) {
- var cp = new acp();
- cp.id(new_id--);
- cp.isnew(1);
- cp.barcode(new_data[ou_id][cnum].barcode[c]);
- cp.circ_lib( mw.G.org_tree_hash[ ou_id ]);
- cn.copies().push(cp);
- cp.stat_cat_entries( [] );
- }
-
- cn_list.push(cn);
- }
- }
- mw.sdump('D_CAT','Final data object: ' + js2JSON(cn_list) + '\n');
- mw.sdump('D_CAT','Final data object: ' + cn_list + '\n');
- spawn_local_legacy_copy_editor();
-}
-
-function send_to_bill() {
- mw.sdump('D_DEBUG','cn_list = \n' + js2JSON( cn_list ) + '\n');
- try {
- var result = user_request(
- 'open-ils.cat',
- 'open-ils.cat.asset.volume_tree.fleshed.batch.update',
- [ mw.G['auth_ses'][0], cn_list]
- );
- mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
- } catch(E) {
- handle_error(E);
- }
- var spine_labels = mw.map_list(
- cn_list,
- function(cn) {
- var label = cn.label(); var copies = cn.copies();
- if (copies) { copies = copies.length; } else { copies = 0; }
- return [ label, copies ];
- }
- );
- //alert( window.app_shell );
- try {
- spawn_spine_label_wizard(document,'new_window','',{ 'spine_labels' : spine_labels });
- } catch(E) {
- sdump('D_ERROR', 'spine label: ' + js2JSON(E) + '\n');
- }
- refresh_spawning_browse_list();
-}
-
-function refresh_spawning_browse_list() {
- try {
- params.refresh_func();
- } catch(E) {
- mw.sdump('D_CAT','refresh_spawning_browse_list error: ' + js2JSON(E) + '\n');
- }
-}
-
-function spawn_local_legacy_copy_editor(tab) {
- mw.sdump('D_CAT','trying to spawn_copy_editor()\n');
- var params = { 'select_all' : true };
- var chrome = 'chrome://evergreen/content/cat/copy.xul';
- var frame = document.getElementById('page4_iframe');
- frame.setAttribute('src',chrome);
- frame.setAttribute('flex','1');
- frame.contentWindow.cn_list = cn_list;
- frame.contentWindow.mw = mw;
- frame.contentWindow.real_parentWindow = this;
- frame.contentWindow.parentWindow = window.app_shell;
- frame.contentWindow.params = params;
-}
-
-function backup_data() {
- data_backup = data;
-}
-
-function restore_data() {
- data = data_backup;
-}
-
-function check_volume_ou_perm(id) {
- var top_ou = mw.G.org_tree_hash[ mw.G.user_ou.id() ];
- var check_ou = find_ou(top_ou, id);
- return check_ou;
-}
-
-// ***************************************************** Batch Volume Edit
-
-function volume_edit_init() {
- mw.sdump('D_CAT','TESTING: volume.js: ' + mw.G['main_test_variable'] + '\n');
- build_batch_edit_page1();
- listen_for_enter('volume_edit');
-}
-
-function build_batch_edit_page1() {
- var rows = document.getElementById('page1_rows');
-
- var org = {};
-
- for (var i = 0; i < tree_items.length; i++) {
- var volume = tree_items[i];
- if (! org[ volume.getAttribute('ou_id') ] ) {
- org[ volume.getAttribute('ou_id') ] = new Array();
- }
- org[ volume.getAttribute('ou_id') ].push( volume );
- }
-
- for (var i in org) {
- var row = document.createElement('row');
- rows.appendChild(row);
- var lib = document.createElement('label');
- row.appendChild(lib);
- lib.setAttribute( 'value', mw.G.org_tree_hash[i].shortname() );
-
- for (var j = 0; j < org[i].length; j++) {
- var volume = org[i][j];
-
- var vrow = document.createElement('row');
- rows.appendChild(vrow);
- vrow.appendChild( document.createElement('label') );
-
- var t = document.createElement('textbox');
- vrow.appendChild( t );
- t.value = volume.getAttribute('callnumber');
- t.setAttribute( 'original', volume.getAttribute('callnumber') );
- t.setAttribute( 'volume_id', volume.getAttribute('volume_id') );
- }
- }
-}
-
-function submit_edited_volumes() {
- var nl = document.getElementsByTagName('textbox');
- for (var i = 0; i < nl.length; i++) {
- var t = nl[i];
- if (t.getAttribute('original') == t.value) continue;
- var cn = new acn();
- cn.id( t.getAttribute('volume_id') );
- cn.label( t.value );
- cn.ischanged('1');
- cn_list.push( cn );
- }
- send_to_bill();
- mw.sdump('D_DEBUG','cn_list = \n' + js2JSON(cn_list) + '\n');
-}
-
-function spine_labels() {
- var nl = document.getElementsByTagName('row');
- var spine_labels = [];
- for (var i = 0; i < nl.length; i++) {
- var r = nl[i]; var cn = ''; var count = 0;
- if (! r.getAttribute('spine_row')) continue;
- for (var j = 0; j < r.childNodes.length; j++) {
- var c = r.childNodes[j];
- if (c.getAttribute('spine_cn')) cn = c.value;
- if (c.getAttribute('spine_label_count')) count = c.value;
- }
- spine_labels.push( [ cn, count ] );
- }
- mw.spawn_spine_label_wizard(document,'new_window','',{ 'spine_labels' : spine_labels });
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="volume_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="volume_js">
- <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
- <util id="util_js"/>
- <script src="volume.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="volume_cmds">
- <command id="cmd_alert" oncommand="
- alert('Feature Not Yet Implemented');
- "/>
- <command id="cmd_batch_edit" oncommand="
- spawn_local_legacy_copy_editor();
- "/>
-</commandset>
-
-<wizardpage id="page1" description="&volume.wizard.page1;" onpageadvanced="build_page_two();">
- <groupbox>
- <caption label="How many volumes?"/>
- <grid>
- <columns> <column flex="0"/> <column flex="0"/> </columns>
- <rows id="page1_rows"/>
- </grid>
- </groupbox>
-</wizardpage>
-
-<wizardpage id="page2" description="&volume.wizard.page2;" onpageadvanced="build_page_three()" onpagerewound="var rows = document.getElementById('page2_rows'); while (rows.childNodes.length > 1) { rows.removeChild(rows.lastChild); }">
- <groupbox>
- <caption label="What call numbers and how many copies?"/>
- <grid>
- <columns>
- <column flex="0"/>
- <column flex="0"/>
- <column flex="0"/>
- </columns>
- <rows id="page2_rows">
- <row>
- <label />
- <label value="Call Number" />
- <label value="# of Copies" />
- <!--
- <label value="# of Spine Labels" />
- -->
- </row>
- </rows>
- </grid>
- <!--
- <hbox>
- <button label="Edit and Print Spine Labels" accesskey="E" oncommand="spine_labels()"/>
- </hbox>
- -->
- </groupbox>
-</wizardpage>
-
-<wizardpage id="page3" description="&volume.wizard.page3;" onpageadvanced="backup_data(); build_page_four()" onpagerewound="var rows = document.getElementById('page3_rows'); while (rows.childNodes.length > 1) { rows.removeChild(rows.lastChild); }">
- <groupbox>
- <caption label="What are the barcodes?"/>
- <grid>
- <columns>
- <column flex="0"/> <column flex="0"/>
- </columns>
- <rows id="page3_rows">
- <row>
- <label value="" />
- <label value="Barcode" />
- </row>
- </rows>
- </grid>
- </groupbox>
-</wizardpage>
-
-<wizardpage id="page4" description="something" onpagerewound="restore_data();" flex="1">
- <iframe id="page4_iframe" flex="1"/>
-</wizardpage>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="volume_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_add" title="&volume.wizard.title;"
- orient="vertical" style="overflow: auto"
- onload="my_init();" width="800" height="600"
- onwizardfinish="send_to_bill();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/volume_copy_add_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="volume_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="volume_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="volume_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <wizardpage id="page1"/>
- <wizardpage id="page2"/>
- <wizardpage id="page3"/>
- <wizardpage id="page4"/>
-
-</wizard>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="volume_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="volume_js">
- <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
- <util id="util_js"/>
- <script src="volume.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit. Sort of like an API list -->
-<commandset id="volume_cmds">
- <command id="cmd_alert" oncommand="
- alert('Feature Not Yet Implemented');
- "/>
-</commandset>
-
-<wizardpage id="page1" description="Entering Call Numbers" onpageadvanced="">
- <groupbox>
- <caption label="Modify Call Numbers?"/>
- <grid>
- <columns> <column flex="0"/> <column flex="0"/> </columns>
- <rows id="page1_rows"/>
- </grid>
- </groupbox>
-</wizardpage>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="volume_keys">
- <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_edit" title="Batch Volume Editor"
- orient="vertical" style="overflow: auto"
- onload="volume_edit_init();" width="800" height="600"
- onwizardfinish="submit_edited_volumes();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/cat/volume_edit_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- The logic for this app -->
- <Evergreen id="volume_js" />
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="volume_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="volume_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <wizardpage id="page1"/>
-
-</wizard>
-
+++ /dev/null
-sdump('D_TRACE','Loading checkin.js\n');
-
-function checkin_init(p) {
- sdump('D_CHECKIN',"TESTING: checkin.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-
- // gives: p.clamshell, p.right_panel, p.left_panel, p.inner_left_clamshell, p.inner_top_panel, p.inner_bottom_panel
- checkin_clamshell_init(p);
-
- // gives: p.checkin_items, p.redraw_checkin_items
- checkin_checkin_items_init(p);
-
- p.refresh = function() {
- }
-
- p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
- p.retrieve_button.addEventListener(
- 'command',
- function (ev) {
- spawn_patron_display(
- p.w.app_shell,'new_tab','main_tabbox',
- {
- 'patron' : retrieve_patron_by_id(
- p._patron.id()
- )
- }
- );
- }
- ,false
- );
-
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function checkin_clamshell_init(p) {
- p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
- p.left_panel = p.clamshell.first_deck;
- p.right_panel = p.clamshell.second_deck;
-}
-
-function checkin_checkin_items_init(p) {
- p.checkin_items = checkin_items_init( { 'w' : p.w, 'node' : p.checkin_items_node, 'debug' : p.app } );
-
- var checkins = [];
-
- var backdate_tb = p.checkin_items_node.getElementsByAttribute('id','checkin_effective_date_textbox')[0];
- backdate_tb.value = formatted_date( new Date(), '%Y-%m-%d');
- backdate_tb.addEventListener(
- 'change',
- function () {
- var flag = false;
- var darray = backdate_tb.value.split('-');
- var year = darray[0]; if ( (!year) || (year.length != 4) || (!parseInt(year)) ) flag = true;
- var month = darray[1]; if ( (!month) || (month.length !=2) || (!parseInt(month)) ) flag = true;
- var day = darray[2]; if ( (!day) || (day.length !=2) || (!parseInt(day)) ) flag = true;
- if (flag) {
- snd_bad();
- backdate_tb.value = formatted_date( new Date(), '%Y-%m-%d');
- }
- },
- false
- );
-
- var tb = p.checkin_items_node.getElementsByAttribute('id','checkin_barcode_entry_textbox')[0];
- var submit_button = p.checkin_items_node.getElementsByAttribute('id','checkin_submit_barcode_button')[0];
-
- p.attempt_checkin = function(barcode) {
- try {
- //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
- var check = checkin_by_copy_barcode( barcode, backdate_tb.value );
- if (check) {
- sdump('D_CHECKIN','check = ' + check + '\n' + pretty_print( js2JSON( check ) ) + '\n');
-
- if (check.status > -1) {
- checkins.push( check );
- p.checkin_items.add_checkin_items( [ checkins.length - 1 ] );
- } else {
- // should be handled already
- }
-
- tb.value = '';
- }
- } catch(E) {
- handle_error(E);
- }
- tb.select(); tb.focus();
- }
-
- tb.addEventListener(
- 'keypress',
- function(ev) {
- if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_checkin( tb.value ); }
- },
- false
- );
- submit_button.addEventListener(
- 'command',
- function(ev) {
- p.attempt_checkin( tb.value );
- },
- false
- );
-
- p.redraw_checkin_items = function() {
- p.checkin_items.clear_checkin_items();
- for (var i = 0; i < checkins.length; i++) {
- p.checkin_items.add_checkin_items( [ i ] );
- }
- }
-
- p.checkin_items.register_checkin_items_select_callback(
- function (ev) {
- sdump('D_CHECKIN','Firing checkin_items_select_callback\n');
- var checkin_items = get_list_from_tree_selection( p.checkin_items.paged_tree.tree );
- /* grab cover art for selected item? */
- }
- );
- p.checkin_items.register_flesh_checkin_items_function(
- function (treeitem) {
- sdump('D_CHECKIN','Firing flesh_checkin_items_function\n');
- var record_id = treeitem.getAttribute('record_id');
- p.checkin_items.map_checkin_items_to_cols( checkins[ record_id ], treeitem );
- }
- );
- p.checkin_items.register_context_builder(
- function (ev) {
- sdump('D_CHECKIN','Firing context_builder\n');
- empty_widget(p.checkin_items.paged_tree.popup);
- var checkin_items = get_list_from_tree_selection( p.checkin_items.paged_tree.tree );
- var menuitem;
-
- /*** COPY EDITOR ***/
- menuitem = p.checkin_items.paged_tree.w.document.createElement('menuitem');
- p.checkin_items.paged_tree.popup.appendChild( menuitem );
- menuitem.setAttribute('label',getString('circ.context_edit'));
- menuitem.addEventListener(
- 'command',
- function (ev) {
- for (var i = 0; i < checkin_items.length; i++) {
- var idx = checkin_items[i].getAttribute('record_id');
- var copy = checkins[idx].copy;
- sdump('D_CHECKIN','Firing copy edit context\n');
- spawn_batch_copy_editor(
- p.w.app_shell,'new_tab','main_tabbox',{
- 'copy_ids' : [ copy.id() ]
- }
- );
- }
- },
- false
- );
-
- /*** OPAC ***/
- menuitem = p.checkin_items.paged_tree.w.document.createElement('menuitem');
- p.checkin_items.paged_tree.popup.appendChild( menuitem );
- menuitem.setAttribute('label',getString('circ.context_opac'));
- menuitem.addEventListener(
- 'command',
- function (ev) {
- alert('Not Yet Implemented');
- for (var i = 0; i < checkin_items.length; i++) {
- var idx = checkin_items[i].getAttribute('record_id');
- sdump('D_CHECKIN','Firing opac context\n');
- }
- },
- false
- );
-
- }
- );
-}
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/checkin.dtd">
-
-<page id="checkin_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="try {
- params.w = window;
- params.app = 'Checkin';
- params.clamshell_node = document.getElementById('ClamShell_main');
- params.checkin_items_node = document.getElementById('CheckinItems_main');
- params.commandset_node = document.getElementById('universal_cmds');
- mw.focus_widget( document, 'checkin_barcode_entry_textbox' );
- mw.OpenILS_init(params);
- } catch(E) {
- alert(E);
- }"
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading checkin.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/checkin.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/circ/checkin_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="Checkin_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="Checkin_main" />
-
- <popupset id="universal_popupset" />
-
-</page>
-
+++ /dev/null
-sdump('D_TRACE','Loading checkin_items.js\n');
-
-function checkin_items_init(p) {
- sdump('D_CHECKIN_ITEMS',"TESTING: checkin_items.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.checkin_items_cols = checkin_cols();
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.checkin_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
- p.add_checkin_items = p.paged_tree.add_rows;
- p.clear_checkin_items = p.paged_tree.clear_tree;
-
- p.register_checkin_items_select_callback = function (f) {
- sdump('D_CHECKIN_ITEMS','p.register_checkin_items_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_checkin_items_function = function (f) {
- sdump('D_CHECKIN_ITEMS','p.register_flesh_checkin_items_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_context_builder = function (f) {
- sdump('D_CHECKIN_ITEMS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_checkin_items_to_cols = function (checkin_items, treeitem) {
- sdump('D_CHECKIN_ITEMS','p.map_checkin_items_to_cols( ' + checkin_items + ',' + treeitem + ')\n');
- checkin_items_tree_map_checkin_items_to_cols(p, checkin_items, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function checkin_items_tree_map_checkin_items_to_cols(p, checkin_items, treeitem) {
- sdump('D_CHECKIN_ITEMS',arg_dump(arguments,{1:true}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var cols = new Array();
- for (var i = 0; i < p.checkin_items_cols.length; i++) {
- var hash = p.checkin_items_cols[i];
- sdump('D_CHECKIN_ITEMS','Considering ' + js2JSON(hash) + '\n');
- var obj_string = 'checkin_items';
- switch( hash.fm_class ) {
- case 'acp' : obj_string = 'checkin_items.copy'; break;
- case 'circ' : obj_string = 'checkin_items.circ'; break;
- case 'mvr' : obj_string = 'checkin_items.record'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_CHECKIN_ITEMS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_CHECKIN_ITEMS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_CHECKIN_ITEMS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/checkin.dtd">
-<overlay id="checkin_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading checkin_overlay.xul\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/circ/checkin_items_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-
-</commandset>
-
-<!-- main widget for checkin -->
-<box id="Checkin_main" flex="1" orient="vertical">
- <groupbox id="Checkin_groupbox" orient="vertical" flex="1">
- <box id="ClamShell_main" />
- </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck">
- <box id="PatronDisplayStatus_main" />
- <spacer id="csfds" flex="1" />
-</deck>
-
-<deck id="ClamShell_second_deck">
- <groupbox id="cssdgb">
- <caption id="cssdgbc" label="&circ.checkin.caption;"/>
- <box id="CheckinItems_main"/>
- </groupbox>
-</deck>
-
-<hbox id="CheckinItems_insert1">
- <label id="checkin_scan_barcode_label" value="&circ.checkin.scan_label;" accesskey="&circ.checkin.scan_label.accesskey;" control="checkin_barcode_entry_textbox"/>
- <textbox id="checkin_barcode_entry_textbox"/>
- <button id="checkin_submit_barcode_button" label="&circ.checkin.submit_label;" accesskey="&circ.checkin.submit_label.accesskey;"/>
- <spacer flex="1"/>
- <label value="Effective Date:" control="checkin_effective_date_textbox"/>
- <textbox id="checkin_effective_date_textbox"/>
-</hbox>
-
-<hbox id="CheckinItems_insert2" />
-<hbox id="CheckinItems_insert3" />
-<hbox id="CheckinItems_insert4" />
-
-<hbox id="PatronDisplayStatus_insert2">
- <label id="PatronSearch_patron_name" class="patronNameMedium"
- tooltiptext="&checkin_patron.name.label;"
- value=" "
- render="true" fm_class="au"
- render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
- <button id="PatronSearch_retrieve_button"
- disabled="true"
- label="&checkin_patron.retrieve;"
- accesskey="&checkin_patron.retrieve.accesskey;"/>
-</hbox>
-
-<hbox id="CheckinItems_insert3">
- <button id="checkin_print" label="&checkin.print_receipt_label;" accesskey="&checkin.print_receipt_label.accesskey;" command="cmd_broken"/>
- <button id="checkin_reprint" label="&checkin.reprint_receipt_label;" accesskey="&checkin.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
- <spacer id="cii3s" flex="1"/>
- <checkbox id="checkin_auto" label="&checkin.auto_print_label;" accesskey="&checkin.auto_print_label.accesskey;"/>
- <button id="checkin_done" label="&checkin.done_label;" accesskey="&checkin.done_label.accesskey;" command="cmd_broken"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="Checkin_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading circ_tree.js\n');
-
-function is_barcode_valid( barcode ) {
-
- // consider checkdigit, length, etc.
-
- return check_checkdigit( barcode );
-}
-
-function cancel_hold( hold ) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
- try {
- var result = user_request(
- 'open-ils.circ',
- 'open-ils.circ.hold.cancel',
- [ mw.G.auth_ses[0], hold.id() ]
- )[0];
- sdump('D_CIRC_UTILS','result = ' + result + '\n');
- return result;
- } catch(E) {
- handle_error(E);
- return null;
- }
-}
-
-function mark_circ_as_lost(circ) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
- try {
- var result = user_request(
- 'open-ils.circ',
- 'open-ils.circ.circulation.set_lost',
- [ mw.G.auth_ses[0], circ.id() ]
- )[0];
- sdump('D_CIRC_UTILS','result = ' + result + '\n');
- return result;
- } catch(E) {
- handle_error(E);
- return null;
- }
-}
-
-function mark_circ_as_missing(circ) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
- try {
- var result = user_request(
- 'open-ils.circ',
- 'open-ils.circ.circulation.set_missing',
- [ mw.G.auth_ses[0], circ.id() ]
- )[0];
- sdump('D_CIRC_UTILS','result = ' + result + '\n');
- return result;
- } catch(E) {
- handle_error(E);
- return null;
- }
-}
-
-function checkout_permit(barcode, patron_id, num_of_open_async_checkout_requests, f) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true,1:true,2:true}));
- try {
- var check = user_request(
- 'open-ils.circ',
- 'open-ils.circ.permit_checkout',
- [ mw.G.auth_ses[0], barcode, patron_id, num_of_open_async_checkout_requests ],
- f
- )[0];
- if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
- return check;
- } catch(E) {
- handle_error(E);
- return null;
- }
-}
-
-function checkout_by_copy_barcode(barcode, patron_id, f) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true,1:true}));
- try {
- var check = user_request(
- 'open-ils.circ',
- 'open-ils.circ.checkout.barcode',
- [ mw.G.auth_ses[0], barcode, patron_id ],
- f
- )[0];
- if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
- return check;
- } catch(E) {
- sdump('D_ERROR',E);
- return null;
- }
-}
-
-function hold_capture_by_copy_barcode( barcode, retrieve_flag ) {
- try {
- var check = user_request(
- 'open-ils.circ',
- 'open-ils.circ.hold.capture_copy.barcode',
- [ mw.G.auth_ses[0], barcode, retrieve_flag ]
- )[0];
- check.text = 'Captured for Hold';
- if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
- return check;
- } catch(E) {
- handle_error(E, true);
- return null;
- }
-}
-
-function checkin_by_copy_barcode(barcode, backdate, f) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
- try {
- if (backdate && (backdate == formatted_date(new Date(),'%Y-%m-%d')) ) backdate = null;
-
- var check = user_request(
- 'open-ils.circ',
- 'open-ils.circ.checkin.barcode',
- [ mw.G.auth_ses[0], barcode, null, backdate ],
- f
- )[0];
-
- /*
- { // REMOVE_ME, forcing a condition for testing
- check.status = 1;
- check.text = 'This copy is the first that could fulfill a hold. Do it?';
- }
- */
-
- if (!f) {
- sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
- if (check.status != 0) {
- switch(check.status) {
- case '1': case 1: /* possible hold capture */
- var rv = yns_alert(
- check.text,
- 'Alert',
- "Capture",
- "Don't Capture",
- null,
- "Check here to confirm this message"
- );
- switch(rv) {
- case 0: /* capture */
- try {
- var check2 = hold_capture_by_copy_barcode( barcode );
- if (check2) {
- sdump('D_CIRC_UTILS','check2 = ' + js2JSON(check2) + '\n');
- check.copy = check2.copy;
- check.text = check2.text;
- check.route_to = check2.route_to;
- var patron = retrieve_patron_by_id( check.hold.usr() );
- sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + ' Title: ' +
- check.record.title() + ' Author: ' + check.record.author() +
- '<br />\r\n' + 'Route To: ' + check.route_to + ' Patron: ' +
- patron.card().barcode() + ' ' + patron.family_name() + ', ' +
- patron.first_given_name() + '<br />\r\n'
- );
-
- }
-
- } catch(E) {
- sdump('D_ERROR',E + '\n');
- /*
- // demo testing
- check.text = 'Captured for Hold';
- check.route_to = 'ARL-ATH';
- */
- }
- break;
- case 1: /* don't capture */
-
- check.text = 'Not Captured for Hold';
- break;
- }
- break;
- case '2': case 2: /* LOST??? */
- var patron = retrieve_patron_by_id( check.circ.usr() );
- var msg = check.text + '\r\n' + 'Barcode: ' + barcode + ' Title: ' +
- check.record.title() + ' Author: ' + check.record.author() + '\r\n' +
- 'Patron: ' + patron.card().barcode() + ' ' + patron.family_name() + ', ' +
- patron.first_given_name();
- var pcheck = yns_alert(
- msg,
- 'Lost Item',
- 'Edit Copy & Patron',
- "Just Continue",
- null,
- "Check here to confirm this message"
- );
- if (pcheck == 0) {
- var w = mw.spawn_main();
- setTimeout(
- function() {
- mw.spawn_patron_display(w.document,'new_tab','main_tabbox',{'patron':patron});
- mw.spawn_batch_copy_editor(w.document,'new_tab','main_tabbox',
- {'copy_ids':[ check.copy.id() ]});
- }, 0
- );
- }
- break;
- case '3': case 3: /* TRANSIT ELSEWHERE */
- if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
- var msg = check.text + '\r\n' + 'Barcode: ' + barcode + ' Title: ' +
- check.record.title() + ' Author: ' + check.record.author() +
- '\r\n' + 'Route To: ' + check.route_to + '\r\n';
- var pcheck = yns_alert(
- msg,
- 'Alert',
- 'Print Receipt',
- "Don't Print",
- null,
- "Check here to confirm this message"
- );
- if (pcheck == 0) {
- sPrint( msg.match( /\n/g, '<br />\r\n'), true );
- }
-
- break;
- case '4': case 4: /* transit for hold is complete */
- if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
- var msg = check.text + '\r\n' + 'Barcode: ' + barcode + ' Title: ' +
- check.record.title() + ' Author: ' + check.record.author() +
- '\r\n' + 'Route To: ' + check.route_to +
- '\r\n';
- var pcheck = yns_alert(
- msg,
- 'Alert',
- 'Print Receipt',
- "Don't Print",
- null,
- "Check here to confirm this message"
- );
- if (pcheck == 0) {
- sPrint( msg.match( /\n/g, '<br />\r\n'), true );
- }
-
- break;
-
- default:
- if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
- var msg = check.text + '\r\nBarcode: ' + barcode + ' Route To: ' + check.route_to;
- var pcheck = yns_alert(
- msg,
- 'Alert',
- 'Print Receipt',
- "Don't Print",
- null,
- "Check here to confirm this message"
- );
- if (pcheck == 0) {
- sPrint( msg.match( /\n/g, '<br />\r\n'), true );
- }
- break;
- }
- } else { // status == 0
- }
- if (parseInt(check.route_to)) {
- if (check.route_to != mw.G.user_ou.id()) {
- check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
- } else {
- check.route_to = mw.G.acpl_hash[ check.copy.location() ].name();
- }
- }
- }
- return check;
- } catch(E) {
- handle_error(E, true);
- return null;
- }
-}
-
-function renew_by_circ_id(id, f) {
- sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
- try {
- var check = user_request(
- 'open-ils.circ',
- 'open-ils.circ.renew',
- [ mw.G.auth_ses[0], id ],
- f
- )[0];
- if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
- return check;
- } catch(E) {
- sdump('D_ERROR',E);
- return null;
- }
-}
-
-function hold_cols() {
- var cols = [
-{
- 'id' : 'request_time', 'label' : getString('ahr_request_time_label'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'ahr',
- 'fm_field_render' : '.request_time().toString().substr(0,10)'
-},
-{
- 'id' : 'status', 'label' : getString('ahr_status_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 'fm_field_render' : '.status()'
-},
-{
- 'id' : 'hold_type', 'label' : getString('ahr_hold_type_label'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 'fm_field_render' : '.hold_type()'
-},
-{
- 'id' : 'pickup_lib', 'label' : getString('ahr_pickup_lib_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr',
- 'fm_field_render' : 'mw.G.org_tree_hash[ $$.pickup_lib() ].name()'
-},
-{
- 'id' : 'pickup_lib_shortname', 'label' : getString('ahr_pickup_lib_label'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'ahr',
- 'fm_field_render' : 'mw.G.org_tree_hash[ $$.pickup_lib() ].shortname()'
-},
- {
- 'id' : 'title', 'label' : getString('mvr_label_title'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.title()'
- },
- {
- 'id' : 'author', 'label' : getString('mvr_label_author'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.author()'
- },
-{
- 'id' : 'capture_time', 'label' : getString('ahr_capture_time_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.capture_time()'
-},
-{
- 'id' : 'current_copy', 'label' : getString('ahr_current_copy_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.current_copy()'
-},
-{
- 'id' : 'email_notify', 'label' : getString('ahr_email_notify_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.email_notify()'
-},
-{
- 'id' : 'expire_time', 'label' : getString('ahr_expire_time_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.expire_time()'
-},
-{
- 'id' : 'fulfillment_time', 'label' : getString('ahr_fulfillment_time_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.fulfillment_time()'
-},
-{
- 'id' : 'holdable_formats', 'label' : getString('ahr_holdable_formats_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.holdable_formats()'
-},
-{
- 'id' : 'id', 'label' : getString('ahr_id_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.id()'
-},
-{
- 'id' : 'phone_notify', 'label' : getString('ahr_phone_notify_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.phone_notify()'
-},
-{
- 'id' : 'prev_check_time', 'label' : getString('ahr_prev_check_time_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.prev_check_time()'
-},
-{
- 'id' : 'requestor', 'label' : getString('ahr_requestor_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.requestor()'
-},
-{
- 'id' : 'selection_depth', 'label' : getString('ahr_selection_depth_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.selection_depth()'
-},
-{
- 'id' : 'target', 'label' : getString('ahr_target_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.target()'
-},
-{
- 'id' : 'usr', 'label' : getString('ahr_usr_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.usr()'
-}
- ];
- return cols;
-}
-
-function checkin_cols() {
- var cols = [
- {
- 'id' : 'checkin_status', 'label' : getString('checkin_label_status'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : '', 'fm_field_render' : '.status.toString()'
- },
- {
- 'id' : 'checkin_route_to', 'label' : getString('checkin_label_route_to'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : '', 'fm_field_render' : '.route_to.toString()'
- },
- {
- 'id' : 'checkin_text', 'label' : getString('checkin_label_text'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : '', 'fm_field_render' : '.text.toString()'
- }
- ];
- var std_cols = map_list(
- circ_cols(),
- function(o){ if ((o.fm_class == 'acp')||(o.fm_class == 'circ')) o.hidden = true; return o; }
- );
- return cols.concat( std_cols );
-}
-
-function circ_cols() {
- return [
- {
- 'id' : 'acp_id', 'label' : getString('acp_label_id'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.id()'
- },
- {
- 'id' : 'circ_id', 'label' : getString('circ_label_id'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.id()'
- },
- {
- 'id' : 'mvr_doc_id', 'label' : getString('mvr_label_doc_id'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'mvr', 'fm_field_render' : '.doc_id()'
- },
- {
- 'id' : 'barcode', 'label' : getString('acp_label_barcode'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : '.barcode()'
- },
- {
- 'id' : 'call_number', 'label' : getString('acp_label_call_number'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.call_number()'
- },
- {
- 'id' : 'copy_number', 'label' : getString('acp_label_copy_number'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.copy_number()'
- },
- {
- 'id' : 'location', 'label' : getString('acp_label_location'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.location()'
- },
- {
- 'id' : 'loan_duration', 'label' : getString('acp_label_loan_duration'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.loan_duration()'
- },
- {
- 'id' : 'circ_lib', 'label' : getString('acp_label_circ_lib'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_lib()'
- },
- {
- 'id' : 'fine_level', 'label' : getString('acp_label_fine_level'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.fine_level()'
- },
- {
- 'id' : 'deposit', 'label' : getString('acp_label_deposit'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.deposit()'
- },
- {
- 'id' : 'deposit_amount', 'label' : getString('acp_label_deposit_amount'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.deposit_amount()'
- },
- {
- 'id' : 'price', 'label' : getString('acp_label_price'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.price()'
- },
- {
- 'id' : 'circ_as_type', 'label' : getString('acp_label_circ_as_type'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_as_type()'
- },
- {
- 'id' : 'circ_modifier', 'label' : getString('acp_label_circ_modifier'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_modifier()'
- },
- {
- 'id' : 'xact_start', 'label' : getString('circ_label_xact_start'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.xact_start()'
- },
- {
- 'id' : 'xact_finish', 'label' : getString('circ_label_xact_finish'), 'flex' : 1,
- 'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.xact_finish()'
- },
- {
- 'id' : 'due_date', 'label' : getString('circ_label_due_date'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.due_date().substr(0,10)'
- },
- {
- 'id' : 'title', 'label' : getString('mvr_label_title'), 'flex' : 2,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.title()'
- },
- {
- 'id' : 'author', 'label' : getString('mvr_label_author'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.author()'
- },
- {
- 'id' : 'renewal_remaining', 'label' : getString('circ_label_renewal_remaining'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.renewal_remaining()'
- },
- {
- 'id' : 'status', 'label' : getString('acp_label_status'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : 'mw.G.ccs_hash[ $$.status() ].name()'
- }
- ]
-};
-
-
+++ /dev/null
-sdump('D_TRACE','Loading hold_capture.js\n');
-
-function hold_capture_init(p) {
- sdump('D_HOLD_CAPTURE',"TESTING: hold_capture.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-
- // gives: p.clamshell, p.right_panel, p.left_panel, p.inner_left_clamshell, p.inner_top_panel, p.inner_bottom_panel
- hold_capture_clamshell_init(p);
-
- // gives: p.hold_capture_items, p.redraw_hold_capture_items
- hold_capture_hold_capture_items_init(p);
-
- p.refresh = function() {
- }
-
- p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
- p.retrieve_button.addEventListener(
- 'command',
- function (ev) {
- spawn_patron_display(
- p.w.app_shell,'new_tab','main_tabbox',
- {
- 'patron' : retrieve_patron_by_id(
- p._patron.id()
- )
- }
- );
- }
- ,false
- );
-
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function hold_capture_clamshell_init(p) {
- p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
- p.left_panel = p.clamshell.first_deck;
- p.right_panel = p.clamshell.second_deck;
-}
-
-function hold_capture_hold_capture_items_init(p) {
- p.hold_capture_items = hold_capture_items_init( { 'w' : p.w, 'node' : p.hold_capture_items_node, 'debug' : p.app } );
-
- var hold_captures = [];
- var tb = p.hold_capture_items_node.getElementsByAttribute('id','hold_capture_barcode_entry_textbox')[0];
- var submit_button = p.hold_capture_items_node.getElementsByAttribute('id','hold_capture_submit_barcode_button')[0];
-
- p.attempt_hold_capture = function(barcode) {
- try {
- //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
- var check = hold_capture_by_copy_barcode( barcode, true ); // barcode, flesh
- if (check) {
- sdump('D_HOLD_CAPTURE','check = ' + check + '\n' + pretty_print( js2JSON( check ) ) + '\n');
-
- check.status = 0;
- check.text = 'Captured for Hold Request';
-
- hold_captures.push( check );
- p.hold_capture_items.add_hold_capture_items( [ hold_captures.length - 1 ] );
-
- var patron = retrieve_patron_by_id( check.hold.usr() );
-
- sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + ' Title: ' + check.record.title() +
- ' Author: ' + check.record.author() + '<br />\r\n' +
- 'Route To: ' + check.route_to +
- ' Patron: ' + patron.card().barcode() + ' ' + patron.family_name() + ', ' + patron.first_given_name() +
- '<br />\r\n'
- );
- tb.value = '';
- }
- } catch(E) {
- handle_error(E);
- }
- tb.select(); tb.focus();
- }
-
- tb.addEventListener(
- 'keypress',
- function(ev) {
- if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_hold_capture( tb.value ); }
- },
- false
- );
- submit_button.addEventListener(
- 'command',
- function(ev) {
- p.attempt_hold_capture( tb.value );
- },
- false
- );
-
- p.redraw_hold_capture_items = function() {
- p.hold_capture_items.clear_hold_capture_items();
- for (var i = 0; i < hold_captures.length; i++) {
- p.hold_capture_items.add_hold_capture_items( [ i ] );
- }
- }
-
- p.hold_capture_items.register_hold_capture_items_select_callback(
- function (ev) {
- sdump('D_HOLD_CAPTURE','Firing hold_capture_items_select_callback\n');
- var hold_capture_items = get_list_from_tree_selection( p.hold_capture_items.paged_tree.tree );
- /* grab cover art for selected item? */
- }
- );
- p.hold_capture_items.register_flesh_hold_capture_items_function(
- function (treeitem) {
- sdump('D_HOLD_CAPTURE','Firing flesh_hold_capture_items_function\n');
- var record_id = treeitem.getAttribute('record_id');
- p.hold_capture_items.map_hold_capture_items_to_cols( hold_captures[ record_id ], treeitem );
- }
- );
- p.hold_capture_items.register_context_builder(
- function (ev) {
- sdump('D_HOLD_CAPTURE','Firing context_builder\n');
- empty_widget(p.hold_capture_items.paged_tree.popup);
- var hold_capture_items = get_list_from_tree_selection( p.hold_capture_items.paged_tree.tree );
- var menuitem;
-
- /*** COPY EDITOR ***/
- menuitem = p.hold_capture_items.paged_tree.w.document.createElement('menuitem');
- p.hold_capture_items.paged_tree.popup.appendChild( menuitem );
- menuitem.setAttribute('label',getString('circ.context_edit'));
- menuitem.addEventListener(
- 'command',
- function (ev) {
- for (var i = 0; i < hold_capture_items.length; i++) {
- var idx = hold_capture_items[i].getAttribute('record_id');
- var copy = hold_captures[idx].copy;
- sdump('D_HOLD_CAPTURE','Firing copy edit context\n');
- spawn_batch_copy_editor(
- p.w.app_shell,'new_tab','main_tabbox',{
- 'copy_ids' : [ copy.id() ]
- }
- );
- }
- },
- false
- );
-
- /*** OPAC ***/
- menuitem = p.hold_capture_items.paged_tree.w.document.createElement('menuitem');
- p.hold_capture_items.paged_tree.popup.appendChild( menuitem );
- menuitem.setAttribute('label',getString('circ.context_opac'));
- menuitem.addEventListener(
- 'command',
- function (ev) {
- alert('Not Yet Implemented');
- for (var i = 0; i < hold_capture_items.length; i++) {
- var idx = hold_capture_items[i].getAttribute('record_id');
- sdump('D_HOLD_CAPTURE','Firing opac context\n');
- }
- },
- false
- );
-
- }
- );
-}
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/hold_capture.dtd">
-
-<page id="hold_capture_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="try {
- params.w = window;
- params.app = 'HoldCapture';
- params.clamshell_node = document.getElementById('ClamShell_main');
- params.hold_capture_items_node = document.getElementById('HoldCaptureItems_main');
- params.commandset_node = document.getElementById('universal_cmds');
- mw.focus_widget( document, 'hold_capture_barcode_entry_textbox' );
- mw.OpenILS_init(params);
- } catch(E) {
- alert('onload: ' + E);
- }"
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading hold_capture.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/hold_capture.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/circ/hold_capture_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="HoldCapture_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="HoldCapture_main" />
-
- <popupset id="universal_popupset" />
-
-</page>
-
+++ /dev/null
-sdump('D_TRACE','Loading hold_capture_items.js\n');
-
-function hold_capture_items_init(p) {
- sdump('D_HOLD_CAPTURE_ITEMS',"TESTING: hold_capture_items.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.hold_capture_items_cols = checkin_cols();
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.hold_capture_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
- p.add_hold_capture_items = p.paged_tree.add_rows;
- p.clear_hold_capture_items = p.paged_tree.clear_tree;
-
- p.register_hold_capture_items_select_callback = function (f) {
- sdump('D_HOLD_CAPTURE_ITEMS','p.register_hold_capture_items_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_hold_capture_items_function = function (f) {
- sdump('D_HOLD_CAPTURE_ITEMS','p.register_flesh_hold_capture_items_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_context_builder = function (f) {
- sdump('D_HOLD_CAPTURE_ITEMS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_hold_capture_items_to_cols = function (hold_capture_items, treeitem) {
- sdump('D_HOLD_CAPTURE_ITEMS','p.map_hold_capture_items_to_cols( ' + hold_capture_items + ',' + treeitem + ')\n');
- hold_capture_items_tree_map_hold_capture_items_to_cols(p, hold_capture_items, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function hold_capture_items_tree_map_hold_capture_items_to_cols(p, hold_capture_items, treeitem) {
- sdump('D_HOLD_CAPTURE_ITEMS',arg_dump(arguments,{1:true}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var cols = new Array();
- for (var i = 0; i < p.hold_capture_items_cols.length; i++) {
- var hash = p.hold_capture_items_cols[i];
- sdump('D_HOLD_CAPTURE_ITEMS','Considering ' + js2JSON(hash) + '\n');
- var obj_string = 'hold_capture_items';
- switch( hash.fm_class ) {
- case 'acp' : obj_string = 'hold_capture_items.copy'; break;
- case 'circ' : obj_string = 'hold_capture_items.circ'; break;
- case 'mvr' : obj_string = 'hold_capture_items.record'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_HOLD_CAPTURE_ITEMS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_HOLD_CAPTURE_ITEMS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_HOLD_CAPTURE_ITEMS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/hold_capture.dtd">
-<overlay id="hold_capture_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading hold_capture_overlay.xul\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/circ/hold_capture_items_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-
-</commandset>
-
-<!-- main widget for hold_capture -->
-<box id="HoldCapture_main" flex="1" orient="vertical">
- <groupbox id="HoldCapture_groupbox" orient="vertical" flex="1">
- <box id="ClamShell_main" />
- </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck">
- <box id="PatronDisplayStatus_main" />
- <spacer id="csfds" flex="1" />
-</deck>
-
-<deck id="ClamShell_second_deck">
- <groupbox id="cssdgb">
- <caption id="cssdgbc" label="&circ.hold_capture.caption;"/>
- <box id="HoldCaptureItems_main"/>
- </groupbox>
-</deck>
-
-<hbox id="HoldCaptureItems_insert1">
- <label id="hold_capture_scan_barcode_label" value="&circ.hold_capture.scan_label;" accesskey="&circ.hold_capture.scan_label.accesskey;" control="hold_capture_barcode_entry_textbox"/>
- <textbox id="hold_capture_barcode_entry_textbox"/>
- <button id="hold_capture_submit_barcode_button" label="&circ.hold_capture.submit_label;" accesskey="&circ.hold_capture.submit_label.accesskey;"/>
-</hbox>
-
-<hbox id="HoldCaptureItems_insert2" />
-<hbox id="HoldCaptureItems_insert3" />
-<hbox id="HoldCaptureItems_insert4" />
-
-<hbox id="PatronDisplayStatus_insert2">
- <label id="PatronSearch_patron_name" class="patronNameMedium"
- tooltiptext="&hold_capture_patron.name.label;"
- value=" "
- render="true" fm_class="au"
- render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
- <button id="PatronSearch_retrieve_button"
- disabled="true"
- label="&hold_capture_patron.retrieve;"
- accesskey="&hold_capture_patron.retrieve.accesskey;"/>
-</hbox>
-
-<hbox id="HoldCaptureItems_insert3">
- <button id="hold_capture_print" label="&hold_capture.print_receipt_label;" accesskey="&hold_capture.print_receipt_label.accesskey;" command="cmd_broken"/>
- <button id="hold_capture_reprint" label="&hold_capture.reprint_receipt_label;" accesskey="&hold_capture.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
- <spacer id="cii3s" flex="1"/>
- <checkbox id="hold_capture_auto" label="&hold_capture.auto_print_label;" accesskey="&hold_capture.auto_print_label.accesskey;"/>
- <button id="hold_capture_done" label="&hold_capture.done_label;" accesskey="&hold_capture.done_label.accesskey;" command="cmd_broken"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="HoldCapture_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="itemsout_receipt_template_win"
- onload="try { my_init(); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading itemsout_receipt_template.xul\n');</script>
-
- <script>
- <![CDATA[
- var test_patron = mw.JSON2js('/*--S au --*/[null,null,null,[/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/],[/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/],[{"circ":/*--S aoc --*/[null,null,null,"212","2005-07-05 04:58:02-04","14 days","2wk_default","1 day","134","50.00","books","0.10","books","1","1",null,"11","18",null,"2005-07-19 10:38:25.211964-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"31041005404709","11",null,"212",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","11","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Albrand, Martha.",[],null,"3",null,null,"",[],"1959","Random House",null,[],[],null,"PIN01000004 ","A day in Monte Carlo",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"12","2005-08-04 11:31:02-04","14 days","2wk_default","1 day","171","50.00","books","0.10","books","0","2",null,"2139800","18",null,"2005-07-21 17:11:44.203345-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"33207000838641","1938753",null,"10",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-07-21 17:08:53.504341-04","1","2","1","2139800","2","1","1","10.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Sproule, Anna.",[],null,"330278",null,null,"0531182150 (lib. bdg.)",[],"1988","Bookwright Press",null,["Know your pet"],[["Dogs"],["Dog breeds"]],"Discusses how to choose and care for a pet dog and provides information on various breeds.","PIN03092988 ","Dogs",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"1","2005-08-05 14:36:02-04","14 days","2wk_default","1 day","173","50.00","books","0.10","books","0","2",null,"1329873","18",null,"2005-07-22 20:17:07.199888-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"34520000676111","1187974",null,"182",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","1329873","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Margolis, Matthew.",[],null,"97448",null,"1st Vintage Books ed.","0394711742 (pbk.) :",[],"1982, c1979","Vintage Books",null,[],[["Dogs"]],null,"PIN02040633 ","The dog in your life a complete guide to choosing, raising, feeding, training, and caring for your dog plus sections on show dogs, hunting dogs, coursing dogs, herd dogs, sled dogs, guard dogs, guide dogs, and a discussion of common canine illnesses",["text"]]/*--E mvr --*/}],[/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"3601016","email2@somewheres.info",null,null,"T",null,"45","800.555.0000","12","2005-07-24 15:47:42.091479-04","2005-07-21 16:35:16.026892-04","18","0","847314","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"1386122","email2@somewheres.info",null,null,"T",null,"46","800.555.0000","12","2005-07-24 15:47:45.240195-04","2005-07-21 16:40:12.783469-04","18","0","152833","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Available","2005-07-21 17:04:11.853992-04","548582","email2@somewheres.info",null,null,"T",null,"47","800.555.0000","12","2005-07-21 17:03:49.248665-04","2005-07-21 17:03:10.523049-04","18","0","23932","18"]/*--E ahr --*/],null,[/*--S actscecm --*/[null,null,null,"40","17","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"14","2","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"46","18","test2","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"42","16","","18"]/*--E actscecm --*/],null,"1",null,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/,/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/,"0","2005-05-13","0.00","800.555.0000","1900-01-02","email2@somewheres.info",null,"2008-05-13","Erickson","Bill","10","18","5","2","345","365","1122211188.708583190.17503114108",/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,"0","1",null,null,null,"Councilperson","3",null,"1","Jr","0","18","erickson"]/*--E au --*/');
-
- function my_init() {
- document.getElementById('itemsout_header_tb').value = mw.G.itemsout_header;
- document.getElementById('itemsout_line_item_tb').value = mw.G.itemsout_line_item;
- document.getElementById('itemsout_footer_tb').value = mw.G.itemsout_footer;
- document.getElementById('checkout_header_tb').value = mw.G.checkout_header;
- document.getElementById('checkout_line_item_tb').value = mw.G.checkout_line_item;
- document.getElementById('checkout_footer_tb').value = mw.G.checkout_footer;
- document.getElementById('checkin_header_tb').value = mw.G.checkin_header;
- document.getElementById('checkin_line_item_tb').value = mw.G.checkin_line_item;
- document.getElementById('checkin_footer_tb').value = mw.G.checkin_footer;
- document.getElementById('holds_header_tb').value = mw.G.holds_header;
- document.getElementById('holds_line_item_tb').value = mw.G.holds_line_item;
- document.getElementById('holds_footer_tb').value = mw.G.holds_footer;
- test_itemsout(document.getElementById('sample_view'));
- test_patron._current_checkouts = test_patron.checkouts();
- }
-
- function test_itemsout(sample_view) {
- var params = {
- 'au' : test_patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : document.getElementById('itemsout_header_tb').value,
- 'line_item' : document.getElementById('itemsout_line_item_tb').value,
- 'footer' : document.getElementById('itemsout_footer_tb').value
- };
- mw.print_itemsout_receipt( params, sample_view );
- }
-
- function save_itemsout() {
- mw.G.itemsout_header = document.getElementById('itemsout_header_tb').value;
- mw.G.itemsout_line_item = document.getElementById('itemsout_line_item_tb').value;
- mw.G.itemsout_footer = document.getElementById('itemsout_footer_tb').value;
- }
-
- function test_checkout(sample_view) {
- var params = {
- 'au' : test_patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : document.getElementById('checkout_header_tb').value,
- 'line_item' : document.getElementById('checkout_line_item_tb').value,
- 'footer' : document.getElementById('checkout_footer_tb').value
- };
- mw.print_checkout_receipt( params, sample_view );
- }
-
- function save_checkout() {
- mw.G.checkout_header = document.getElementById('checkout_header_tb').value;
- mw.G.checkout_line_item = document.getElementById('checkout_line_item_tb').value;
- mw.G.checkout_footer = document.getElementById('checkout_footer_tb').value;
- }
-
- function test_checkin(sample_view) {
- var params = {
- 'au' : test_patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : document.getElementById('checkin_header_tb').value,
- 'line_item' : document.getElementById('checkin_line_item_tb').value,
- 'footer' : document.getElementById('checkin_footer_tb').value
- };
- mw.print_checkin_receipt( params, sample_view );
- }
-
- function save_checkin() {
- mw.G.checkin_header = document.getElementById('checkin_header_tb').value;
- mw.G.checkin_line_item = document.getElementById('checkin_line_item_tb').value;
- mw.G.checkin_footer = document.getElementById('checkin_footer_tb').value;
- }
-
- function test_holds(sample_view) {
- var params = {
- 'au' : test_patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : document.getElementById('holds_header_tb').value,
- 'line_item' : document.getElementById('holds_line_item_tb').value,
- 'footer' : document.getElementById('holds_footer_tb').value
- };
- mw.print_holds_receipt( params, sample_view );
- }
-
- function save_holds() {
- mw.G.holds_header = document.getElementById('holds_header_tb').value;
- mw.G.holds_line_item = document.getElementById('holds_line_item_tb').value;
- mw.G.holds_footer = document.getElementById('holds_footer_tb').value;
- }
-
- function switch_sample_view() {
- try {
- var sv = document.getElementById('sample_view');
- switch( document.getElementById('tps').selectedPanel.id ) {
- case 'itemsout' : test_itemsout(sv); break;
- case 'checkout' : test_checkout(sv); break;
- case 'checkin' : test_checkin(sv); break;
- case 'holds' : test_holds(sv); break;
- }
- } catch(E) {
- mw.sdump('D_ERROR',mw.js2JSON(E));
- }
- }
-
- ]]>
- </script>
-
- <vbox flex="1" class="my_overflow">
- <groupbox orient="vertical" flex="1">
- <caption label="Receipt Template Editor"/>
- <hbox flex="1">
- <groupbox orient="vertical" flex="1">
- <caption label="HELP" />
- <tabbox flex="1">
- <tabs>
- <tab label="Description"/>
- <tab label="Sample View"/>
- </tabs>
- <tabpanels flex="1">
- <tabpanel flex="1">
- <hbox flex="1">
- <iframe flex="1" src="data:text/html,<html><p>Please note that this interface is for testing purposes, and that modifications you make here will not persist between different invocations of the staff client. In future versions of the software, you will be able to save and share named templates. Also note that the Sample View is not intended to be a print preview of the receipt. You should print the test receipt to determine how your template will actually look.</p><p>The following macros get evaluated and substituted for each receipt printed: %LIBRARY% %PINES_CODE% %PATRON_LASTNAME% %PATRON_FIRSTNAME% %PATRON_MIDDLENAME% %PATRON_BARCODE% %TODAY% %OUT% %DUE% %DURATION% %COPY_BARCODE% %TITLE% %AUTHOR% %PUBLISHER% %PUBDATE% %NUMBER% %STAFF_LASTNAME% %STAFF_FIRSTNAME% %STAFF_MIDDLENAME% %STAFF BARCODE%</p><p>If there's a specific macro you would like to see, please let us know. There will be variations on these for handling truncation and date formats. You may also include HTML markup in your template, but how that renders will depend on your printer and print driver. Please see the examples:</p></html>" />;
- </hbox>
- </tabpanel>
- <tabpanel flex="1">
- <hbox flex="1">
- <iframe flex="1" id="sample_view" />
- </hbox>
- </tabpanel>
- </tabpanels>
- </tabbox>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="TEMPLATES" />
- <tabbox flex="1">
- <tabs>
- <tab label="Items Out"/>
- <tab label="Check Out"/>
- <tab label="Check In"/>
- <tab label="Holds"/>
- </tabs>
- <tabpanels id="tps" flex="1" onselect="switch_sample_view();">
- <tabpanel id="itemsout">
- <vbox flex="1">
- <groupbox orient="vertical" flex="1">
- <caption label="Header"/>
- <textbox id="itemsout_header_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Line Item"/>
- <textbox id="itemsout_line_item_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Footer"/>
- <textbox id="itemsout_footer_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
- </groupbox>
- <hbox>
- <spacer flex="1"/>
- <button label="Update Sample View" accesskey="V" />
- <button label="Test Print" accesskey="T" oncommand="test_itemsout();"/>
- <button label="Save" accesskey="S" oncommand="save_itemsout();"/>
- </hbox>
- </vbox>
- </tabpanel>
- <tabpanel id="checkout">
- <vbox flex="1">
- <groupbox orient="vertical" flex="1">
- <caption label="Header"/>
- <textbox id="checkout_header_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Line Item"/>
- <textbox id="checkout_line_item_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Footer"/>
- <textbox id="checkout_footer_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
- </groupbox>
- <hbox>
- <spacer flex="1"/>
- <button label="Update Sample View" accesskey="V" />
- <button label="Test Print" accesskey="T" oncommand="test_checkout();"/>
- <button label="Save" accesskey="S" oncommand="save_checkout();"/>
- </hbox>
- </vbox>
- </tabpanel>
- <tabpanel id="checkin">
- <vbox flex="1">
- <groupbox orient="vertical" flex="1">
- <caption label="Header"/>
- <textbox id="checkin_header_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Line Item"/>
- <textbox id="checkin_line_item_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Footer"/>
- <textbox id="checkin_footer_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
- </groupbox>
- <hbox>
- <spacer flex="1"/>
- <button label="Update Sample View" accesskey="V" />
- <button label="Test Print" accesskey="T" oncommand="test_checkin();"/>
- <button label="Save" accesskey="S" oncommand="save_checkin();"/>
- </hbox>
- </vbox>
- </tabpanel>
- <tabpanel id="holds">
- <vbox flex="1">
- <groupbox orient="vertical" flex="1">
- <caption label="Header"/>
- <textbox id="holds_header_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Line Item"/>
- <textbox id="holds_line_item_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
- </groupbox>
- <groupbox orient="vertical" flex="1">
- <caption label="Footer"/>
- <textbox id="holds_footer_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
- </groupbox>
- <hbox>
- <spacer flex="1"/>
- <button label="Update Sample View" accesskey="V" />
- <button label="Test Print" accesskey="T" oncommand="test_holds();"/>
- <button label="Save" accesskey="S" oncommand="save_holds();"/>
- </hbox>
- </vbox>
- </tabpanel>
- </tabpanels>
- </tabbox>
- </groupbox>
- </hbox>
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
- <!-- modified by Jason for Evergreen -->
-
- <RDF:Seq about="urn:mozilla:package:root">
- <RDF:li resource="urn:mozilla:package:evergreen"/>
- </RDF:Seq>
-
- <RDF:Seq RDF:about="urn:mozilla:overlays">
- <RDF:li RDF:resource="chrome://browser/content/browser.xul"/>
- <RDF:li RDF:resource="chrome://navigator/content/navigator.xul"/>
- </RDF:Seq>
-
- <RDF:Seq RDF:about="chrome://browser/content/browser.xul">
- <RDF:li>chrome://evergreen/content/util/browser_overlay.xul</RDF:li>
- </RDF:Seq>
-
- <RDF:Seq about="chrome://navigator/content/navigator.xul">
- <RDF:li>chrome://evergreen/content/util/browser_overlay.xul</RDF:li>
- </RDF:Seq>
-
- <RDF:Description about="urn:mozilla:package:evergreen"
- chrome:displayName="Evergreen"
- chrome:author="PINES"
- chrome:name="evergreen"
- chrome:extension="true"/>
-
-</RDF:RDF>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="about_win"
- onload="document.getElementById('about_image').focus();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading about.xul\n');</script>
-
- <vbox id="about_vbox" flex="1" pack="center" align="center">
- <groupbox id="about_groupbox">
- <image id="about_image" src="chrome://evergreen/skin/media/images/main_logo.jpg"/>
- <!--<image id="about_image" src="chrome://evergreen/skin/media/images/cooltext001.png"/>-->
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-sdump('D_TRACE','Loading app_shell.js\n');
-
-function app_shell_init(p) {
- sdump('D_TAB',"TESTING: app_shell.js: " + mw.G['main_test_variable'] + '\n');
-
- p.w.close_tab = function (t1,t2) { return close_tab(p.w.document,t1,t2); };
- p.w.find_free_tab = function (tabs) { return find_free_tab(tabs); };
- p.w.new_tab = function () { return new_tab(p.w.document,p.tabbox); };
- p.w.replace_tab = function (label,chrome,params) { return replace_tab(p.w.document,p.tabbox,label,chrome,params); };
- p.w.get_frame_in_tab = function (idx, all_or_vis) { return get_frame_in_tab( p.w.document, p.tabbox, idx, all_or_vis ); };
-
- p.w.replace_tab('Tab','chrome://evergreen/content/main/about.xul');
- /*
- setTimeout(
- function () {
- spawn_javascript_console(p.w.document,'replace_tab','main_tabbox',{});
- setTimeout(
- function () {
- spawn_javascript_shell(p.w.document,'new_tab','main_tabbox',{});
- }, 2
- );
- }, 2
- );
- */
- return;
-}
-
-function close_tab( d, t1, t2 ) {
- // t1 = tabbox or tab, if t1 = tabbox, t2 = tab index, otherwise close current tab
- sdump('D_TAB',arg_dump(arguments,{1:true,2:true}));
- if (typeof(t1)!='object')
- t1 = d.getElementById(t1);
- if (typeof(t1)!='object')
- throw('Could not find tab or tabbox. d = ' + d + ' tabbox = ' + t1 + '\n');
- try {
- var tabbox;
-
- if (t1.tagName == 'tabbox')
- tabbox = t1;
- else
- tabbox = t1.parentNode.parentNode;
-
- var idx = tabbox.selectedIndex;
- if (t2)
- idx = t2;
-
- sdump('D_TAB','tabbox.selectedIndex = ' + tabbox.selectedIndex + '\n');
- var tabs = tabbox.firstChild;
- var panels = tabbox.lastChild;
-
- if (idx == 0) {
- try {
- tabs.advanceSelectedTab(+1);
- } catch(E) {
- sdump('D_TAB','failed tabs.advanceSelectedTab(+1):'+js2JSON(E) + '\n');
- try {
- tabs.advanceSelectedTab(-1);
- } catch(E) {
- sdump('D_TAB','failed again tabs.advanceSelectedTab(-1):'+js2JSON(E) + '\n');
- }
- }
- } else {
- try {
- tabs.advanceSelectedTab(-1);
- } catch(E) {
- sdump('D_TAB','failed tabs.advanceSelectedTab(-1):'+js2JSON(E) + '\n');
- try {
- tabs.advanceSelectedTab(+1);
- } catch(E) {
- sdump('D_TAB','failed again tabs.advanceSelectedTab(+1):'+js2JSON(E) + '\n');
- }
- }
-
- }
-
- sdump('D_TAB','\tnew tabbox.selectedIndex = ' + tabbox.selectedIndex + '\n');
-
- tabs.childNodes[ idx ].hidden = true;
- sdump('D_TAB','tabs.childNodes[ ' + idx + ' ].hidden = true;\n');
-
- // Make sure we keep at least one tab open.
- var tab_flag = true;
- for (var i = 0; i < tabs.childNodes.length; i++) {
- var tab = tabs.childNodes[i];
- if (!tab.hidden)
- tab_flag = false;
- }
- if (tab_flag)
- new_tab(d,tabbox);
-
- } catch(E) {
- sdump('D_ERROR',E+'\n');
- throw(E);
- }
-}
-
-function find_free_tab(tabs) {
- var last_not_hidden = -1;
- for (var i = 0; i<tabs.childNodes.length; i++) {
- var tab = tabs.childNodes[i];
- if (!tab.hidden)
- last_not_hidden = i;
- }
- if (last_not_hidden == tabs.childNodes.length - 1)
- last_not_hidden = -1;
- // If the one next to last_not_hidden is hidden, we want it.
- // Basically, we fill in tabs after existing tabs for as
- // long as possible.
- var idx = last_not_hidden + 1;
- var candidate = tabs.childNodes[ idx ];
- if (candidate.hidden)
- return idx;
- // Alright, find the first hidden then
- for (var i = 0; i<tabs.childNodes.length; i++) {
- var tab = tabs.childNodes[i];
- if (tab.hidden)
- return i;
- }
- return -1;
-}
-
-function get_frame_in_tab( d, tabbox, idx, all_or_visible ) {
- sdump('D_TAB',arg_dump(arguments));
- if (typeof(tabbox)!='object')
- tabbox = d.getElementById(tabbox);
- if (typeof(tabbox)!='object')
- throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
- var tabs = tabbox.firstChild;
- var panels = tabbox.lastChild;
- try {
- if (all_or_visible == 'visible') {
- var count = 0;
- for (var i = 0; i < tabs.childNodes.length; i++) {
- if (!tabs.childNodes[i].hidden) count++;
- if (count==idx) return panels.childNodes[i].getElementsByTagName('iframe')[0];
- }
- } else {
- return panels.childNodes[ idx ].getElementsByTagName('iframe')[0];
- }
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- return null;
-}
-
-function new_tab( d, tabbox ) {
- sdump('D_TAB',arg_dump(arguments,{1:true}));
- if (typeof(tabbox)!='object')
- tabbox = d.getElementById(tabbox);
- if (typeof(tabbox)!='object')
- throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
- var tabs = tabbox.firstChild;
- var panels = tabbox.lastChild;
- var tc = find_free_tab(tabs);
- sdump('D_TAB','find_free_tab returned ' + tc + '\n');
- if (tc == -1) { return; } // let's only have up to 10 tabs
- var tab = tabs.childNodes[ tc ];
- tab.setAttribute('label','Tab ' + (tc + 1) );
- tab.hidden = false;
- try {
- tabs.selectedIndex = tc;
- replace_tab(d,tabbox,'Tab','chrome://evergreen/content/main/about.xul');
- } catch(E) {
- sdump('D_ERROR','+++++++++++++++++++++++++++++' + E + ' : ' + js2JSON(E)+'\n');
- }
-}
-
-function replace_tab( d, tabbox, label, chrome, params ) {
- sdump('D_TAB',arg_dump(arguments,{2:true,3:true,4:true}));
- if (typeof(tabbox)!='object')
- tabbox = d.getElementById(tabbox);
- if (typeof(tabbox)!='object')
- throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
- var tabs = tabbox.firstChild;
- var panels = tabbox.lastChild;
- try {
- var idx = tabs.selectedIndex;
- var tab = tabs.childNodes[ idx ];
- var panel = panels.childNodes[ idx ];
-
- tab.hidden = false;
- tab.setAttribute('label',label + ' ' + (idx+1));
-
- var frame = d.createElement('iframe');
- frame.setAttribute('flex','1');
- frame.setAttribute('src',chrome);
- panel.appendChild(frame);
- panel.replaceChild(panel.lastChild,panel.firstChild);
- frame.setAttribute('id','frame_'+idx);
-
- sdump('D_TAB','Created frame : ' + frame.id + ' for index : ' + idx + ' with src=' + frame.getAttribute('src') + '\n');
- //frame.contentWindow.parentWindow = parentWindow;
- //frame.contentWindow.tabWindow = this;
- //dump('replace_tab.tabWindow = ' + this + '\n');
- frame.contentWindow.mw = mw;
- //frame.contentWindow.am_i_a_top_level_tab = true;
- if (params) {
- frame.contentWindow.params = params;
- }
- return frame.contentWindow;
- } catch(E) {
- sdump('D_ERROR',js2JSON(E)+'\n');
- }
- //debug_tabs(d,tabbox);
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-
-<window id="app_shell_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="
- params.tabbox = 'main_tabbox';
- params.w = window;
- params.app = 'AppShell';
- mw.OpenILS_init(params);
- window.document.title = mw.G.user.usrname() + '@' + mw.G.user_ou.name() + ' : ' + (++mw.G.appshell_name_increment);
- "
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading app_shell.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/app_shell.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/main/app_shell_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="AppShell_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="AppShell_main" />
-
- <popupset id="universal_popupset" />
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-<overlay id="app_shell_menus_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading app_shell_menus_overlay.xul\n');</script>
-
-<!-- The File menu on the main menu -->
-<menu id="main.menu.file" label="&main.menu.file.label;" accesskey="&main.menu.file.key;" >
- <menupopup id="main.menu.file.popup">
- <menuitem label="&main.menu.file.new.label;" accesskey="&main.menu.file.new.key;" key="file-new-key" observes="cmd_new_window"/>
- <menuitem label="&main.menu.file.new_tab.label;" accesskey="&main.menu.file.new_tab.key;" key="file-new-tab-key" observes="cmd_new_tab"/>
- <menuseparator />
- <!--
- <menuitem label="&main.menu.file.open.label;" accesskey="&main.menu.file.open.key;" key="file-open-key" observes="cmd_broken" disabled="true"/>
- <menuitem label="&main.menu.file.save.label;" accesskey="&main.menu.file.save.key;" key="file-save-key" observes="cmd_broken"/>
- <menuseparator />
- -->
- <menuitem label="&main.menu.file.close_tab.label;" accesskey="&main.menu.file.close_tab.key;" key="file-close-tab-key" observes="cmd_close_tab"/>
- <menuitem label="&main.menu.file.close.label;" accesskey="&main.menu.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
- </menupopup>
-</menu>
-
-<!-- The Edit menu on the main menu -->
-<menu id="main.menu.edit" label="&main.menu.edit.label;" accesskey="&main.menu.edit.key;">
- <menupopup id="main.menu.edit.popup">
- <menuitem label="stub"/>
- <!--
- <menuitem label="&main.menu.edit.undo.label;" accesskey="&main.menu.edit.undo.key;" key="edit-undo-key" observes="cmd_broken"/>
- <menuitem label="&main.menu.edit.redo.label;" accesskey="&main.menu.edit.redo.key;" key="edit-redo-key" observes="cmd_broken"/>
- <menuseparator />
- <menuitem label="&main.menu.edit.cut.label;" accesskey="&main.menu.edit.cut.key;" key="edit-cut-key" observes="cmd_broken"/>
- <menuitem label="&main.menu.edit.copy.label;" accesskey="&main.menu.edit.copy.key;" key="edit-copy-key" observes="cmd_broken"/>
- <menuitem label="&main.menu.edit.paste.label;" accesskey="&main.menu.edit.paste.key;" key="edit-paste-key" observes="cmd_broken"/>
- <menuitem label="&main.menu.edit.delete.label;" accesskey="&main.menu.edit.delete.key;" key="edit-delete-key" observes="cmd_broken"/>
- <menuseparator />
- <menuitem label="&main.menu.edit.buckets.label;" accesskey="&main.menu.edit.buckets.key;" observes="cmd_broken"/>
- <menuseparator />
- <menuitem label="&main.menu.edit.select_all.label;" accesskey="&main.menu.edit.select_all.key;" key="edit-select-all-key" observes="cmd_broken"/>
- <menuseparator />
- <menuitem label="&main.menu.edit.find.label;" accesskey="&main.menu.edit.find.key;" key="edit-find-key" observes="cmd_broken"/>
- <menuitem label="&main.menu.edit.find_again.label;" accesskey="&main.menu.edit.find_again.key;" key="edit-find-again-key" observes="cmd_broken"/>
- -->
- </menupopup>
-</menu>
-
-<!-- The Circulation menu on the main menu -->
-<menu id="main.menu.circ" label="&main.menu.circ.label;" accesskey="&main.menu.circ.key;">
- <menupopup id="main.menu.circ.popup">
- <menuitem label="&main.menu.circ.checkout.label;" accesskey="&main.menu.circ.checkout.key;" observes="cmd_circ_checkout"/>
- <menuitem label="&main.menu.circ.checkin.label;" accesskey="&main.menu.circ.checkin.key;" observes="cmd_circ_checkin"/>
- <menuitem label="&main.menu.circ.hold_capture.label;" accesskey="&main.menu.circ.hold_capture.key;" observes="cmd_circ_hold_capture"/>
- <!--
- <menu id="special-circ-menu" label="&main.menu.circ.special.label;" accesskey="&main.menu.circ.special.key;" observes="cmd_broken"/>
- <menuseparator />
- <menuitem label="&main.menu.circ.place_hold.label;" accesskey="&main.menu.circ.place_hold.key;" key="circ-place-hold-key" observes="cmd_broken"/>
- -->
- <menuseparator />
- <menuitem label="&main.menu.circ.copy_status.label;" accesskey="&main.menu.circ.copy_status.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.patron_status.label;" accesskey="&main.menu.circ.patron_status.key;" observes="cmd_circ_checkout"/>
- <menuseparator />
- <menuitem label="&main.menu.circ.patron_registration.label;" accesskey="&main.menu.circ.patron_registration.key;" observes="cmd_patron_register"/>
- </menupopup>
-</menu>
-
-<!-- The Special Circulation submenu in the Circulation menu -->
-<menu id="special-circ-menu">
- <menupopup id="special-circ-popup">
- <menuitem label="&main.menu.circ.mark_used.label;" accesskey="&main.menu.circ.mark_used.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.lost.label;" accesskey="&main.menu.circ.lost.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.missing.label;" accesskey="&main.menu.circ.missing.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.found.label;" accesskey="&main.menu.circ.found.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.claimed_returned.label;" accesskey="&main.menu.circ.claimed_returned.key;" observes="cmd_broken"/>
- <menuitem label="&main.menu.circ.quick_add.label;" accesskey="&main.menu.circ.quick_add.key;" observes="cmd_broken"/>
- </menupopup>
-</menu>
-
-<!-- The Cataloging menu on the main menu -->
-<menu id="main.menu.cat" label="&main.menu.cat.label;" accesskey="&main.menu.cat.key;">
- <menupopup id="main.menu.cat.popup">
- <menuitem label="&main.menu.cat.bib_search.label;" accesskey="&main.menu.cat.bib_search.key;" observes="cmd_search_opac"/>
- <menuseparator />
- <menuitem disabled="true" label="&main.menu.cat.dedup.label;" accesskey="&main.menu.cat.dedup.key;" observes="cmd_broken"/>
- <menuitem label="Create New Marc Record" accesskey="n" observes="cmd_create_new_marc_book"/>
- <menuitem label="Z39.50 Import" accesskey="Z" observes="cmd_z39_50_import"/>
- </menupopup>
-</menu>
-
-<!-- The Search menu on the main menu -->
-<menu id="main.menu.search" label="&main.menu.search.label;" accesskey="&main.menu.search.key;">
- <menupopup id="main.menu.search.popup">
- <menuitem label="Catalog" accesskey="C" observes="cmd_search_opac" />
- <menuitem label="Patrons" accesskey="P" observes="cmd_patron_search" />
- </menupopup>
-</menu>
-
-<!-- The Serials menu on the main menu -->
-<menu id="main.menu.serials" label="&main.menu.serials.label;" accesskey="&main.menu.serials.key;">
- <menupopup id="main.menu.serials.popup">
- <menuitem label="stub" />
- </menupopup>
-</menu>
-
-<!-- The Acquisitions menu on the main menu -->
-<menu id="main.menu.acquisitions" label="&main.menu.acquisitions.label;" accesskey="&main.menu.acquisitions.key;">
- <menupopup id="main.menu.acquisitions.popup">
- <menuitem label="stub" />
- </menupopup>
-</menu>
-
-<!-- The Reports menu on the main menu -->
-<menu id="main.menu.reports" label="&main.menu.reports.label;" accesskey="&main.menu.reports.key;">
- <menupopup id="main.menu.reports.popup">
- <menuitem label="stub" />
- </menupopup>
-</menu>
-
-<!-- The Help menu on the main menu -->
-<menu id="main.menu.help" label="&main.menu.help.label;" accesskey="&main.menu.help.key;">
- <menupopup id="main.menu.help.popup">
- <menuitem label="stub" />
- </menupopup>
-</menu>
-
-<!-- The Help menu on the main menu -->
-<menu id="main.menu.admin" label="&main.menu.admin.label;" accesskey="&main.menu.admin.key;">
- <menupopup id="main.menu.admin.popup">
- <menuitem label="Receipt Template Editor" accesskey="R" observes="cmd_receipt_template_editor"/>
- <menuitem label="Survey Wizard" accesskey="S" observes="cmd_survey_wizard"/>
- <menuitem label="Copy Stat-Cat Editor" accesskey="C" observes="cmd_copy_stat_cat_edit"/>
- <menuitem label="Patron Stat-Cat Editor" accesskey="P" observes="cmd_patron_stat_cat_edit"/>
- <menuseparator />
- <menuitem label="Test Module" accesskey="T" observes="cmd_test"/>
- <menuitem label="XUL Test" accesskey="X" observes="cmd_xuleditor"/>
- <menuitem label="Fieldmapper" accesskey="m" observes="cmd_fieldmapper"/>
- <menuitem label="Filterable Console" accesskey="F" observes="cmd_filter_console"/>
- <menuitem label="Javscript Console" accesskey="J" observes="cmd_console"/>
- <menuitem label="Javscript Shell" accesskey="H" observes="cmd_shell"/>
- </menupopup>
-</menu>
-
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-<overlay id="app_shell_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading app_shell_overlay.xul\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/main/app_shell_menus_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_close_window" key="close-window-key" oncommand="
- window.close();" />
-
- <command id="cmd_new_window" key="new-window-key" oncommand="
- mw.spawn_main();" />
-
- <command id="cmd_new_tab" key="new-tab-key" oncommand="
- mw.new_tab(document,'main_tabbox');" />
-
- <command id="cmd_close_tab" key="close-tab-key" oncommand="
- mw.close_tab(document,'main_tabbox');" />
-
- <command id="cmd_cat_main" key="cat-main-key" oncommand="
- mw.spawn_opac_navigator(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_circ_checkout" key="circ-checkout-key" oncommand="
- mw.spawn_patron_barcode_entry(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_patron_search" key="patron-search-key" oncommand="
- mw.spawn_patron_search(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_circ_checkin" key="circ-checkin-key" oncommand="
- mw.spawn_checkin(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_circ_hold_capture" key="circ-hold-capture-key" oncommand="
- mw.spawn_hold_capture(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_search_opac" key="search-opac-key" oncommand="
- mw.spawn_opac_navigator(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_patron_register" key="patron-register-key" oncommand="
- mw.spawn_patron_register(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_survey_wizard" oncommand="
- mw.spawn_survey_admin_wizard(document,'new_window','',{}); "/>
-
- <command id="cmd_copy_stat_cat_edit" oncommand="
- mw.spawn_copy_stat_cat_edit(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_patron_stat_cat_edit" oncommand="
- mw.spawn_patron_stat_cat_edit(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_receipt_template_editor" oncommand="
- mw.spawn_receipt_template_editor(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_z39_50_import" oncommand="
- mw.spawn_z3950_import(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_create_new_marc_book" oncommand="
- mw.spawn_new_marc_creation(document,'replace_tab','main_tabbox',{}); "/>
-
- <command id="cmd_console" oncommand="
- mw.spawn_javascript_console(document,'new_tab','main_tabbox',{}); "/>
-
- <command id="cmd_shell" oncommand="
- mw.spawn_javascript_shell(document,'new_tab','main_tabbox',{}); "/>
-
- <command id="cmd_xuleditor" oncommand="
- mw.spawn_xuleditor(document,'new_tab','main_tabbox',{}); "/>
-
- <command id="cmd_filter_console" oncommand="
- mw.spawn_filter_console(document,'new_tab','main_tabbox',{}); "/>
-
- <command id="cmd_fieldmapper" oncommand="
- mw.spawn_fieldmapper(document,'new_tab','main_tabbox',{}); "/>
-
- <command id="cmd_test" disabled="true" oncommand="
- mw.spawn_interface(document,'new_tab','main_tabbox','chrome://evergreen/content/util/fm_view.xul','Fieldmapper',{}); "/>
-
- <command id="cmd_broken" disabled="true" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- The top level widget for the staff client -->
-<box id="AppShell_main" flex="1" orient="vertical">
- <toolbox id="main_toolbox"/>
- <tabbox id="main_tabbox" flex="1" eventnode="window" handleCtrlTab="true">
- <tabs id="main_tabs" closebutton="true">
- <tab id="tab_1" accesskey="1" label="Tab 1" hidden="true" />
- <tab id="tab_2" accesskey="2" label="Tab 2" hidden="true" />
- <tab id="tab_3" accesskey="3" label="Tab 3" hidden="true" />
- <tab id="tab_4" accesskey="4" label="Tab 4" hidden="true" />
- <tab id="tab_5" accesskey="5" label="Tab 5" hidden="true" />
- <tab id="tab_6" accesskey="6" label="Tab 6" hidden="true" />
- <tab id="tab_7" accesskey="7" label="Tab 7" hidden="true" />
- <tab id="tab_8" accesskey="8" label="Tab 8" hidden="true" />
- <tab id="tab_9" accesskey="9" label="Tab 9" hidden="true" />
- </tabs>
- <tabpanels id="main_panels" flex="1">
- <tabpanel id="panel_1"><label value="panel_1"/></tabpanel>
- <tabpanel id="panel_2"><label value="panel_2"/></tabpanel>
- <tabpanel id="panel_3"><label value="panel_3"/></tabpanel>
- <tabpanel id="panel_4"><label value="panel_4"/></tabpanel>
- <tabpanel id="panel_5"><label value="panel_5"/></tabpanel>
- <tabpanel id="panel_6"><label value="panel_6"/></tabpanel>
- <tabpanel id="panel_7"><label value="panel_7"/></tabpanel>
- <tabpanel id="panel_8"><label value="panel_8"/></tabpanel>
- <tabpanel id="panel_9"><label value="panel_9"/></tabpanel>
- </tabpanels>
- </tabbox>
- <toolbox id="entity_toolbox"/>
-</box>
-
-<!-- The main top level menubar -->
-<toolbox id="main_toolbox">
- <menubar id="main_menubar">
- <menu id="main.menu.file" />
- <menu id="main.menu.edit" />
- <menu id="main.menu.search" />
- <menu id="main.menu.circ" />
- <menu id="main.menu.cat" />
- <menu id="main.menu.serials" />
- <menu id="main.menu.acquisitions" />
- <menu id="main.menu.reports" />
- <spacer flex="1" />
- <menu id="main.menu.admin" />
- <menu id="main.menu.help" />
- </menubar>
-</toolbox>
-
-<!-- The Entity top level menubar -->
-<!--
-<toolbox id="entity_toolbox">
- <menubar id="entity_menubar">
- <menu id="patron-menu" label="&main.menu.entity.patron.label;" accesskey="&main.menu.entity.patron.key;" command="cmd_broken"/>
- <menu id="copy-menu" label="&main.menu.entity.copy.label;" accesskey="&main.menu.entity.copy.key;" command="cmd_broken"/>
- <menu id="volume-menu" label="&main.menu.entity.volume.label;" accesskey="&main.menu.entity.volume.key;" command="cmd_broken"/>
- <menu id="bib-menu" label="&main.menu.entity.bib.label;" accesskey="&main.menu.entity.bib.key;" command="cmd_broken"/>
- </menubar>
-</toolbox>
--->
-
-<!-- The Patron menu on the Entity menubar -->
-<!--
-<menu id="patron-menu">
- <menupopup id="patron-popup">
- <menuitem label="&main.menu.circ.patron_registration.label;" accesskey="&main.menu.entity.patron.register.key;" command="cmd_patron_register"/>
- <menuitem label="stub" />
- <menuitem label="stub" />
- </menupopup>
-</menu>
--->
-
-<!-- The Items menu on the Entity menubar -->
-<!--
-<menu id="copy-menu">
- <menupopup id="copy-popup">
- <menuitem label="stub" />
- <menuitem label="stub" />
- <menuitem label="stub" />
- </menupopup>
-</menu>
--->
-
-<!-- The Volumes menu on the Entity menubar -->
-<!--
-<menu id="volume-menu">
- <menupopup id="volume-popup">
- <menuitem label="stub" />
- <menuitem label="stub" />
- <menuitem label="stub" />
- </menupopup>
-</menu>
--->
-
-<!-- The Bib Records menu on the Entity menubar -->
-<!--
-<menu id="bib-menu">
- <menupopup id="bib-popup">
- <menuitem label="stub" />
- <menuitem label="stub" />
- <menuitem label="stub" />
- </menupopup>
-</menu>
--->
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="AppShell_keys">
- <key id="new-window-key" modifiers="accel" key="N" command="cmd_new_window"/>
- <key id="new-tab-key" modifiers="accel" key="T" command="cmd_new_tab"/>
- <key id="open-key" modifiers="accel" key="O" command=""/>
- <key id="save-key" modifiers="accel" key="S" command=""/>
- <key id="close-tab-key" modifiers="accel" key="W" command="cmd_close_tab"/>
- <key id="close-window-key" modifiers="accel" key="Q" command="cmd_close_window"/>
- <!--
- <key id="edit-undo-key" modifiers="accel" key="Z" command=""/>
- <key id="edit-redo-key" modifiers="accel" key="Y" command=""/>
- <key id="edit-cut-key" modifiers="accel" key="X" command=""/>
- <key id="edit-copy-key" modifiers="accel" key="C" command=""/>
- <key id="edit-paste-key" modifiers="accel" key="V" command=""/>
- <key id="edit-delete-key" modifiers="" keycode="VK_DELETE" command=""/>
- <key id="edit-select-all-key" modifiers="accel" key="A" command=""/>
- <key id="edit-find-key" modifiers="accel" key="F" command=""/>
- <key id="edit-find-again-key" modifiers="accel" key="G" command=""/>
-
- <key id="circ-patron-status-key" keycode="VK_F11" command="cmd_circ_display"/>
- <key id="circ-copy-status-key" keycode="VK_F9" command=""/>
- <key id="circ-check-in-key" keycode="VK_F2" command="cmd_circ_checkin"/>
- <key id="circ-renew-key" keycode="VK_F3" command=""/>
- <key id="circ-mark-used-key" keycode="VK_F4" command=""/>
- <key id="circ-place-hold-key" keycode="VK_F5" command=""/>
- <key id="circ-patron-registration-key" keycode="VK_F12" command=""/>
- -->
- <key id="circ-checkout-key" keycode="VK_F1" command="cmd_circ_checkout"/>
- <key id="circ-checkin-key" keycode="VK_F2" command="cmd_circ_checkin"/>
- <key id="search-opac-key" keycode="VK_F3" command="cmd_search_opac"/>
- <key id="patron-search-key" keycode="VK_F4" command="cmd_patron_search"/>
- <key id="circ-hold-capture-key" keycode="VK_F5" command="cmd_circ_hold_capture"/>
- <key id="patron-register-key" keycode="VK_F12" command="cmd_patron_registration"/>
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading clam_shell.js\n');
-
-function clam_shell_init(p) {
- sdump('D_CLAM',"TESTING: clam_shell.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- if (p) {
- // This code breaks the splitter, so don't use
- if (p.horizontal) {
- sdump('D_CLAM','Setting horizontal\n');
- p.node.orient = 'horizontal';
- } else if (p.vertical) {
- sdump('D_CLAM','Setting vertical\n');
- p.node.orient = 'vertical';
- }
-
- p.splitter_node = p.node.childNodes[1];
- if (p.hide_splitter) {
- sdump('D_CLAM','Hiding splitter\n');
- p.splitter_node.hidden = true;
- } else {
- sdump('D_CLAM','Showing splitter\n');
- p.splitter_node.hidden = false;
- }
-
- }
-
- p.first_deck = p.node.firstChild;
- p.second_deck = p.node.lastChild;
-
- p.get_card_in_first_deck = function (idx) {
- if (idx)
- return first_deck.childNodes[ idx ];
- else
- return first_deck.selectedPanel;
- }
-
- p.get_card_in_second_deck = function (idx) {
- if (idx)
- return second_deck.childNodes[ idx ];
- else
- return second_deck.selectedPanel;
- }
-
- p.set_first_deck = function (idx) { return p.first_deck.selectedIndex = idx; };
-
- p.set_second_deck = function (idx) { return p.second_deck.selectedIndex = idx; };
-
- p.replace_card_in_first_deck = function (idx,chrome,params) {
- return replace_card_in_deck(p.first_deck,idx,chrome,params);
- };
-
- p.replace_card_in_second_deck = function (idx,chrome,params) {
- return replace_card_in_deck(p.second_deck,idx,chrome,params);
- };
-
- p.new_card_in_first_deck = function (chrome,params) {
- return new_card_in_deck(p.first_deck,chrome,params);
- };
- p.new_card_in_second_deck = function (chrome,params) {
- return new_card_in_deck(p.second_deck,chrome,params);
- };
-
- return p;
-}
-
-function new_card_in_deck(deck,chrome,params) {
- sdump('D_CLAM',arg_dump(arguments));
- var new_card = deck.ownerDocument.createElement('iframe');
- deck.appendChild(new_card);
- new_card.setAttribute('flex','1');
- new_card.setAttribute('src',chrome);
- new_card.setAttribute('id','card_'+(deck.childNodes.length-1));
- new_card.contentWindow.mw = mw;
- return new_card.contentWindow;
-}
-
-function replace_card_in_deck(deck,idx,chrome,params) {
- sdump('D_CLAM',arg_dump(arguments));
- var old_card = deck.childNodes[ idx ];
- var new_card = deck.ownerDocument.createElement('iframe');
- new_card.setAttribute('flex','1');
- new_card.setAttribute('src',chrome);
- deck.appendChild(new_card);
- deck.replaceChild(new_card,old_card);
- new_card.setAttribute('id','card_'+idx);
- new_card.contentWindow.mw = mw;
- if (params)
- new_card.contentWindow.params = params;
- return new_card.contentWindow;
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-
-<page id="clam_shell_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="params.node = document.getElementById('ClamShell_main');
- params.w = window;
- params.app = 'ClamShell';
- mw.OpenILS_init(params);"
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading clam_shell.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/clam_shell.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="ClamShell_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="ClamShell_main" />
-
- <popupset id="universal_popupset" />
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-<overlay id="clam_shell_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading clam_shell_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for clam_shell -->
-<box id="ClamShell_main" flex="1" orient="horizontal">
- <deck id="ClamShell_first_deck" flex="1"/>
- <splitter id="ClamShell_splitter" />
- <deck id="ClamShell_second_deck" flex="4"/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="ClamShell_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-
-<page id="clam_shell_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="params.clamshell = 'ClamShell_main';
- params.splitter = 'ClamShell_splitter';
- params.w = window;
- params.app = 'ClamShell';
- mw.OpenILS_init(params);"
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading clam_shell_vertical.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/clam_shell.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_vertical_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="ClamShell_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="ClamShell_main" />
-
- <popupset id="universal_popupset" />
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-<overlay id="clam_shell_vertical_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading clam_shell_vertical_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for clam_shell -->
-<box id="ClamShell_main" flex="1" orient="vertical">
- <deck id="ClamShell_first_deck" flex="1"/>
- <splitter id="ClamShell_splitter" />
- <deck id="ClamShell_second_deck" flex="4"/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="ClamShell_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading grid_list.js\n');
-
-function grid_list_init(p) {
- sdump('D_GRID_LIST',"TESTING: grid_list.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.grid = p.node.getElementsByAttribute('name','grid')[0];
- //p.popup = p.node.getElementsByTagName('popup')[0];
- p.grid_columns = p.grid.firstChild;
- p.grid_rows = p.grid.lastChild;
-
- p._context_function = function (ev) { alert('default _context_function'); };
- //p.popup.addEventListener('popupshowing',function (ev) { return p._context_function(ev); },false);
-
- grid_list_make_columns( p, p.cols )
-
- p.clear_grid = function () {
- sdump('D_GRID_LIST','p.clear_grid()\n');
- while( p.grid_rows.childNodes.length > 1 ) {
- p.grid_rows.removeChild( p.grid_rows.lastChild );
- }
- }
-
- p.add_rows = function (new_rows) {
- sdump('D_GRID_LIST','p.add_rows()\n');
- return grid_list_add_rows(p,new_rows);
- }
-
- p.remove_row_by_id = function (id) {
- sdump('D_GRID_LIST','p.remove_row_by_id()\n');
- return grid_list_remove_row_by_id(p,id);
- }
-
- p.register_context_builder = function (f) {
- sdump('D_GRID_LIST','p.register_context_builder(' + f + ')\n');
- return p._context_function = f;
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function grid_list_make_columns( p, cols ) {
- sdump('D_GRID_LIST',arg_dump(arguments,{2:'.length'}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var d = p.w.document;
- // cols[ idx ] = { 'id':???, 'label':???, 'primary':???, 'flex':??? }
- var header = p.w.document.createElement('row');
- p.grid_rows.appendChild( header );
- for (var i = 0; i < cols.length; i++) {
- var col = cols[i];
- sdump('D_GRID_LIST','Col ' + i + ' : ' + js2JSON( col ) + '\n');
- var gridcol = d.createElement( 'column' );
- p.grid_columns.appendChild( gridcol );
- for (var j in col) {
- gridcol.setAttribute( j, col[j] );
- }
- var th = p.w.document.createElement('label');
- header.appendChild( th );
- th.setAttribute('value', col.label);
- th.setAttribute('style','font-weight: bold;');
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function grid_list_add_rows( p, new_rows ) {
- sdump('D_GRID_LIST',arg_dump(arguments,{2:'.length'}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- for (var i = 0; i < new_rows.length; i++) {
- var new_row = new_rows[i];
-
- p.grid_rows.appendChild( new_row );
-
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function grid_list_remove_row_by_id( p, id ) {
- sdump('D_GRID_LIST',arg_dump(arguments));
- var row = p.grid_rows.getElementsByAttribute('id',id)[0];
- p.grid_rows.removeChild( row );
-}
+++ /dev/null
-<?xml version="1.0"?>
-<overlay id="grid_list_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading grid_list_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for grid_list -->
-<box id="GridList_main" flex="1" orient="vertical">
- <popupset>
- <popup id="GridList_popup"/>
- </popupset>
- <hbox id="GridList_insert1" />
- <hbox id="GridList_nav" name="nav"/>
- <hbox id="GridList_insert2" />
- <grid id="GridList_grid" flex="1" name="grid">
- <columns id="GridList_columns" />
- <rows id="GridList_rows" />
- </grid>
- <hbox id="GridList_insert3" />
-</box>
-
-<!-- Context menus -->
-<popupset id="universal_popupset">
-</popupset>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="GridList_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading list_box.js\n');
-
-function list_box_init( p ) {
- sdump('D_LIST_BOX',"TESTING: list_box.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.listbox = p.w.document.createElement('listbox');
- p.node.appendChild( p.listbox );
- p.listbox.setAttribute('flex','1');
- p.listbox.setAttribute('seltype','multiple');
-
- var listhead = p.w.document.createElement('listhead');
- p.listbox.appendChild( listhead );
-
- var listcols = p.w.document.createElement('listcols');
- p.listbox.appendChild( listcols );
-
- /*if (window.navigator.userAgent.match( /Firefox/ ))*/ {
- //sdump('D_FIREFOX','Kludge: Adding extra listheader and listcol\n');
- var listheader = p.w.document.createElement('listheader');
- listhead.appendChild( listheader );
- listheader.setAttribute('label', '');
- var listcol = p.w.document.createElement('listcol');
- listcols.appendChild( listcol );
- }
-
- for (var i = 0; i < p.cols.length; i++ ) {
-
- var listheader = p.w.document.createElement('listheader');
- listhead.appendChild( listheader );
- listheader.setAttribute('label', p.cols[i].label);
-
- var listcol = p.w.document.createElement('listcol');
- listcols.appendChild( listcol );
- listcol.setAttribute('flex', p.cols[i].flex);
- }
-
- p.add_row = function (cols, params) {
-
- var listitem = p.w.document.createElement('listitem');
- p.listbox.appendChild( listitem );
- listitem.setAttribute('allowevents','true');
- listitem.setAttribute('style','border-bottom: black solid thin');
- for (var i in params) {
- listitem.setAttribute( i, params[i] );
- }
-
- /* if (window.navigator.userAgent.match( /Firefox/ )) */ {
- //sdump('D_FIREFOX','Kludge: Setting label on listitem\n');
- listitem.setAttribute('label',' ');
- }
-
- for (var i = 0; i < cols.length; i++) {
-
- try {
- listitem.appendChild( cols[i] );
- } catch(E) {
- sdump('D_ERROR', cols[i] + '\n' + E + '\n');
- }
- }
-
- return listitem;
- }
-
- p.clear_rows = function () {
- var count = p.listbox.getRowCount();
- for (var i = 0; i < count; i++) {
- p.listbox.removeChild( p.listbox.lastChild );
- }
- }
-
- return p;
-}
-
+++ /dev/null
-sdump('D_TRACE','Loading paged_tree.js\n');
-
-function paged_tree_init(p) {
- sdump('D_PAGED_TREE',"TESTING: paged_tree.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.current_idx = 0;
-
- p.tree = p.node.getElementsByAttribute('name','tree')[0];
- p.popup = p.node.getElementsByTagName('popup')[0];
- p.treecols = p.tree.firstChild;
- p.tc = p.tree.lastChild;
-
- p._context_function = function (ev) { alert('default _context_function'); };
- p.popup.addEventListener('popupshowing',function (ev) { return p._context_function(ev); },false);
-
- p._select_callback = function (ev) { alert('default _select_callback'); };
- p.tree.addEventListener('select',function (ev) { return p._select_callback(ev); },false);
-
- paged_tree_make_columns( p, p.treecols, p.cols )
-
- p.clear_tree = function () {
- sdump('D_PAGED_TREE','p.clear_tree()\n');
- empty_widget( p.w.document, p.tc );
- p.current_idx = 0;
- return paged_tree_update_nav(p);
- }
-
- p.add_rows = function (ids) {
- sdump('D_PAGED_TREE','p.add_rows()\n');
- return paged_tree_add_rows(p,p.tc,ids);
- }
-
- p.register_flesh_row_function = function (f) {
- sdump('D_PAGED_TREE','p.register_flesh_row_function(' + f + ')\n');
- return p._flesh_row_function = f;
- }
-
- p.register_select_callback = function (f) {
- sdump('D_PAGED_TREE','p.register_select_callback(' + f + ')\n');
- return p._select_callback = f;
- }
-
- p.register_context_builder = function (f) {
- sdump('D_PAGED_TREE','p.register_context_builder(' + f + ')\n');
- return p._context_function = f;
- }
-
- p.map_cols_to_treeitem = map_array_to_treecells_via_treeitem;
-
- p.nav_bar = p.node.getElementsByAttribute('name','nav')[0];
- if (p.hide_nav) p.nav_bar.hidden = p.hide_nav;
-
- p.results_label = p.nav_bar.getElementsByAttribute('name','label_results')[0];
- p.range_label = p.nav_bar.getElementsByAttribute('name','label_range')[0];
-
- p.hits_per_page_menu = p.nav_bar.getElementsByAttribute('name','hits_per_page')[0];
- if (p.hits_per_page) {
- p.display_count = parseInt( p.hits_per_page );
- } else {
- p.display_count = parseInt( p.hits_per_page_menu.getAttribute('value') );
- }
-
- p.set_hits_per_page = function (ev) {
- try {
- p.display_count = parseInt( p.hits_per_page_menu.getAttribute('value') );
- paged_tree_update_visibility( p );
- paged_tree_update_nav( p );
- paged_tree_flesh_records( p );
- } catch(E) {
- sdump('D_ERROR',js2JSON(E)+'\n');
- }
- }
- p.hits_per_page_menu.addEventListener(
- 'command',
- p.set_hits_per_page,
- false
- );
-
-
- p.next_button = p.nav_bar.getElementsByAttribute('name','button_next')[0];
- p.next_button.addEventListener(
- 'command',
- function (ev) {
- var backup_select_callback = p._select_callback;
- p._select_callback = function (ev) {};
- var result = paged_tree_nav_next(p);
- p._select_callback = backup_select_callback;
- return result;
- },
- false
- );
-
- p.prev_button = p.nav_bar.getElementsByAttribute('name','button_prev')[0];
- p.prev_button.addEventListener(
- 'command',
- function (ev) {
- var backup_select_callback = p._select_callback;
- p._select_callback = function (ev) {};
- var result = paged_tree_nav_prev(p);
- p._select_callback = backup_select_callback;
- return result;
- },
- false
- );
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function paged_tree_make_columns( p, treecols, cols ) {
- sdump('D_PAGED_TREE',arg_dump(arguments,{2:'.length'}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var d = p.w.document;
- // cols[ idx ] = { 'id':???, 'label':???, 'primary':???, 'flex':??? }
- for (var i = 0; i < cols.length; i++) {
- var col = cols[i];
- sdump('D_PAGED_TREE','Col ' + i + ' : ' + js2JSON( col ) + '\n');
- var treecol = d.createElement( 'treecol' );
- treecols.appendChild( treecol );
- for (var j in col) {
- treecol.setAttribute( j, col[j] );
- }
- var splitter = d.createElement( 'splitter' );
- treecols.appendChild(splitter);
- splitter.setAttribute('class','tree-splitter');
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return treecols;
-}
-
-function paged_tree_add_rows( p, tc, ids ) {
- sdump('D_PAGED_TREE',arg_dump(arguments,{2:'.length'}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var d = p.w.document;
- var offset = 0;
- if (tc.childNodes.length > 0) { offset = tc.lastChild.id; }
- for (var i = 0; i < ids.length; i++) {
- var id = ids[i];
-
- var treeitem = d.createElement( 'treeitem' );
- treeitem.setAttribute( 'id', i+offset+1 );
- treeitem.setAttribute( 'record_id', id );
- treeitem.setAttribute( 'retrieved', 'false' );
- if ( (i+offset) < (p.display_count + p.current_idx) ) {
- treeitem.setAttribute( 'hidden', 'false' );
- } else {
- treeitem.setAttribute( 'hidden', 'true' );
- }
- tc.appendChild( treeitem );
-
- var treerow = d.createElement( 'treerow' );
- treeitem.appendChild( treerow );
-
- for (var j = 0; j < p.treecols.childNodes.length; j++) {
- var treecell = d.createElement( 'treecell' );
- if (j == 0)
- treecell.setAttribute('label', getString('retrieving.record') );
- else
- treecell.setAttribute('label', '' );
- treerow.appendChild( treecell );
- }
- }
- paged_tree_update_visibility( p );
- paged_tree_update_nav( p );
- paged_tree_flesh_records( p );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_flesh_record(p,treeitem) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- treeitem.setAttribute('retrieved','true');
- if (p._flesh_row_function) {
- p._flesh_row_function( treeitem );
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_flesh_records(p) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- for (var i = 0; i < p.tc.childNodes.length; i++) {
- var treeitem = p.tc.childNodes[i];
- if ( (treeitem.hidden == false) && (treeitem.getAttribute('retrieved')=='false') ) {
- paged_tree_flesh_record(p,treeitem);
- }
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_update_nav(p) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- if (p.results_label)
- p.results_label.setAttribute('value', p.tc.childNodes.length );
-
- var min = p.current_idx + 1;
- var max = p.current_idx + p.display_count;
- if (max > p.tc.childNodes.length)
- max = p.tc.childNodes.length;
- if (p.range_label) {
- if (max > 0)
- p.range_label.setAttribute('value', min + ' - ' + max );
- else
- p.range_label.setAttribute('value', '0 - 0' );
- }
-
- if (p.next_button) {
- if (max < p.tc.childNodes.length)
- p.next_button.disabled = false;
- else
- p.next_button.disabled = true;
- }
-
- if (p.prev_button) {
- if (min == 1)
- p.prev_button.disabled = true;
- else
- p.prev_button.disabled = false;
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_update_visibility(p) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- for (var i = 0; i < p.tc.childNodes.length; i++) {
- var treeitem = p.tc.childNodes[i];
- if ( (i >= p.current_idx) && (i < (p.current_idx+p.display_count)) )
- treeitem.hidden = false;
- else
- treeitem.hidden = true;
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_nav_next(p) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var proposed_idx = p.current_idx + p.display_count;
- if (proposed_idx >= p.tc.childNodes.length)
- proposed_idx = p.tc.childNodes.length - 1;
- p.current_idx = proposed_idx;
- paged_tree_update_visibility(p);
- paged_tree_update_nav(p);
- paged_tree_flesh_records(p);
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_nav_prev(p) {
- sdump('D_PAGED_TREE',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var proposed_idx = p.current_idx - p.display_count;
- if (proposed_idx < 0)
- proposed_idx = 0;
- p.current_idx = proposed_idx;
- paged_tree_update_visibility(p);
- paged_tree_update_nav(p);
- paged_tree_flesh_records(p);
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/paged_tree.dtd">
-<overlay id="paged_tree_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading paged_tree_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for paged_tree -->
-<box id="PagedTree_main" flex="1" orient="vertical">
- <popupset>
- <popup id="PagedTree_popup"/>
- </popupset>
- <hbox id="PagedTree_insert1" />
- <hbox id="PagedTree_nav" name="nav"/>
- <hbox id="PagedTree_insert2" />
- <tree id="PagedTree_tree" flex="1" enableColumnDrag="true" name="tree">
- <treecols id="PagedTree_columns"/>
- <treechildren id="PagedTree_children" context="PagedTree_popup"/>
- </tree>
- <hbox id="PagedTree_insert3" />
-</box>
-
-<hbox id="PagedTree_nav">
- <label value="&displaying.results;"/>
- <label id="PagedTree_label_range" value="??? - ???" name="label_range"/>
- <label value="&displaying.of;"/>
- <label id="PagedTree_label_results" value="???" name="label_results"/>
- <spacer flex="1"/>
- <label id="ptnl1" value="&displaying.hits_per_page;"/>
- <menulist id="PagedTree_menulist_hits_per_page" name="hits_per_page">
- <menupopup id="ptnmp">
- <menuitem id="ptnm0" label="10" value="10" />
- <menuitem id="ptnm1" label="20" value="20" selected="true" />
- <menuitem id="ptnm2" label="30" value="30" />
- <menuitem id="ptnm3" label="40" value="40" />
- <menuitem id="ptnm4" label="50" value="50" />
- <menuitem id="ptnm5" label="60" value="60" />
- <menuitem id="ptnm6" label="70" value="70" />
- <menuitem id="ptnm7" label="80" value="80" />
- <menuitem id="ptnm8" label="90" value="90" />
- <menuitem id="ptnm9" label="100" value="100" />
- </menupopup>
- </menulist>
- <button id="PagedTree_button_prev" label="&previous.range;" accesskey="&previous.range.key;" disabled="true" name="button_prev"/>
- <button id="PagedTree_button_next" label="&next.range;" accesskey="&next.range.key;" disabled="true" name="button_next"/>
-</hbox>
-
-<!-- Context menus -->
-<popupset id="universal_popupset">
-</popupset>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PagedTree_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_OPAC','Loading opac.js\n');
-
-var OPAC_URL = "http://dev.gapines.org/"
-
-/* listen for page changes */
-
-function buildProgressListener(p) {
- sdump('D_OPAC',arg_dump(arguments));
- var progressListener = {
- onProgressChange : function(){},
- onLocationChange : function(){},
- onStatusChange : function(){},
- onSecurityChange : function(){},
- onStateChange : function ( webProgress, request, stateFlags, status) {
- const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
- const nsIChannel = Components.interfaces.nsIChannel;
- if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
- dump('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
- if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
- dump('\tSTATE_IS_REQUEST\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) {
- dump('\tSTATE_IS_DOCUMENT\n');
- if( stateFlags & nsIWebProgressListener.STATE_STOP ) set_opac_vars(p);
- }
- if (stateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
- dump('\tSTATE_IS_NETWORK\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_IS_WINDOW) {
- dump('\tSTATE_IS_WINDOW\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_START) {
- dump('\tSTATE_START\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_REDIRECTING) {
- dump('\tSTATE_REDIRECTING\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_TRANSFERING) {
- dump('\tSTATE_TRANSFERING\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_NEGOTIATING) {
- dump('\tSTATE_NEGOTIATING\n');
- }
- if (stateFlags & nsIWebProgressListener.STATE_STOP) {
- dump('\tSTATE_STOP\n');
- }
- }
- }
- progressListener.QueryInterface = function(){return this;};
- return progressListener;
-}
-
-/* init the opac */
-function opac_init(p) {
- sdump('D_OPAC',"Initing OPAC\n");
-
- p.opac_progressListener = buildProgressListener(p);
-
- p.opac_iframe = p.w.document.getElementById('opac_opac_iframe');
- p.opac_iframe.addProgressListener(p.opac_progressListener,
- Components.interfaces.nsIWebProgress.NOTIFY_ALL );
- p.opac_iframe.setAttribute("src", OPAC_URL + '?location=' + mw.G.user.home_ou())
-}
-
-/* shoves data into the OPAC's space */
-function set_opac_vars(p) {
- sdump('D_OPAC',arg_dump(arguments));
- p.opac_iframe.contentWindow.IAMXUL = true;
- p.opac_iframe.contentWindow.xulG = mw.G;
- p.opac_iframe.contentWindow.attachEvt("rdetail", "recordRetrieved",
- function(id){opac_make_details_page(p,id)});
- p.opac_iframe.removeProgressListener(p.opac_progressListener);
- p.opac_iframe.addProgressListener(p.opac_progressListener,
- Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT );
-
-}
-
-function opac_make_details_page(p, id) {
- sdump('D_OPAC',arg_dump(arguments));
- dump("OPAC doc id is " + id +'\n');
- spawn_record_details(
- p.w.app_shell, 'new_tab', 'main_tabbox', {
- 'find_this_id' : id
- }
- ).find_this_id = id;
-}
-
-/* --------------------------------------------------------------------------
- back-forward
- -------------------------------------------------------------------------- */
-function opac_build_navigation(p) {
- p.webForward = function webForward() {
- try {
- if(p.opac_iframe.webNavigation.canGoForward)
- p.opac_iframe.webNavigation.goForward();
- } catch(E) {
- sdump('D_OPAC','goForward error: ' + js2JSON(E) + '\n');
- }
- }
-
- p.webBack = function webBack() {
- try {
- if(p.opac_iframe.webNavigation.canGoBack)
- p.opac_iframe.webNavigation.goBack();
- } catch(E) {
- sdump('D_OPAC','goBack error: ' + js2JSON(E) + '\n');
- }
- }
-}
-
-
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<page id="opac_win" orient="vertical" style="overflow: auto;" persist="width height"
- onload="try {
- params.w = window;
- params.app = 'Opac';
- mw.OpenILS_init(params);
- } catch(E) {
- alert(E);
- }"
- onunload="try { mw.OpenILS_exit(params); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/opac.css" type="text/css"?>
-
- <vbox id="opac_vbox" flex="1">
- <browser id="opac_opac_iframe" flex="1"/>
- </vbox>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="patron_barcode_entry_win"
- onload="try { my_init(); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_barcode_entry.xul\n');</script>
-
- <script>
- <![CDATA[
-
- function my_init() {
- var tb = document.getElementById('barcode_tb');
- tb.addEventListener(
- 'keypress',
- function(ev) {
- if (ev.keyCode == 13 || ev.keyCode == 77) {
- spawn();
- }
- },
- false
- );
- tb.focus();
- }
-
- function spawn() {
- var tb = document.getElementById('barcode_tb');
- var barcode = tb.value;
- var patron = mw.retrieve_patron_by_barcode( barcode );
- if (mw.instanceOf(patron,mw.au)) {
- mw.spawn_patron_display(
- parent.document,
- 'replace_tab', 'main_tabbox', { 'patron' : patron }
- );
- } else {
- mw.snd_bad();
- var label = document.getElementById('status');
- label.value = 'Patron not found.';
- tb.select(); tb.focus();
- }
- }
-
- ]]>
- </script>
-
- <vbox flex="1" class="my_overflow">
- <groupbox orient="vertical" flex="1">
- <caption label="Enter Patron Barcode" />
- <hbox>
- <label value="Patron Barcode:" accesskey="B" control="barcode_tb"/>
- <textbox id="barcode_tb" />
- <button label="Submit" accesskey="S" oncommand="spawn();"/>
- </hbox>
- <hbox>
- <label id="status"/>
- </hbox>
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/patron.dtd">
-<window id="patron_bill_details"
- onload="try { my_init(); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
- <script src="patron_utils.js" />
-
- <script>
- <![CDATA[
-
- function my_init() {
- try {
-
- var mb_list = user_request(
- 'open-ils.circ',
- 'open-ils.circ.money.billing.retrieve.all',
- [ mw.G.auth_ses[0], params.mbts.id() ]
- )[0];
-
- var rows = document.getElementById('g_rows');
- for (var i = 0; i < mb_list.length; i++) {
-
- var row = document.createElement('row');
- rows.appendChild(row);
-
- var c1 = document.createElement('label');
- row.appendChild(c1);
- c1.setAttribute('value', yesno( mb_list[0].voided() ));
-
- var c2 = document.createElement('label');
- row.appendChild(c2);
- c2.setAttribute('value', formatted_date( mb_list[0].billing_ts(),'%F' ));
-
- var c3 = document.createElement('label');
- row.appendChild(c3);
- c3.setAttribute('value', mb_list[0].billing_type());
-
- var c4 = document.createElement('label');
- row.appendChild(c4);
- c4.setAttribute('value', mb_list[0].amount());
-
- var c5 = document.createElement('label');
- row.appendChild(c5);
- c5.setAttribute('value', mb_list[0].note());
- }
-
- } catch(E) {
- handle_error(E);
- }
- }
-
- ]]>
- </script>
-
- <vbox flex="1" class="my_overflow">
- <groupbox orient="vertical" flex="1">
- <caption label="Full Details"/>
- <grid>
- <columns> <column /> <column /> <column /> <column /> </columns>
- <rows id="g_rows">
- <row><label value="Voided" /><label value="When"/><label value="Type" /><label value="Amount" /><label value="Note"/></row>
- </rows>
- </grid>
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/patron.dtd">
-<wizard id="patron_bill" title="Bill Patron Wizard"
- orient="vertical" style="overflow: auto"
- onload="patron_bill_init()" width="800" height="600"
- onwizardfinish="patron_bill_finish()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
- <script src="patron_utils.js" />
-
- <script>
- <![CDATA[
-
- function patron_bill_init() {
- document.getElementById('patron_name').setAttribute('value',
- patron_get_full_name(params.patron) + ' : ' + patron_get_barcode(params.patron) );
- document.getElementById('billing_location').setAttribute('value',
- mw.G.user_ou.name() );
- }
-
- function patron_bill_finish() {
- try {
- var grocery = new mg();
- grocery.isnew('1');
- grocery.billing_location( mw.G.user_ou.id() );
- grocery.usr( params.patron.id() );
- grocery.note( document.getElementById('bill_note').value );
- var mg_id = user_request(
- 'open-ils.circ',
- 'open-ils.circ.money.grocery.create',
- [ mw.G.auth_ses[0], grocery ]
- )[0];
- if (mg_id) {
- var billing = new mb();
- billing.isnew('1');
- billing.note( document.getElementById('bill_note').value );
- billing.xact( mg_id );
- billing.amount( document.getElementById('bill_amount').value );
- billing.billing_type( document.getElementById('billing_type').value );
- var mb_id = user_request(
- 'open-ils.circ',
- 'open-ils.circ.money.billing.create',
- [ mw.G.auth_ses[0], billing ]
- )[0];
- if (mb_id) {
- } else {
- throw('mb_id = ' + mb_id);
- }
- } else {
- throw('mg_id = ' + mg_id);
- }
- } catch(E) {
- handle_error(E);
- }
- }
-
- ]]>
- </script>
-
-
- <wizardpage id="page1" description="Billing Patron" onpageadvanced="">
- <label id="patron_name"/>
- <grid>
- <columns> <column flex="0" /> <column flex="0" /> </columns>
- <rows id="page1_rows">
- <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
- <row><label value="Transaction Type"/>
- <menulist id="xact_type">
- <menupopup>
- <menuitem label="Grocery" value="grocery" selected="true"/>
- </menupopup>
- </menulist>
- </row>
- <row><label value="Billing Type"/>
- <menulist id="billing_type">
- <menupopup>
- <menuitem value="Miscellaneous" label="Miscellaneous" />
- <menuitem value="Overdue materials" label="Overdue materials" />
- <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
- <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
- <menuitem value="Fee for library card" label="Fee for library card" />
- <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
- <menuitem value="Lost materials" label="Lost materials" />
- <menuitem value="Damaged material" label="Damaged material" />
- <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
- <menuitem value="Recall overdue" label="Recall overdue" />
- <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
- <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
- <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
- <menuitem value="Fee for copies" label="Fee for copies" />
- <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
- <menuitem value="Deposit fee" label="Deposit fee" />
- <menuitem value="Fee for disk" label="Fee for disk" />
- <menuitem value="Fee for faxing" label="Fee for faxing" />
- <menuitem value="Fee for laminating" label="Fee for laminating" />
- <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
- <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
- <menuitem value="Sale items" label="Sale items" />
- <menuitem value="Fee for lost card" label="Fee for lost card" />
- <menuitem value="Long overdue items" label="Long overdue items" />
- <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
- <menuitem value="Returned Check" label="Returned Check" />
- </menupopup>
- </menulist>
- </row>
- <row><label value="Amount"/><textbox id="bill_amount" /></row>
- <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
- </rows>
- </grid>
- </wizardpage>
-
-</wizard>
-
-
+++ /dev/null
-sdump('D_TRACE','Loading patron_bills.js\n');
-
-function patron_bills_init(p) {
- sdump('D_PATRON_BILLS',"TESTING: patron_bills.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- patron_bills_list_box_init( p );
-
- patron_bills_control_box_init( p );
-
- p.current_payments = [];
-
- p.update_payment_applied = function () {
- sdump('D_PATRON_BILLS','p.update_payment_applied()\n');
- var total_applied = 0;
- for (var i = 0; i < p.current_payments.length; i++) {
- total_applied += dollars_float_to_cents_integer( p.current_payments[ i ].textbox.value );
- }
- var total_payment = 0;
- if (p.control_box.bill_payment_amount.value) {
- try {
- total_payment = dollars_float_to_cents_integer( p.control_box.bill_payment_amount.value );
- } catch(E) {
- sdump('D_ERROR',E + '\n');
- }
- }
- if ( total_applied > total_payment ) {
- total_payment = total_applied;
- p.control_box.bill_payment_amount.value = cents_as_dollars( total_applied );
- }
- p.control_box.bill_payment_applied.setAttribute('value', cents_as_dollars( total_applied ));
- p.control_box.bill_payment_applied.value = cents_as_dollars( total_applied );
- p.control_box.bill_credit_amount.value = '';
- if (total_payment > total_applied ) {
- p.control_box.bill_change_amount.value = cents_as_dollars( total_payment - total_applied);
- p.control_box.bill_credit_amount.value = '0.00';
- } else {
- p.control_box.bill_change_amount.value = '0.00';
- p.control_box.bill_credit_amount.value = '0.00';
- }
- var total_owed = dollars_float_to_cents_integer( p.control_box.bill_total_owed.value );
- p.control_box.bill_new_balance.value = cents_as_dollars( total_owed - total_applied );
- }
-
- p.list_box.apply_to_each_listitem = function (idx, listitem) {
- sdump('D_PATRON_BILLS','p.list_box.apply_to_each_listitem()\n');
- p.current_payments[ idx ] = {};
- p.current_payments[ idx ].listitem = listitem;
- p.current_payments[ idx ].checkbox = listitem.getElementsByTagName('checkbox')[0];
- p.current_payments[ idx ].textbox = listitem.getElementsByTagName('textbox')[0];
- p.current_payments[ idx ].mbts_id = listitem.getAttribute('record_id');
- p.current_payments[ idx ].balance_owed = listitem.getAttribute('balance_owed');
-
- p.current_payments[ idx ].textbox.addEventListener(
- 'change',
- function () {
- sdump('D_PATRON_BILLS','listitem textbox onchange handler()\n');
- var tb = p.current_payments[ idx ].textbox;
- var bo = p.current_payments[ idx ].balance_owed;
- tb.value = cents_as_dollars( dollars_float_to_cents_integer( tb.value ) ); // show user what we think the number is
- sdump('D_PATRON_BILLS','bo = ' + bo + '\ntb.value = ' + tb.value + '\n');
- if ( dollars_float_to_cents_integer( tb.value ) > dollars_float_to_cents_integer( bo ) ) {
- sdump('D_PATRON_BILLS','Tried to overpay bill\n');
- tb.value = bo;
- }
- p.update_payment_applied();
- },
- false
- );
- }
-
- p.control_box.bill_payment_amount.addEventListener(
- 'change',
- function () {
- var tb = p.control_box.bill_payment_amount;
- tb.value = cents_as_dollars( dollars_float_to_cents_integer( tb.value ) );
- var total = dollars_float_to_cents_integer( tb.value );
- for (var i = 0; i < p.current_payments.length; i++) {
- var bill = p.current_payments[i];
- if (bill.checkbox.checked) {
- var bo = dollars_float_to_cents_integer( bill.balance_owed );
- if ( bo > total ) {
- bill.textbox.value = cents_as_dollars( total );
- total = 0;
- } else {
- bill.textbox.value = cents_as_dollars( bo );
- total = total - bo;
- }
- } else {
- bill.textbox.value = '0.00';
- }
- }
- p.update_payment_applied();
- },
- false
- );
-
- p.control_box.bill_change_amount.addEventListener(
- 'change',
- function() {
- var tb = p.control_box.bill_change_amount;
- var proposed_change = dollars_float_to_cents_integer( tb.value );
- var proposed_credit = 0;
- p.update_payment_applied();
- var real_change = dollars_float_to_cents_integer( tb.value );
- if ( proposed_change > real_change ) {
- sdump('D_ERROR','Someone wanted more money than they deserved\n');
- proposed_change = real_change;
- } else if ( real_change > proposed_change ) {
- proposed_credit = real_change - proposed_change;
- }
- tb.value = cents_as_dollars( proposed_change );
- p.control_box.bill_credit_amount.value = cents_as_dollars( proposed_credit );
- },
- false
- );
-
- p.control_box.change_to_credit.addEventListener(
- 'command',
- function() {
- var tb = p.control_box.bill_change_amount;
- var proposed_change = 0;
- var proposed_credit = dollars_float_to_cents_integer( tb.value );
- p.update_payment_applied();
- var real_change = dollars_float_to_cents_integer( tb.value );
- if ( proposed_change > real_change ) {
- sdump('D_ERROR','Someone wanted more money than they deserved\n');
- proposed_change = real_change;
- } else if ( real_change > proposed_change ) {
- proposed_credit = real_change - proposed_change;
- }
- tb.value = cents_as_dollars( proposed_change );
- p.control_box.bill_credit_amount.value = cents_as_dollars( proposed_credit );
-
- },
- false
- );
-
- p.control_box.bill_apply_payment.addEventListener(
- 'command',
- function() {
- var payment_blob = {};
- payment_blob.userid = p._patron.id();
- payment_blob.note = '';
- payment_blob.cash_drawer = 1; // FIXME: get new Config() to work
- payment_blob.payment_type = p.control_box.payment_type.value;
- payment_blob.payments = [];
- payment_blob.patron_credit = p.control_box.bill_credit_amount.value;
- for (var i = 0; i < p.current_payments.length; i++) {
- var tb = p.current_payments[ i ].textbox;
- if ( !(tb.value == '0.00' || tb.value == '') ) {
- payment_blob.payments.push(
- [
- p.current_payments[ i ].mbts_id,
- tb.value
- ]
- );
- }
- }
- try {
- if ( patron_pay_bills( payment_blob ) ) {
-
- if (p.refresh) p.refresh();
-
- }
-
- } catch(E) {
-
- handle_error(E);
- }
- },
- false
- );
-
- p.control_box.bill_wizard.addEventListener(
- 'command',
- function() {
- spawn_patron_bill_wizard(
- p.w.document, 'new_window', '', { 'patron' : p._patron }
- );
- },
- false
- );
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_bills_control_box_init( p ) {
- p.control_box = {};
- p.control_box.node = p.node.previousSibling;
- p.control_box.node2 = p.node.nextSibling;
- p.control_box.bill_wizard = p.control_box.node.getElementsByAttribute('id','bill_wizard')[0];
- p.control_box.bill_total_owed = p.control_box.node.getElementsByAttribute('id','bill_total_owed')[0];
- p.control_box.payment_type = p.control_box.node.getElementsByAttribute('id','payment_type_menulist')[0];
- p.control_box.bill_payment_amount = p.control_box.node.getElementsByAttribute('id','bill_payment_amount_textbox')[0];
- p.control_box.bill_payment_applied = p.control_box.node.getElementsByAttribute('id','bill_payment_applied_textbox')[0];
- p.control_box.bill_change_amount = p.control_box.node.getElementsByAttribute('id','bill_change_amount_textbox')[0];
- p.control_box.bill_credit_amount = p.control_box.node.getElementsByAttribute('id','bill_credit_amount_textbox')[0];
- p.control_box.change_to_credit = p.control_box.node.getElementsByAttribute('id','change_to_credit')[0];
- p.control_box.bill_apply_payment = p.control_box.node.getElementsByAttribute('id','bill_apply_payment')[0];
- p.control_box.bill_new_balance = p.control_box.node.getElementsByAttribute('id','bill_new_balance_textbox')[0];
-}
-
-function patron_bills_list_box_init( p ) {
- p.patron_bills_cols = [
- {
- 'id' : 'checkbox', 'label' : '', 'flex' : 0, 'primary' : false, 'hidden' : false,
- 'render_xul' : 'checkbox'
- },
- {
- 'id' : 'xact_dates', 'label' : getString('bills_xact_dates_label'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mbts',
- 'fm_field_render' : 'xact_dates_box($$)'
- },
- {
- 'id' : 'notes', 'label' : getString('bills_information'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mbts',
- 'fm_field_render' : 'info_box($$)'
- },
- {
- 'id' : 'money', 'label' : getString('bills_money_label'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'mbts',
- 'fm_field_render' : 'money_box($$)'
- },
- {
- 'id' : 'current_pay', 'label' : getString('bills_current_payment_label'), 'flex' : 0,
- 'render_xul' : 'textbox'
- }
- ];
-
- p.list_box = list_box_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_bills_cols, 'debug' : p.app } );
- p.clear_patron_bills = function () {
- p.current_payments = [];
- p.control_box.bill_total_owed.setAttribute('value', 'Calculating...');
- p.control_box.bill_total_owed.value = 'Calculating...';
- p.control_box.bill_payment_amount.setAttribute('value', '');
- p.control_box.bill_payment_amount.value = '';
- p.control_box.bill_payment_applied.setAttribute('value', '0.00');
- p.control_box.bill_payment_applied.value = '0.00';
- p.control_box.bill_change_amount.setAttribute('value', '0.00');
- p.control_box.bill_change_amount.value = '0.00';
- p.control_box.bill_credit_amount.setAttribute('value', '0.00');
- p.control_box.bill_credit_amount.value = '0.00';
- p.control_box.bill_new_balance.setAttribute('value', 'Calculating...');
- p.control_box.bill_new_balance.value = 'Calculating...';
- p.list_box.clear_rows();
- };
- p.add_patron_bills = function (bills) {
- sdump('D_PATRON_BILLS','p.add_patron_bills(' + bills + ')\n');
- return patron_bills_add_patron_bills(p,bills);
- }
-}
-
-function patron_bills_add_patron_bills(p, bills) {
- sdump('D_PATRON_BILLS',arg_dump(arguments,{1:true}));
-
- p.control_box.bill_total_owed.setAttribute('value',get_bills_total( bills ));
- p.control_box.bill_total_owed.value = get_bills_total( bills );
- p.control_box.bill_new_balance.setAttribute('value',get_bills_total( bills ));
- p.control_box.bill_new_balance.value = get_bills_total( bills );
-
- function xact_dates_box( mbts ) {
- var grid = p.w.document.createElement('grid');
- var cols = p.w.document.createElement('columns');
- grid.appendChild( cols );
- cols.appendChild( p.w.document.createElement('column') );
- cols.appendChild( p.w.document.createElement('column') );
- var rows = p.w.document.createElement('rows');
- grid.appendChild( rows );
- var row0 = p.w.document.createElement('row');
- rows.appendChild( row0 );
- var label_r0_1 = p.w.document.createElement('label');
- row0.appendChild( label_r0_1 );
- label_r0_1.setAttribute('value',getString('mbts_id_label'));
- var label_r0_2 = p.w.document.createElement('label');
- row0.appendChild( label_r0_2 );
- label_r0_2.setAttribute('value',mbts.id());
- var row1 = p.w.document.createElement('row');
- rows.appendChild( row1 );
- var label_r1_1 = p.w.document.createElement('label');
- row1.appendChild( label_r1_1 );
- label_r1_1.setAttribute('value',getString('mbts_xact_start_label'));
- var label_r1_2 = p.w.document.createElement('label');
- row1.appendChild( label_r1_2 );
- label_r1_2.setAttribute('value',mbts.xact_start().toString().substr(0,10));
- var row2 = p.w.document.createElement('row');
- rows.appendChild( row2 );
- var label_r2_1 = p.w.document.createElement('label');
- row2.appendChild( label_r2_1 );
- label_r2_1.setAttribute('value',getString('mbts_xact_finish_label'));
- var label_r2_2 = p.w.document.createElement('label');
- row2.appendChild( label_r2_2 );
- try { label_r2_2.setAttribute('value',mbts.xact_finish().toString().substr(0,10));
- } catch(E) {}
-
- return grid;
- }
-
- function money_box( mbts ) {
- var grid = p.w.document.createElement('grid');
- var cols = p.w.document.createElement('columns');
- grid.appendChild( cols );
- cols.appendChild( p.w.document.createElement('column') );
- cols.appendChild( p.w.document.createElement('column') );
- var rows = p.w.document.createElement('rows');
- grid.appendChild( rows );
- var row1 = p.w.document.createElement('row');
- rows.appendChild( row1 );
- var label_r1_1 = p.w.document.createElement('label');
- row1.appendChild( label_r1_1 );
- label_r1_1.setAttribute('value',getString('mbts_total_owed_label'));
- var label_r1_2 = p.w.document.createElement('label');
- row1.appendChild( label_r1_2 );
- label_r1_2.setAttribute('value',mbts.total_owed());
- var row2 = p.w.document.createElement('row');
- rows.appendChild( row2 );
- var label_r2_1 = p.w.document.createElement('label');
- row2.appendChild( label_r2_1 );
- label_r2_1.setAttribute('value',getString('mbts_total_paid_label'));
- var label_r2_2 = p.w.document.createElement('label');
- row2.appendChild( label_r2_2 );
- label_r2_2.setAttribute('value',mbts.total_paid());
- var row3 = p.w.document.createElement('row');
- rows.appendChild( row3 );
- var label_r3_1 = p.w.document.createElement('label');
- row3.appendChild( label_r3_1 );
- label_r3_1.setAttribute('value',getString('mbts_balance_owed_label'));
- label_r3_1.setAttribute('style','font-weight: bold');
- var label_r3_2 = p.w.document.createElement('label');
- row3.appendChild( label_r3_2 );
- label_r3_2.setAttribute('value',mbts.balance_owed());
- label_r3_2.setAttribute('style','font-weight: bold');
-
- return grid;
- }
-
- function info_box( mbts ) {
- var vbox = p.w.document.createElement('vbox');
- var grid = p.w.document.createElement('grid');
- vbox.appendChild( grid );
-
- var cols = p.w.document.createElement('columns');
- grid.appendChild( cols );
- cols.appendChild( p.w.document.createElement('column') );
- cols.appendChild( p.w.document.createElement('column') );
- var rows = p.w.document.createElement('rows');
- grid.appendChild( rows );
-
- var xact_type = p.w.document.createElement('row');
- rows.appendChild( xact_type );
-
- var xt_label = p.w.document.createElement('label');
- xact_type.appendChild( xt_label );
- xt_label.setAttribute( 'value', 'Type' );
- var xt_value = p.w.document.createElement('label');
- xact_type.appendChild( xt_value );
- xt_value.setAttribute( 'value', mbts.xact_type() );
-
- var last_billing = p.w.document.createElement('row');
- rows.appendChild( last_billing );
-
- var lb_label = p.w.document.createElement('label');
- last_billing.appendChild( lb_label );
- lb_label.setAttribute( 'value', 'Last Billing:' );
-
- var lb_value = p.w.document.createElement('label');
- last_billing.appendChild( lb_value );
- if (mbts.last_billing_type())
- lb_value.setAttribute( 'value', mbts.last_billing_type() );
-
- var last_payment = p.w.document.createElement('row');
- rows.appendChild( last_payment );
-
- var lp_label = p.w.document.createElement('label');
- last_payment.appendChild( lp_label );
- lp_label.setAttribute( 'value', 'Last Payment:' );
-
- var lp_value = p.w.document.createElement('label');
- last_payment.appendChild( lp_value );
- if (mbts.last_payment_type())
- lp_value.setAttribute( 'value', mbts.last_payment_type() );
-
- var btn = p.w.document.createElement('button');
- vbox.appendChild( btn );
- btn.setAttribute( 'label', 'Full Details' );
- btn.setAttribute( 'name', 'full_details' );
- btn.setAttribute( 'mbts_id', mbts.id() );
- btn.addEventListener(
- 'command',
- function(ev) {
- spawn_patron_bill_details(
- p.w.document, 'new_window', '', { 'mbts' : mbts }
- );
- },
- false
- );
-
- return vbox;
- }
-
- var obj_string ='mbts';
-
- setTimeout(
- function() {
- //p.list_box.clear_rows();
-
- for (var i = 0; i < bills.length; i++) {
-
- var mbts = bills[i];
-
- var cols = [];
-
- for (var j = 0; j < p.patron_bills_cols.length; j++) {
- var hash = p.patron_bills_cols[j];
- sdump('D_PATRON_BILLS','Considering ' + js2JSON(hash) + '\n');
- var listcell = p.w.document.createElement('listcell');
- listcell.setAttribute('pack','start');
- listcell.setAttribute('align','start');
- listcell.setAttribute('style','border-left: black solid thin');
- var col = '';
- if (hash.fm_field_render) {
-
- var obj = 'mbts';
- switch( hash.fm_class ) {
- case 'mvr' : obj_string = 'mvr'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_PATRON_BILLS','cmd = ' + cmd + '\n');
- try {
- col = eval( cmd );
- sdump('D_PATRON_BILLS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',E + '\n');
- }
- if (typeof(col) == 'string') {
- listcell.setAttribute('label',col);
- } else {
- listcell.appendChild( col );
- }
- }
- if (hash.render_xul) {
- var xul = p.w.document.createElement( hash.render_xul );
- listcell.appendChild( xul );
- if (hash.render_xul == 'checkbox') xul.setAttribute('checked', 'true');
- }
- cols.push( listcell );
- }
-
- var listitem = p.list_box.add_row(
- cols, {
- 'record_id' : mbts.id(),
- 'balance_owed' : mbts.balance_owed()
- }
- );
- if (p.list_box.apply_to_each_listitem) {
- p.list_box.apply_to_each_listitem( i, listitem );
- }
- }
- }, 0
- );
-}
+++ /dev/null
-sdump('D_TRACE','Loading patron_checkout_items.js\n');
-
-function patron_checkout_items_init(p) {
- sdump('D_PATRON_CHECKOUT_ITEMS',"TESTING: patron_checkout_items.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.patron_checkout_items_cols = circ_cols();
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_checkout_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
- p.add_checkout_items = p.paged_tree.add_rows;
- p.clear_checkout_items = p.paged_tree.clear_tree;
-
- p.register_patron_checkout_items_select_callback = function (f) {
- sdump('D_PATRON_CHECKOUT_ITEMS','p.register_patron_checkout_items_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_patron_checkout_items_function = function (f) {
- sdump('D_PATRON_CHECKOUT_ITEMS','p.register_flesh_patron_checkout_items_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_checkout_context_builder = function (f) {
- sdump('D_PATRON_CHECKOUT_ITEMS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_patron_checkout_items_to_cols = function (patron_checkout_items, treeitem) {
- sdump('D_PATRON_CHECKOUT_ITEMS','p.map_patron_checkout_items_to_cols( ' + patron_checkout_items + ',' + treeitem + ')\n');
- patron_checkout_items_tree_map_patron_checkout_items_to_cols(p, patron_checkout_items, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_checkout_items_tree_map_patron_checkout_items_to_cols(p, patron_checkout_items, treeitem) {
- sdump('D_PATRON_CHECKOUT_ITEMS',arg_dump(arguments,{1:true}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var cols = new Array();
- for (var i = 0; i < p.patron_checkout_items_cols.length; i++) {
- var hash = p.patron_checkout_items_cols[i];
- sdump('D_PATRON_CHECKOUT_ITEMS','Considering ' + js2JSON(hash) + '\n');
- var obj_string;
- switch( hash.fm_class ) {
- case 'acp' : obj_string = 'patron_checkout_items.copy'; break;
- case 'circ' : obj_string = 'patron_checkout_items.circ'; break;
- case 'mvr' : obj_string = 'patron_checkout_items.record'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_PATRON_CHECKOUT_ITEMS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_PATRON_CHECKOUT_ITEMS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_PATRON_CHECKOUT_ITEMS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-sdump('D_TRACE','Loading patron_display.js\n');
-
-function patron_display_init(p) {
- sdump('D_PATRON_DISPLAY',"TESTING: patron_display.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- // gives: p.clamshell, p.right_panel, p.left_panel
- patron_display_clamshell_init(p);
-
- // gives: p.patron_items, p.redraw_patron_items
- patron_display_patron_items_init(p);
-
- // gives: p.patron_checkout_items, p.redraw_patron_checkout_items
- patron_display_patron_checkout_items_init(p);
-
- // gives: p.patron_holds, p.redraw_patron_holds
- patron_display_patron_holds_init(p);
-
- // gives: p.patron_bills, p.redraw_patron_bills
- patron_display_patron_bills_init(p);
-
- // gives: p.patron_edit, p.redraw_patron_edit
- patron_display_patron_edit_init(p);
-
- //patron_display_survey_init(p);
-
- p.set_patron = function (au) {
- p.patron_edit._patron = au;
- p.patron_bills._patron = au;
- return p._patron = au;
- }
-
- p.display_patron = function (exceptions) {
- if (!exceptions) exceptions = {};
- if (!exceptions.all) {
- if (!exceptions.patron_checkout_items) p.redraw_patron_checkout_items();
- if (!exceptions.patron_items) p.redraw_patron_items();
- if (!exceptions.patron_holds) p.redraw_patron_holds();
- if (!exceptions.patron_bills) p.redraw_patron_bills();
- if (!exceptions.patron_display_survey) patron_display_survey_init(p);
- //if (!exceptions.patron_edit) p.redraw_patron_edit();
- }
- return render_fm(p.w.document, { 'au' : p._patron });
- }
- p.redraw = p.display_patron;
-
- p.retrieve_patron_via_barcode = function (barcode) {
- if (!barcode) barcode = patron_get_barcode( p._patron );
- p.set_patron( retrieve_patron_by_barcode( barcode ) );
- return p.display_patron( {} );
- }
-
- p.retrieve_patron_via_id = function (id, exceptions) {
- p.set_patron( retrieve_patron_by_id( id ) );
- return p.display_patron(exceptions);
- }
-
- p.refresh = function(exceptions) {
- if (p._patron) p.retrieve_patron_via_id( p._patron.id(), exceptions );
- }
-
- set_patron_display_widgets(p);
-
- if (p.patron) {
- if (typeof(p.patron) == 'object') {
- //p._patron = p.patron;
- p.set_patron( p.patron );
- p.display_patron();
- } else
- p.retrieve_patron_via_barcode( p.patron );
- }
-
- if (p._patron && p._patron.alert_message()) {
- //snd_bad(); snd_bad();
- s_alert(
- 'PATRON ALERT MESSAGE\n\n\n\n' +
- p._patron.alert_message() +
- '\n\n\n\nTo remove this alert permanently, Edit the patron and erase the message in "Alert Message".\n\n'
- );
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function set_patron_display_widgets(p) {
- p.commandset_node.getElementsByAttribute('id','cmd_patron_refresh')[0].addEventListener(
- 'command',
- function (ev) {
- p.refresh();
- },
- false
- );
-
- function gen_func(i) {
- // because otherwise i would be 5 for each closure
- return function(ev) {
- p.clamshell.set_second_deck(i);
- };
- }
- var cmds = [ 'cmd_patron_checkout', 'cmd_patron_items', 'cmd_patron_holds',
- 'cmd_patron_bills', 'cmd_patron_edit', 'cmd_patron_info' ]
- for (var i in cmds) {
- p.commandset_node.getElementsByAttribute('id',cmds[i])[0].addEventListener(
- 'command',
- gen_func(i),
- false
- );
- }
- p.commandset_node.getElementsByAttribute('id','cmd_patron_checkout')[0].addEventListener(
- 'command',
- function () {
- focus_widget( p.w.document, 'patron_checkout_barcode_entry_textbox' );
- },
- false
- );
- p.commandset_node.getElementsByAttribute('id','cmd_patron_bills')[0].addEventListener(
- 'command',
- function () {
- focus_widget( p.w.document, 'bill_payment_amount_textbox' );
- },
- false
- );
- p.commandset_node.getElementsByAttribute('id','cmd_patron_edit')[0].addEventListener(
- 'command',
- function () {
- p.redraw_patron_edit();
- },
- false
- );
-
-
-
-
-}
-
-
-function patron_display_clamshell_init(p) {
- p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
- p.left_panel = p.clamshell.first_deck;
- p.right_panel = p.clamshell.second_deck;
-}
-
-function patron_display_patron_items_init(p) {
- p.patron_items = patron_items_init( { 'w' : p.w, 'node' : p.patron_items_node, 'debug' : p.app } );
-
- p.w.document.getElementById('item_print').addEventListener(
- 'command',
- function(ev) {
- var params = {
- 'au' : p._patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : mw.G.itemsout_header,
- 'line_item' : mw.G.itemsout_line_item,
- 'footer' : mw.G.itemsout_footer
- };
- mw.print_itemsout_receipt( params );
- }, false
- );
-
- p.redraw_patron_items = function() {
- p.patron_items.clear_patron_items();
- if (!p._patron.checkouts()) patron_get_checkouts( p._patron );
- for (var i = 0; i < p._patron.checkouts().length; i++) {
- p.patron_items.add_patron_items( [ i ] );
- }
- }
-
- p.patron_items.register_patron_items_select_callback(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing patron_items_select_callback\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
- var patron_items = get_list_from_tree_selection( p.patron_items.paged_tree.tree );
- /* grab cover art for selected item? */
- }
- );
- p.patron_items.register_flesh_patron_items_function(
- function (treeitem) {
- sdump('D_PATRON_DISPLAY','Firing flesh_patron_items_function\n');
- var record_id = treeitem.getAttribute('record_id');
- p.patron_items.map_patron_items_to_cols( p._patron.checkouts()[ record_id ], treeitem );
- }
- );
- p.patron_items.register_item_context_builder(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing context_builder for patron_items\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_items.paged_tree.popup = ' + p.patron_items.paged_tree.popup + '\n');
- empty_widget(p.patron_items.paged_tree.popup);
- var patron_items = get_list_from_tree_selection( p.patron_items.paged_tree.tree );
- sdump('D_PATRON_DISPLAY','patron_items.length = ' + patron_items.length + '\n');
-
- /*** RENEW ***/
- var menuitem_pi_r = p.patron_items.paged_tree.w.document.createElement('menuitem');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_r );
- menuitem_pi_r.setAttribute('label',getString('circ.context_renew'));
- menuitem_pi_r.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing renew context for patron_items\n');
- for (var i = 0; i < patron_items.length; i++) {
- try {
- var idx = patron_items[i].getAttribute('record_id');
- var circ = p._patron.checkouts()[ idx ].circ;
- renew_by_circ_id( circ.id() );
- p.refresh();
- } catch(E) {
- alert(E);
- }
- }
- },
- false
- );
-
- /*** CHECKIN ***/
- var menuitem_pi_c = p.patron_items.paged_tree.w.document.createElement('menuitem');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_c );
- menuitem_pi_c.setAttribute('label',getString('circ.context_checkin'));
- menuitem_pi_c.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing checkin context for patron_items\n');
- for (var i = 0; i < patron_items.length; i++) {
- try {
- var idx = patron_items[i].getAttribute('record_id');
- var copy = p._patron.checkouts()[ idx ].copy;
- var check = checkin_by_copy_barcode( copy.barcode(), null );
- if (check != null && check.status == 0) {
- check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
- alert('Check In: ' + check.text + ' Route To: ' + check.route_to);
- }
- p.refresh();
- } catch(E) {
- alert(E);
- }
- }
- },
- false
- );
-
- /*** LOST ***/
- var menuitem_pi_r = p.patron_items.paged_tree.w.document.createElement('menuitem');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_r );
- menuitem_pi_r.setAttribute('label',getString('circ.context_lost'));
- menuitem_pi_r.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing lost context for patron_items\n');
- for (var i = 0; i < patron_items.length; i++) {
- try {
- var idx = patron_items[i].getAttribute('record_id');
- var circ = p._patron.checkouts()[ idx ].circ;
- mark_circ_as_lost( circ ) ;
- p.refresh();
- } catch(E) {
- alert(E);
- }
- }
- },
- false
- );
-
- /* separator */
- var menuitem_pi_s = p.patron_items.paged_tree.w.document.createElement('menuseparator');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_s );
-
-
- /*** COPY EDITOR ***/
- var menuitem_pi_ce = p.patron_items.paged_tree.w.document.createElement('menuitem');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_ce );
- menuitem_pi_ce.setAttribute('label',getString('circ.context_edit'));
- menuitem_pi_ce.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_items\n');
- for (var i = 0; i < patron_items.length; i++) {
- sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
- var idx = patron_items[i].getAttribute('record_id');
- var copy = p._patron.checkouts()[ idx ].copy;
- spawn_batch_copy_editor(
- p.w.app_shell,'new_tab','main_tabbox',{
- 'copy_ids' : [ copy.id() ]
- }
- );
- }
- },
- false
- );
-
- /*** OPAC ***/
- var menuitem_pi_o = p.patron_items.paged_tree.w.document.createElement('menuitem');
- p.patron_items.paged_tree.popup.appendChild( menuitem_pi_o );
- menuitem_pi_o.setAttribute('label',getString('circ.context_opac'));
- menuitem_pi_o.addEventListener(
- 'command',
- function (ev) {
- alert('Not Yet Implemented');
- sdump('D_PATRON_DISPLAY','Firing opac context for patron_items\n');
- for (var i = 0; i < patron_items.length; i++) {
- sdump('D_PATRON_DISPLAY','Firing opac context\n');
- }
- },
- false
- );
-
- }
- );
-}
-
-function patron_display_patron_checkout_items_init(p) {
- p.patron_checkout_items = patron_checkout_items_init( { 'w' : p.w, 'node' : p.patron_checkout_items_node, 'debug' : p.app } );
- var tb = p.patron_checkout_items_node.getElementsByAttribute('id','patron_checkout_barcode_entry_textbox')[0];
- var submit_button = p.patron_checkout_items_node.getElementsByAttribute('id','patron_checkout_submit_barcode_button')[0];
-
- var checkouts = [];
-
- function print_receipt() {
- p._patron._current_checkouts = checkouts;
- var params = {
- 'au' : p._patron,
- 'lib' : mw.G.user_ou,
- 'staff' : mw.G.user,
- 'header' : mw.G.checkout_header,
- 'line_item' : mw.G.checkout_line_item,
- 'footer' : mw.G.checkout_footer
- };
- mw.print_checkout_receipt( params );
- }
-
- p.w.document.getElementById('checkout_print').addEventListener( 'command',print_receipt, false);
-
- p.w.document.getElementById('checkout_done').addEventListener(
- 'command',
- function () {
- if (p.w.document.getElementById('checkout_auto').checked) print_receipt();
- checkouts = []; p.display_patron(); tb.focus();
- },
- false
- );
- p.attempt_checkout = function(barcode) {
- try {
- //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
- var permit_check = checkout_permit( barcode, p._patron.id(), 0 );
- if (permit_check.status == 0) {
- var check = checkout_by_copy_barcode( barcode, p._patron.id() );
- if (check) {
- checkouts.push( check );
- p.patron_checkout_items.add_checkout_items( [ checkouts.length - 1 ] );
- var temp = p._patron.checkouts();
- temp.push( check );
- p._patron.checkouts( temp );
- render_fm(p.w.document, { 'au' : p._patron }); // p.display_patron();
- p.redraw_patron_items();
- tb.value = '';
- }
- } else {
- throw(permit_check.text);
- }
- } catch(E) {
- tb.select();
- if (typeof(E) == 'object') {
- handle_error(E,true);
- } else {
- s_alert(E);
- }
- }
- tb.focus();
- }
-
- tb.addEventListener(
- 'keypress',
- function(ev) {
- if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_checkout( tb.value ); }
- },
- false
- );
- submit_button.addEventListener(
- 'command',
- function(ev) {
- p.attempt_checkout( tb.value );
- },
- false
- );
-
- p.redraw_patron_checkout_items = function() {
- p.patron_checkout_items.clear_checkout_items();
- for (var i = 0; i < checkouts.length; i++) {
- p.patron_checkout_items.add_checkout_items( [ i ] );
- }
- }
-
- p.patron_checkout_items.register_patron_checkout_items_select_callback(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing patron_checkout_items_select_callback\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
- var patron_checkout_items = get_list_from_tree_selection( p.patron_checkout_items.paged_tree.tree );
- /* grab cover art for selected item? */
- }
- );
- p.patron_checkout_items.register_flesh_patron_checkout_items_function(
- function (treeitem) {
- sdump('D_PATRON_DISPLAY','Firing flesh_patron_checkout_items_function\n');
- var record_id = treeitem.getAttribute('record_id');
- p.patron_checkout_items.map_patron_checkout_items_to_cols( checkouts[ record_id ], treeitem );
- }
- );
- p.patron_checkout_items.register_checkout_context_builder(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing context_builder for patron_checkout_items\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_checkout_items.paged_tree.popup = ' + p.patron_checkout_items.paged_tree.popup + '\n');
- empty_widget(p.patron_checkout_items.paged_tree.popup);
- var patron_checkout_items = get_list_from_tree_selection( p.patron_checkout_items.paged_tree.tree );
-
- /*** CHECKIN ***/
- var menuitem_pci_c = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
- p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_c );
- menuitem_pci_c.setAttribute('label',getString('circ.context_checkin'));
- menuitem_pci_c.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing checkin context for patron_checkout_items\n');
- var keep_these = [];
- for (var i = 0; i < patron_checkout_items.length; i++) {
- try {
- var idx = patron_checkout_items[i].getAttribute('record_id');
- var copy = checkouts[ idx ].copy;
- var check = checkin_by_copy_barcode( copy.barcode(), null );
- if (check == null) { // change this to whatever it takes
- keep_these.push( checkouts[ idx ] );
- }
- if (check != null && check.status == 0) {
- //check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
- alert('Check In: ' + check.text + ' Route To: ' + check.route_to);
- }
- checkouts = keep_these;
- p.refresh();
- } catch(E) {
- alert(E);
- }
- }
- },
- false
- );
-
- /* separator */
- var menuitem_pci_s = p.patron_checkout_items.paged_tree.w.document.createElement('menuseparator');
- p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_s );
-
-
- /*** COPY EDITOR ***/
- var menuitem_pci_ce = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
- p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_ce );
- menuitem_pci_ce.setAttribute('label',getString('circ.context_edit'));
- menuitem_pci_ce.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_checkout_items\n');
- for (var i = 0; i < patron_checkout_items.length; i++) {
- var idx = patron_checkout_items[i].getAttribute('record_id');
- var copy = checkouts[ idx ].copy;
- sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
- spawn_batch_copy_editor(
- p.w.app_shell,'new_tab','main_tabbox',{
- 'copy_ids' : [ copy.id() ]
- }
- );
- }
- },
- false
- );
-
- /*** OPAC ***/
- var menuitem_pci_o = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
- p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_o );
- menuitem_pci_o.setAttribute('label',getString('circ.context_opac'));
- menuitem_pci_o.addEventListener(
- 'command',
- function (ev) {
- alert('Not Yet Implemented');
- sdump('D_PATRON_DISPLAY','Firing opac context for patron_checkout_items\n');
- for (var i = 0; i < patron_checkout_items.length; i++) {
- var idx = patron_checkout_items[i].getAttribute('record_id');
- sdump('D_PATRON_DISPLAY','Firing opac context\n');
- }
- },
- false
- );
-
- }
- );
-}
-
-function patron_display_patron_holds_init(p) {
- p.patron_holds = patron_holds_init( { 'w' : p.w, 'node' : p.patron_holds_node, 'debug' : p.app } );
-
- p.redraw_patron_holds = function() {
- p.patron_holds.clear_patron_holds();
- if (!p._patron.hold_requests()) patron_get_holds( p._patron );
- for (var i = 0; i < p._patron.hold_requests().length; i++) {
- p.patron_holds.add_patron_holds( [ i ] );
- }
- }
-
- p.patron_holds.register_patron_holds_select_callback(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing patron_holds_select_callback\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
- var patron_holds = get_list_from_tree_selection( p.patron_holds.paged_tree.tree );
- /* grab cover art for selected item? */
- }
- );
- p.patron_holds.register_flesh_patron_holds_function(
- function (treeitem) {
- sdump('D_PATRON_DISPLAY','Firing flesh_patron_holds_function\n');
- var record_id = treeitem.getAttribute('record_id');
- var hold = p._patron.hold_requests()[ record_id ];
- patron_get_hold_status(
- hold,
- function (request) {
- var result = request.getResultObject();
- hold.status( hold_status_as_text( result ) );
- p.patron_holds.map_patron_holds_to_cols( hold, treeitem );
- }
- );
- }
- );
- p.patron_holds.register_item_context_builder(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing context_builder for patron_holds\n');
- sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_holds.paged_tree.popup = ' + p.patron_holds.paged_tree.popup + '\n');
- empty_widget(p.patron_holds.paged_tree.popup);
- var patron_holds = get_list_from_tree_selection( p.patron_holds.paged_tree.tree );
- sdump('D_PATRON_DISPLAY','patron_holds.length = ' + patron_holds.length + '\n');
-
- /*** CANCEL HOLD ***/
- var menuitem_ph_ce = p.patron_holds.paged_tree.w.document.createElement('menuitem');
- p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_ce );
- menuitem_ph_ce.setAttribute('label',getString('circ.context_cancel_hold'));
- menuitem_ph_ce.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing cancel hold context for patron_holds\n');
- for (var i = 0; i < patron_holds.length; i++) {
- sdump('D_PATRON_DISPLAY','Firing cancel edit context\n');
- var record_id = patron_holds[i].getAttribute('record_id');
- var hold = p._patron.hold_requests()[ record_id ];
- cancel_hold( hold );
- }
- p.refresh();
- },
- false
- );
-
- /* separator */
- var menuitem_ph_s = p.patron_holds.paged_tree.w.document.createElement('menuseparator');
- p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_s );
-
- /*** COPY EDITOR ***/
- var menuitem_ph_ce = p.patron_holds.paged_tree.w.document.createElement('menuitem');
- p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_ce );
- menuitem_ph_ce.setAttribute('label',getString('circ.context_edit'));
- menuitem_ph_ce.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_holds\n');
- for (var i = 0; i < patron_holds.length; i++) {
- sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
- var idx = patron_holds[i].getAttribute('record_id');
- var copy = p._patron.hold_requests()[ idx ].copy;
- spawn_batch_copy_editor(
- p.w.app_shell,'new_tab','main_tabbox',{
- 'copy_ids' : [ copy.id() ]
- }
- );
- }
- },
- false
- );
-
- /*** OPAC ***/
- var menuitem_ph_o = p.patron_holds.paged_tree.w.document.createElement('menuitem');
- p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_o );
- menuitem_ph_o.setAttribute('label',getString('circ.context_opac'));
- menuitem_ph_o.addEventListener(
- 'command',
- function (ev) {
- alert('Not Yet Implemented');
- sdump('D_PATRON_DISPLAY','Firing opac context for patron_holds\n');
- for (var i = 0; i < patron_holds.length; i++) {
- sdump('D_PATRON_DISPLAY','Firing opac context\n');
- }
- },
- false
- );
-
- }
- );
-}
-
-function patron_display_patron_bills_init(p) {
- p.patron_bills = patron_bills_init( {
- 'w' : p.w,
- 'node' : p.patron_bills_node,
- 'debug' : p.app
- } );
-
- p.patron_bills.refresh = function() { p.refresh(); }
-
- p.redraw_patron_bills = function() {
- try {
- p.patron_bills.clear_patron_bills();
- if (!p._patron.bills) patron_get_bills( p._patron );
- p.patron_bills.add_patron_bills( p._patron.bills );
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- }
-}
-
-function patron_display_patron_edit_init(p) {
- /*
- p.patron_edit = patron_edit_init( {
- 'w' : p.w,
- 'node' : p.patron_edit_node,
- 'debug' : p.app
- } );
-
- p.patron_edit.redisplay = function() { p.display_patron( {'patron_edit':true} ); }
- p.patron_edit.refresh = function() { p.refresh( {'patron_edit':true} ); }
-
- p.redraw_patron_edit = function() {
- try {
- p.patron_edit.clear_patron_edit();
- p.patron_edit.add_rows( p._patron );
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- }
- */
- /* shoehorn in the old legacy stuff */
- p.patron_edit = {};
- p.redraw_patron_edit = function() {
- empty_widget( p.patron_edit_node );
- setTimeout(
- function() {
- var frame = p.w.document.createElement('iframe');
- p.patron_edit_node.appendChild( frame );
- frame.setAttribute('flex','1');
- frame.setAttribute('src','chrome://evergreen/content/patron/patron_edit_legacy.xul');
- frame.contentWindow.mw = mw;
- frame.contentWindow.params = {};
- var barcode = patron_get_barcode( p._patron );
- frame.contentWindow.params.barcode = barcode;
- frame.contentWindow.params._patron = p._patron;
- frame.contentWindow.patron_save_callback = function ( params ) {
- p._patron = params.au;
- p.display_patron();
- }
- p.patron_edit.frame = frame;
- }, 0
- );
- }
-}
-
-function patron_display_survey_init(p) {
- var gb = p.w.document.getElementById('PatronDisplaySurvey_groupbox');
- var count = gb.childNodes.length; for (var i = 1; i < count; i++) { gb.removeChild( gb.lastChild ); } // all but caption
- mw.user_request(
- 'open-ils.circ', 'open-ils.circ.survey.retrieve.required', [ mw.G.auth_ses[0] ],
- function (request) {
- var surveys = request.getResultObject();
- for (var i = 0; i < surveys.length; i++) {
-
- var survey = a_get(surveys, i);
-
- var hbox = document.createElement('hbox');
- gb.appendChild(hbox);
-
- var name_label = document.createElement('label');
- name_label.setAttribute('value',survey.name());
- hbox.appendChild(name_label);
-
- var answer_label = document.createElement('label');
- answer_label.setAttribute('value','');
- hbox.appendChild(answer_label);
-
- var taken_label = document.createElement('label');
- taken_label.setAttribute('value','Not Taken');
- hbox.appendChild(taken_label);
-
- mw.user_request(
- 'open-ils.circ', 'open-ils.circ.survey.response.retrieve',
- [ mw.G.auth_ses[0], survey.id(), p._patron.id() ],
- function (request) {
- var responses = request.getResultObject();
- if (responses.length > 0) {
- var response = responses.pop(); // last response
- var date;
- if (response.effective_date()) {
- date = formatted_date( response.effective_date(), '%D' );
- } else {
- date = formatted_date( response.answer_date(), '%D' );
- }
- taken_label.setAttribute('value',date);
- var answer = find_id_object_in_list( // first answer
- find_id_object_in_list(
- survey.questions(),
- response.question()
- ).answers(),
- response.answer()
- ).answer();
- answer_label.setAttribute('value',answer);
- }
- }
- );
- }
- }
- );
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-
-<page id="patron_display_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="try {
- params.w = window;
- params.app = 'PatronDisplay';
- params.clamshell_node = document.getElementById('ClamShell_main');
- params.patron_items_node = document.getElementById('PatronItems_main');
- params.patron_checkout_items_node = document.getElementById('PatronCheckoutItems_main');
- params.patron_holds_node = document.getElementById('PatronHolds_main');
- params.patron_bills_node = document.getElementById('PatronBills_main');
- params.patron_edit_node = document.getElementById('PatronEdit_main');
- params.commandset_node = document.getElementById('universal_cmds');
- mw.focus_widget( document, 'patron_checkout_barcode_entry_textbox' );
- mw.OpenILS_init(params);
- } catch(E) {
- alert(E);
- }"
- onunload="try { mw.OpenILS_exit(params); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_display.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/patron_display.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="PatronDisplay_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="PatronDisplay_main" class="my_overflow" />
-
- <popupset id="universal_popupset" />
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_contact_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_display_contact_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_display_contact -->
-<box id="PatronDisplayContact_main" flex="1" orient="vertical" style="overflow: auto;">
- <groupbox id="PatronDisplayContact_groupbox" flex="1"/>
-</box>
-
-<groupbox id="PatronDisplayContact_groupbox" orient="vertical">
- <caption label="&patron_display.contact.caption;"/>
- <hbox id="pdcgbhb1">
- <grid id="PatronDisplayContact_grid" />
- <spacer id="pdcgbhbs1" flex="1"/>
- <image id="PatronDisplay_photo"
- render="true" fm_class="au" render_value=".photo_url()" />
- </hbox>
- <grid id="PatronDisplayContact_grid_phone" />
- <groupbox id="PatronDisplayContact_mailing_address" />
- <groupbox id="PatronDisplayContact_physical_address" />
-</groupbox>
-
-<grid id="PatronDisplayContact_grid">
- <columns id="pdsgc">
- <column id="pdsgc1" />
- <column id="pdsgc2" />
- </columns>
- <rows id="pdsgr" flex="1">
- <row id="pdsgr0">
- <label id="PatronDisplayContact_library_card_label" class="text_right"
- value="&patron_display.library_card.label;"/>
- <label id="PatronDisplayContact_library_card"
- render="true" fm_class="au" render_value="patron_get_barcode($$)"/>
- </row>
- <row id="pdsgr1">
- <label id="PatronDisplayContact_ident_label" class="text_right"
- value="&patron_display.ident1.label;"/>
- <hbox id="pdsgr0h">
- <label id="PatronDisplayContact_ident_type"
- render="true" fm_class="au" render_value="patron_get_ident1_type_as_text($$)" />
- <label id="PatronDisplayContact_ident_value"
- render="true" fm_class="au" render_value=".ident_value()" />
- </hbox>
- </row>
- <row id="pdsgr2">
- <label id="PatronDisplayContact_ident_label2" class="text_right"
- value="&patron_display.ident2.label;"/>
- <hbox id="pdsgr0ah">
- <label id="PatronDisplayContact_ident_type2"
- render="true" fm_class="au" render_value="patron_get_ident2_type_as_text($$)" />
- <label id="PatronDisplayContact_ident_value2"
- render="true" fm_class="au" render_value=".ident_value2()" />
- </hbox>
- </row>
- <row id="pdsgr3">
- <label id="PatronDisplayContact_date_of_birth_label" class="text_right"
- value="&patron_display.date_of_birth.label;"/>
- <label id="PatronDisplayContact_date_of_birth"
- render="true" fm_class="au" render_value=".dob()"/>
- </row>
- <row id="pdsgr4"><label id="pdsgr4l" value=" "/></row>
- </rows>
-</grid>
-
-<grid id="PatronDisplayContact_grid_phone">
- <columns id="pdcgpc">
- <column id="pdcgpc1" />
- <column id="pdcgpc2" />
- </columns>
- <rows id="pdcgpr" flex="1">
- <row id="pdcgpr1">
- <label id="PatronDisplayContact_day_phone_label" class="text_right"
- value="&patron_display.day_phone.label;" />
- <label id="PatronDisplayContact_day_phone"
- render="true" fm_class="au"
- render_value=".day_phone()" />
- </row>
- <row id="pdcgpr2">
- <label id="PatronDisplayContact_evening_phone_label" class="text_right"
- value="&patron_display.evening_phone.label;" />
- <label id="PatronDisplayContact_evening_phone"
- render="true" fm_class="au"
- render_value=".evening_phone()" />
- </row>
- <row id="pdcgpr3">
- <label id="PatronDisplayContact_other_phone_label" class="text_right"
- value="&patron_display.other_phone.label;" />
- <label id="PatronDisplayContact_other_phone"
- render="true" fm_class="au"
- render_value=".other_phone()" />
- </row>
- <row id="pdsgpr4"><label id="pdsgpr4l" value=" "/></row>
- <row id="pdcgpr5">
- <label id="PatronDisplayContact_email_label" class="text_right"
- value="&patron_display.email.label;" />
- <label id="PatronDisplayContact_email"
- render="true" fm_class="au"
- render_value=".email()" />
- </row>
- <row id="pdsgpr6"><label id="pdsgpr6l" value=" "/></row>
-
- </rows>
-</grid>
-
-<groupbox id="PatronDisplayContact_mailing_address" orient="vertical">
- <caption id="pdcmac" label="&patron_display.mailing_address;"/>
- <label id="pdcmal1"
- tooltiptext="&patron_display.mailing.street1.label;"
- render="true" fm_class="au" render_value=".mailing_address().street1()" />
- <label id="pdcmal2"
- tooltiptext="&patron_display.mailing.street2.label;"
- render="true" fm_class="au" render_value=".mailing_address().street2()" />
- <hbox id="pdcmah">
- <label id="pdcmal3"
- tooltiptext="&patron_display.mailing.city.label;"
- render="true" fm_class="au" render_value=".mailing_address().city()" />
- <label id="pdcmal4"
- tooltiptext="&patron_display.mailing.state.label;"
- render="true" fm_class="au" render_value=".mailing_address().state()" />
- <label id="pdcmal5"
- tooltiptext="&patron_display.mailing.post_code.label;"
- render="true" fm_class="au" render_value=".mailing_address().post_code()" />
- </hbox>
-</groupbox>
-
-<groupbox id="PatronDisplayContact_physical_address" orient="vertical">
- <caption id="pdcpac" label="&patron_display.physical_address;"/>
- <label id="pdcpal1"
- tooltiptext="&patron_display.physical.street1.label;"
- render="true" fm_class="au" render_value=".billing_address().street1()" />
- <label id="pdcpal2"
- tooltiptext="&patron_display.physical.street2.label;"
- render="true" fm_class="au" render_value=".billing_address().street2()" />
- <hbox id="pdcpah">
- <label id="pdcpal3"
- tooltiptext="&patron_display.physical.city.label;"
- render="true" fm_class="au" render_value=".billing_address().city()" />
- <label id="pdcpal4"
- tooltiptext="&patron_display.physical.state.label;"
- render="true" fm_class="au" render_value=".billing_address().state()" />
- <label id="pdcpal5"
- tooltiptext="&patron_display.physical.post_code.label;"
- render="true" fm_class="au" render_value=".billing_address().post_code()" />
- </hbox>
-</groupbox>
-
-
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplayContact_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_display_overlay.xul\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_items_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_checkout_items_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_contact_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_holds_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
- <command id="cmd_patron_refresh" />
- <command id="cmd_patron_checkout" />
- <command id="cmd_patron_items" />
- <command id="cmd_patron_holds" />
- <command id="cmd_patron_bills" />
- <command id="cmd_patron_edit" />
- <command id="cmd_patron_info" />
-
-</commandset>
-
-<!-- main widget for patron_display -->
-<box id="PatronDisplay_main" flex="1" orient="vertical">
- <hbox id="PatronNavBar" flex="0"/>
- <groupbox id="PatronDisplay_groupbox" orient="vertical" flex="1">
- <box id="ClamShell_main" />
- </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck" flex="0">
- <vbox id="csfdvb1" flex="1">
- <groupbox id="PatronDisplayStatus_groupbox" flex="0"/>
- <groupbox id="PatronDisplaySurvey_groupbox" flex="0">
- <caption id="pdsgbc" label="Surveys" />
- </groupbox>
- <groupbox id="PatronDisplayContact_groupbox" flex="1"/>
- </vbox>
-</deck>
-
-<deck id="ClamShell_second_deck" flex="1">
- <groupbox id="cssdgb1">
- <caption id="cssdgb1c" label="&patron_navbar.checkout;"/>
- <box id="PatronCheckoutItems_main"/>
- </groupbox>
- <groupbox id="cssdgb2">
- <caption id="cssdgb2c" label="&patron_navbar.items;"/>
- <box id="PatronItems_main" />
- </groupbox>
- <groupbox id="cssdgb3">
- <caption id="cssdgb3c" label="&patron_navbar.holds;"/>
- <box id="PatronHolds_main" />
- </groupbox>
- <groupbox id="cssdgb4">
- <caption id="cssdgb4c" label="&patron_navbar.bills;"/>
- <box name="insert1" id="PatronBills_insert1" flex="0" />
- <box id="PatronBills_main" flex="1" />
- <box name="insert2" id="PatronBills_insert2" flex="0" />
- </groupbox>
- <groupbox id="cssdgb5">
- <caption id="cssdgb5c" label="&patron_navbar.edit;"/>
- <box name="insert1" id="PatronEdit_insert1" flex="0" />
- <box id="PatronEdit_main" flex="1"/>
- <box name="insert2" id="PatronEdit_insert2" flex="0" />
- </groupbox>
- <box id="PatronInfo_main"><label value="info" /></box>
-</deck>
-
-<hbox id="PatronNavBar">
- <label id="PatronNavBar_patron_name" class="patronNameLarge"
- tooltiptext="&patron_display.name.label;"
- value="&patron_display.name.label;"
- render="true" fm_class="au"
- render_value="patron_get_full_name($$)" />
- <spacer id="PatronNavBar_spacer" flex="1" />
- <button id="PatronNavBar_refresh" command="cmd_patron_refresh"
- label="&patron_navbar.refresh;" accesskey="&patron_navbar.refresh.accesskey;"/>
- <button id="PatronNavBar_checkout" command="cmd_patron_checkout"
- label="&patron_navbar.checkout;" accesskey="&patron_navbar.checkout.accesskey;"/>
- <button id="PatronNavBar_items" command="cmd_patron_items"
- label="&patron_navbar.items;" accesskey="&patron_navbar.items.accesskey;"/>
- <button id="PatronNavBar_holds" command="cmd_patron_holds"
- label="&patron_navbar.holds;" accesskey="&patron_navbar.holds.accesskey;"/>
- <button id="PatronNavBar_bills" command="cmd_patron_bills"
- label="&patron_navbar.bills;" accesskey="&patron_navbar.bills.accesskey;"/>
- <button id="PatronNavBar_edit" command="cmd_patron_edit"
- label="&patron_navbar.edit;" accesskey="&patron_navbar.edit.accesskey;"/>
- <button id="PatronNavBar_info" command="cmd_patron_info"
- label="&patron_navbar.info;" accesskey="&patron_navbar.info.accesskey;"/>
-</hbox>
-
-<hbox id="PatronCheckoutItems_insert1">
- <label id="patron_checkout_scan_barcode_label" value="&patron_display.checkout.scan_label;" accesskey="&patron_display.checkout.scan_label.accesskey;" control="patron_checkout_barcode_entry_textbox"/>
- <textbox id="patron_checkout_barcode_entry_textbox"/>
- <button id="patron_checkout_submit_barcode_button" label="&patron_display.checkout.submit_label;" accesskey="&patron_display.checkout.submit_label.accesskey;"/>
-</hbox>
-
-<hbox id="PatronCheckoutItems_insert3">
- <button id="checkout_print" label="&patron_display.checkout.print_receipt_label;" accesskey="&patron_display.checkout.print_receipt_label.accesskey;"/>
- <button id="checkout_reprint" label="&patron_display.checkout.reprint_receipt_label;" accesskey="&patron_display.checkout.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
- <spacer id="pcii3s" flex="1"/>
- <checkbox id="checkout_auto" label="&patron_display.checkout.auto_print_label;" accesskey="&patron_display.checkout.auto_print_label.accesskey;"/>
- <button id="checkout_done" label="&patron_display.checkout.done_label;" accesskey="&patron_display.checkout.done_label.accesskey;"/>
-</hbox>
-
-<hbox id="PatronItems_insert3">
- <button id="item_print" label="&patron_display.items.print_receipt_label;" accesskey="&patron_display.items.print_receipt_label.accesskey;"/>
-</hbox>
-
-<box id="PatronBills_insert2" orient="vertical">
-</box>
-
-<box id="PatronBills_insert1" orient="vertical">
- <hbox>
- <groupbox>
- <caption label="Summary"/>
- <grid>
- <columns><column /><column /></columns>
- <rows>
- <row>
- <label value="Total Owed" />
-
- <textbox id="bill_total_owed" value="" readonly="true" />
- </row>
- <row>
- <label value="- Payment applied" />
-
- <textbox id="bill_payment_applied_textbox" readonly="true"/>
- </row>
- <row>
- <label value="= New Balance"
- style="font-family: bold" />
-
- <textbox id="bill_new_balance_textbox" readonly="true"/>
- </row>
- </rows>
- </grid>
- </groupbox>
- <spacer flex="2"/>
- <groupbox>
- <caption label="Pay Bill"/>
- <grid>
- <columns><column /><column /></columns>
- <rows>
- <row>
- <label value="Payment Type"
- accesskey="t" control="payment_type_menulist" />
- <menulist id="payment_type_menulist">
- <menupopup id="payment_type_menupopup">
- <menuitem id="payment_type_menuitem1" label="Cash" value="cash_payment"/>
- <menuitem id="payment_type_menuitem2" label="Check" value="check_payment"/>
- <menuitem id="payment_type_menuitem3" label="Credit Card" value="credit_card_payment"/>
- <menuitem id="payment_type_menuitem4" label="Patron Credit" value="credit_payment" />
- <menuitem id="payment_type_menuitem5" label="Work" value="work_payment"/>
- <menuitem id="payment_type_menuitem6" label="Forgive" value="forgive_payment"/>
- </menupopup>
- </menulist>
- </row>
- <row>
- <label value="Payment received" style="font-weight: bold"
- accesskey="a" control="bill_payment_amount_textbox" />
-
- <textbox id="bill_payment_amount_textbox" style="border: solid thick black"/>
- </row>
- <row>
- <label value="- Payment applied" />
-
- <textbox id="bpato" observes="bill_payment_applied_textbox" />
- </row>
- <row>
- <label value="= Change" control="bill_change_amount_textbox" />
-
- <hbox>
- <textbox id="bill_change_amount_textbox" />
- </hbox>
- </row>
- <row>
- <label value="or Patron Credit"
- style="font-family: bold" />
-
- <textbox id="bill_credit_amount_textbox" readonly="true"/>
- </row>
- </rows>
- </grid>
- </groupbox>
- </hbox>
- <hbox>
- <button id="bill_wizard" label="Bill Patron" accesskey="B"/>
- <spacer flex="2"/>
- <button id="change_to_credit" label="Convert Change to Patron Credit"/>
- <button id="bill_apply_payment" label="Go!" accesskey="G"/>
- </hbox>
- <label value=" "/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplay_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_status_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_display_status_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_display_status -->
-<box id="PatronDisplayStatus_main" flex="1" orient="vertical">
- <hbox id="PatronDisplayStatus_insert1"/>
- <groupbox id="PatronDisplayStatus_groupbox" />
- <hbox id="PatronDisplayStatus_insert5"/>
-</box>
-
-<groupbox id="PatronDisplayStatus_groupbox" orient="vertical">
- <caption label="&patron_display.status.caption;"/>
- <hbox id="PatronDisplayStatus_insert2"/>
- <label id="PatronDisplayStatus_home_ou"
- tooltiptext="&patron_display.home_ou.label;"
- value=" "
- render="true" fm_class="au"
- render_value="patron_get_home_ou_name($$)" />
- <hbox id="PatronDisplayStatus_insert3"/>
- <grid id="PatronDisplayStatus_grid" flex="1"/>
- <hbox id="PatronDisplayStatus_insert4"/>
- <label bug="without this here, the label and grid get swapped in the display"/>
-</groupbox>
-
-<grid id="PatronDisplayStatus_grid">
- <columns id="pdsgc">
- <column id="pdsgc1" />
- <column id="pdsgc2" />
- <column id="pdsgc3" />
- <column id="pdsgc4" />
- </columns>
- <rows id="pdsgr" flex="1">
- <row id="pdsgr1" render="true" fm_class="au" render_css_style="patron_get_standing_css_style($$.standing())">
- <label id="PatronDisplayStatus_profile_label" class="text_right"
- value="&patron_display.profile.label;" />
- <label id="PatronDisplayStatus_profile"
- render="true" fm_class="au"
- render_value="patron_get_profile_as_text($$)" />
- <label id="PatronDisplayStatus_standing_label" class="text_right"
- value="&patron_display.standing.label;" />
- <label id="PatronDisplayStatus_standing"
- render="true" fm_class="au"
- render_value="patron_get_standing_as_text($$)" />
- </row>
- <row id="pdsgr2">
- <label id="PatronDisplayStatus_credit_label" class="text_right"
- value="&patron_display.credit.label;" />
- <label id="PatronDisplayStatus_credit"
- render="true" fm_class="au"
- render_value="patron_get_credit_total($$)" />
- <label id="PatronDisplayStatus_bills_label" class="text_right"
- value="&patron_display.bills.label;" />
- <label id="PatronDisplayStatus_bill"
- render="true" fm_class="au"
- render_value="patron_get_bills_total($$)" />
- </row>
- <row id="pdsgr3">
- <label id="PatronDisplayStatus_checkouts_label" class="text_right"
- value="&patron_display.checkouts.label;" />
- <label id="PatronDisplayStatus_checkouts"
- render="true" fm_class="au"
- render_value="patron_get_checkouts_total($$)" />
- <label id="PatronDisplayStatus_checkouts_overdue_label" class="text_right"
- value="&patron_display.checkouts_overdue.label;" />
- <label id="PatronDisplayStatus_checkouts_overdue"
- render="true" fm_class="au"
- render_value="patron_get_checkouts_overdue_total($$)" />
- </row>
- <row id="pdsgr4">
- <label id="PatronDisplayStatus_holds_label" class="text_right"
- value="&patron_display.holds.label;" />
- <label id="PatronDisplayStatus_holds"
- render="true" fm_class="au"
- render_value="patron_get_holds_total($$)" />
- <label id="PatronDisplayStatus_holds_available_label" class="text_right"
- value="&patron_display.holds_available.label;" />
- <label id="PatronDisplayStatus_holds_available"
- render="true" fm_class="au"
- render_value="patron_get_holds_available_total($$)" />
- </row>
- </rows>
-</grid>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplayStatus_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading patron_edit.js\n');
-
-function patron_edit_init(p) {
- sdump('D_PATRON_EDIT',"TESTING: patron_edit.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- patron_edit_list_box_init( p );
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_edit_list_box_init( p ) {
- p.patron_edit_cols = [
- {
- 'id' : 'fieldname', 'label' : getString('patron_edit_fieldname'), 'flex' : 0,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'row',
- 'fm_field_render' : '.label.toString()'
- },
- {
- 'id' : 'current_value', 'label' : getString('patron_edit_current_value'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'row',
- 'fm_field_render' : 'evil_eval(row.fm_class,row.fm_field_render)'
- },
- {
- 'id' : 'new_value', 'label' : getString('patron_edit_new_value'), 'flex' : 0,
- 'fm_class' : 'row', 'fm_field_render' : 'create_entry_widget($$)'
- }
- ];
-
- p.list_box = list_box_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_edit_cols, 'debug' : p.app } );
- p.clear_patron_edit = function () {
- p.list_box.clear_rows();
- };
-
- p.add_rows = function (au) {
- sdump('D_PATRON_EDIT','p.add_row(' + au + ')\n');
- return patron_edit_add_rows(p,au);
- }
-}
-
-function patron_edit_add_rows(p, au) {
- sdump('D_PATRON_EDIT',arg_dump(arguments,{1:true}));
-
- var obj_string ='au';
-
- var edit = patron_edit_rows();
-
- function evil_eval( hint, render_code ) {
- sdump('D_PATRON_EDIT',arg_dump(arguments));
- var cmd = parse_render_string( hint, render_code );
- var col = '';
- sdump('D_PATRON_EDIT','evil_cmd = ' + cmd + '\n');
- try {
- col = eval( cmd );
- sdump('D_PATRON_EDIT','evil_eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',E + '\n');
- }
- return col;
- }
-
- function create_entry_widget(row) {
- var obj;
- try {
- sdump('D_PATRON_EDIT',arg_dump(arguments));
- if (row.rdefault) {
- row.rdefault = evil_eval( row.fm_class, row.rdefault );
- }
- if (row.entry_widget) {
- obj = p.w.document.createElement( row.entry_widget );
- obj.setAttribute('flex','1');
- if (row.entry_widget_attributes) {
- for (var i in row.entry_widget_attributes) {
- obj.setAttribute( i, row.entry_widget_attributes[i] );
- }
- }
- switch(row.entry_widget) {
- case 'menulist':
- if (row.populate_with) {
- var menupopup = p.w.document.createElement('menupopup');
- obj.appendChild( menupopup );
-
- for (var i in row.populate_with) {
-
- var menuitem = p.w.document.createElement('menuitem');
- menupopup.appendChild( menuitem );
- menuitem.setAttribute('label', i );
- menuitem.setAttribute('value', row.populate_with[ i ] );
- if (row.rdefault) {
- if ( (row.rdefault == i) || (row.rdefault == row.populate_with[ i ]) ) {
- sdump('D_PATRON_EDIT','Selected ' + i + '\n');
- menuitem.setAttribute('selected','true');
- }
- }
- }
- }
- break;
- default:
- if (row.rdefault) obj.setAttribute('value', row.rdefault);
- break;
- }
- }
- if (row.entry_event && row.entry_code) {
- obj.addEventListener( row.entry_event, new Function('ev',row.entry_code), false);
- }
- } catch(E) {
- alert(E + '\n' + js2JSON(E) + '\n');
- sdump('D_ERROR',E + '\n');
- obj = 'error';
- }
- return obj;
- }
-
- setTimeout(
- function() {
-
- for (var i = 0; i < edit.length; i++) {
-
- var row = edit[i];
-
- var cols = [];
-
- for (var j = 0; j < p.patron_edit_cols.length; j++) {
- var hash = p.patron_edit_cols[j];
- sdump('D_PATRON_EDIT','Considering ' + js2JSON(hash) + '\n');
- var listcell = p.w.document.createElement('listcell');
- listcell.setAttribute('pack','start');
- listcell.setAttribute('align','start');
- listcell.setAttribute('style','border-left: black solid thin');
- var col = '';
- if (hash.fm_field_render) {
-
- switch( hash.fm_class ) {
- case 'row' : obj_string = 'row'; break;
- case 'au' : obj_string = 'au'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_PATRON_EDIT','cmd = ' + cmd + '\n');
- try {
- col = eval( cmd );
- sdump('D_PATRON_EDIT','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',E + '\n');
- }
- if (typeof(col) == 'string') {
- listcell.setAttribute('label',col);
- } else {
- if (col==null) {
- listcell.setAttribute('label','');
- } else {
- listcell.appendChild( col );
- }
- }
- }
- cols.push( listcell );
- }
-
- if (!row['style']) row['style'] = '';
- if (!row['class']) row['class'] = '';
- var listitem = p.list_box.add_row(
- cols, { 'style' : row['style'], 'class' : row['class'] }
- );
-
- if (p.list_box.apply_to_each_listitem) {
- p.list_box.apply_to_each_listitem( i, listitem );
- }
- }
- }, 0
- );
-}
+++ /dev/null
-mw.sdump('D_LEGACY','Loading patron.js\n');
-//var newdoctype = document.implementation.createDocumentType("HTML", "-//W3C//DTD HTML 4.01 Transitional//EN","");
-var HTMLdoc;// = document.implementation.createDocument("", "", newdoctype);
-try {
- if (typeof(PATRON)=='object') {
- mw.sdump('D_LEGACY','Already loaded\n');
- exit;
- }
-} catch(E) {
-}
-var PATRON = {};
-PATRON['search'] = {};
-PATRON['search_results'] = [];
-PATRON['checkouts'] = [];
-var hash_aua = {};
-var hash_au = {};
-var hash_ac = {};
-var backup_au = {};
-//var hash_ap = {};
-var response_list = [];
-var local_stat_cats = [];
-var local_stat_cat_entries = {};
-var patron_hits_per_page = 20;
-
-var new_id = -1;
-
-var patron_list_columns = [
- { 'f' : 'prefix', 'v' : 'Prefix', 'hidden' : true },
- { 'f' : 'family_name', 'v' : 'Family Name', 'primary' : true },
- { 'f' : 'first_given_name', 'v' : 'First Name' },
- { 'f' : 'second_given_name', 'v' : 'Middle Name' },
- { 'f' : 'suffix', 'v' : 'Suffix', 'hidden' : false },
- { 'f' : 'email', 'v' : 'Email', 'hidden' : true },
- { 'f' : 'day_phone', 'v' : 'Day Phone', 'hidden' : false },
- { 'f' : 'evening_phone', 'v' : 'Evening Phone', 'hidden' : true },
- { 'f' : 'other_phone', 'v' : 'Other Phone', 'hidden' : true },
- { 'f' : 'ident_value', 'v' : 'Ident Value', 'hidden' : false },
- { 'f' : 'ident_type', 'v' : 'Ident Type', 'hidden' : true },
- { 'f' : 'ident_value2', 'v' : 'Ident Value 2', 'hidden' : true },
- { 'f' : 'ident_type2', 'v' : 'Ident Type 2', 'hidden' : true},
- { 'f' : 'dob', 'v' : 'Date of Birth', 'hidden' : true},
- { 'f' : 'active', 'v' : 'Active', 'hidden' : true},
- { 'f' : 'expire_date', 'v' : 'Expire Date', 'hidden' : true},
- { 's' : 'home_ou', 'f' : 'shortname', 'v' : 'Home Lib', 'hidden' : true},
- { 'f' : 'usrname', 'v' : 'Login Name', 'hidden' : true},
- { 'f' : 'usrgroup', 'v' : 'Group', 'hidden' : true},
- { 's' : 'mailing_address', 'f' : 'street1', 'v' : 'Mailing Address - Street 1', 'hidden' : true},
- { 's' : 'mailing_address', 'f' : 'street2', 'v' : 'Mailing Address - Street 2', 'hidden' : true},
- { 's' : 'mailing_address', 'f' : 'city', 'v' : 'Mailing Address - City', 'hidden' : true},
- { 's' : 'mailing_address', 'f' : 'state', 'v' : 'Mailing Address - State', 'hidden' : true},
- { 's' : 'mailing_address', 'f' : 'post_code', 'v' : 'Mailing Address - ZIP', 'hidden' : false},
- { 's' : 'billing_address', 'f' : 'street1', 'v' : 'Physical Address - Street 1', 'hidden' : true},
- { 's' : 'billing_address', 'f' : 'street2', 'v' : 'Physical Address - Street 2', 'hidden' : true},
- { 's' : 'billing_address', 'f' : 'city', 'v' : 'Physical Address - City', 'hidden' : true},
- { 's' : 'billing_address', 'f' : 'state', 'v' : 'Physical Address - State', 'hidden' : true},
- { 's' : 'billing_address', 'f' : 'post_code', 'v' : 'Physical Address - ZIP', 'hidden' : false}
-];
-
-
-function patron_init() {
- mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_init(): ' + mw.G.main_test_variable + '\n');
- mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
- var textbox = document.getElementById('patron_scan_textbox');
- if (textbox) textbox.addEventListener("keypress",patron_handle_keypress,false);
- /*
- Originally, the idea here was to setup the PATRON object based on barcode if the bundle loader
- set a params.barcode. This would also switch the barcode scan prompt to the patron summary
- sidebar.
- */
- patron_init_if_barcode();
- document.getElementById('patron_new_card_button').addEventListener(
- 'command',
- function(ev) {
- var a = yns_alert('Activate a new PINES card?','PINES Card','Yes - Previous card lost/stolen','No',null,'Check here to confirm');
- if (a == 0) {
- var card = new ac(); card.id( new_id-- ); card.isnew( '1' );
- card.barcode( 'REQUIRED' ); //PATRON.barcode = 'REQUIRED';
- card.usr( PATRON.au.id() );
- hash_ac[ card.id() ] = card;
- PATRON.au.card( card );
- var cards = PATRON.au.cards();
- for (var i = 0; i < cards.length; i++) { cards[i].active('0'); cards[i].ischanged('1'); }
- cards.push( card ); PATRON.au.cards( cards );
- var barcode_e = document.getElementById('patron_edit_system_barcode_textbox');
- barcode_e.disabled = false; barcode_e.value = 'REQUIRED';
- }
- },
- false
- );
-}
-
-function patron_handle_keypress(ev) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- if (ev.keyCode && ev.keyCode == 13) {
- switch(this) {
- case document.getElementById('patron_scan_textbox') :
- ev.preventDefault();
- PATRON.scan_submit(ev);
- break;
- default:
- break;
- }
- }
-}
-
-function patron_new_init() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_new_init(): ' + mw.G.main_test_variable + '\n');
- mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
- PATRON.au = new au();
- PATRON.au.id( new_id-- );
- PATRON.au.isnew( '1' );
- PATRON.au.profile( mw.G.ap_list[0].id() );
- PATRON.au.ident_type( mw.G.cit_list[0].id() );
- PATRON.au.home_ou( mw.G.user_ou.id() );
- PATRON.au.addresses( [] );
- PATRON.au.stat_cat_entries( [] );
-
- var card = new ac();
- card.id( new_id-- );
- card.isnew( '1' );
- card.barcode( 'REQUIRED' );
- //PATRON.barcode = 'REQUIRED';
- card.usr( PATRON.au.id() );
- hash_ac[ card.id() ] = card;
-
- PATRON.au.card( card );
- PATRON.au.cards( [ card ] );
- PATRON.related_refresh(PATRON.au.id());
-
- var passwd = document.getElementById( 'patron_edit_system_new_passwd_textbox' );
- passwd.value = Math.floor( (Math.random() * 9000) + 1000 );
- PATRON.au.passwd( passwd.value );
-
- var textbox = document.getElementById( 'patron_edit_system_barcode_textbox' );
- textbox.select(); textbox.focus();
-}
-
-function patron_edit_init() {
- mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_edit_init(): ' + mw.G.main_test_variable + '\n');
- mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
- //mw.sdump('D_LEGACY','PATRON.au.array.length = ' + PATRON.au.array.length + '\n');
- populate_patron_edit_library_menu();
- populate_patron_edit_prefix_menu();
- populate_patron_edit_suffix_menu();
- populate_patron_edit_profile_menu();
- populate_patron_edit_ident_type_menu();
- populate_patron_edit_ident_type_menu2();
- PATRON.summary_refresh();
- local_stat_cats = mw.G.actsc_list;
- populate_rows_with_local_stat_cats(
- local_stat_cats,
- local_stat_cat_entries,
- 'pescg_rows',
- true
- );
- PATRON.summary_refresh();
-}
-
-function patron_init_if_barcode() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- if ( params.barcode ) {
- mw.sdump('D_LEGACY','patron_init(): patron.refresh()\n');
- PATRON.retrieve_patron(params.barcode);
- var deck = document.getElementById('patron_scan_deck');
- if (deck) { deck.setAttribute('selectedIndex','1'); }
- }
- } catch(E) {
- //mw.sdump('D_LEGACY','patron_init_if_barcode ERROR: ' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','patron_init_if_barcode failed\n');
- }
-}
-
-function populate_patron_edit_library_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- //populate_lib_list(
- populate_lib_list_with_branch(
- 'patron_edit_system_library_menulist',
- 'patron_edit_system_library_menupopup',
- mw.G.user_ou,
- mw.G.org_tree,
- true
- );
- } catch(E) {
- mw.sdump('D_LEGACY','populate_patron_edit_library_menu ERROR: ' + js2JSON(E) + '\n');
- //mw.sdump('D_LEGACY','populate_patron_edit_library_menu failed\n');
- }
-}
-
-function set_patron_edit_library_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var menuitem_id =
- 'libitem' +
- find_ou(
- mw.G.org_tree,
- PATRON.au.home_ou()
- ).id();
- var menuitem = document.getElementById(
- menuitem_id
- );
- var homelib_e = document.getElementById('patron_edit_system_library_menulist');
- if (homelib_e) {
- homelib_e.selectedItem = menuitem;
- mw.sdump('D_LEGACY','\tShould be set\n');
- }
-}
-
-function populate_patron_edit_prefix_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- populate_name_prefix(
- 'patron_edit_system_prefix_menulist',
- 'patron_edit_system_prefix_menupopup'
- );
- } catch(E) {
- //mw.sdump('D_LEGACY','populate_patron_edit_prefix_menu ERROR: ' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','populate_patron_edit_prefix_menu failed\n');
- }
-}
-
-function populate_patron_edit_suffix_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- populate_name_suffix(
- 'patron_edit_system_suffix_menulist',
- 'patron_edit_system_suffix_menupopup'
- );
- } catch(E) {
- //mw.sdump('D_LEGACY','populate_patron_edit_suffix_menu ERROR: ' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','populate_patron_edit_suffix_menu failed\n');
- }
-}
-
-function populate_patron_edit_profile_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- populate_user_profile(
- 'patron_edit_system_profile_menulist',
- 'patron_edit_system_profile_menupopup'
- );
- } catch(E) {
- //mw.sdump('D_LEGACY','populate_patron_edit_profile_menu ERROR: ' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','populate_patron_edit_profile_menu failed\n');
- }
-}
-
-function set_patron_edit_profile_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var menuitem_id = 'apitem' + PATRON.au.profile();
- var menuitem = document.getElementById(
- menuitem_id
- );
- var profile_e = document.getElementById('patron_edit_system_profile_menulist');
- if (profile_e) { profile_e.selectedItem = menuitem; }
-}
-
-function populate_patron_edit_ident_type_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- populate_ident_types(
- 'patron_edit_system_id1type_menulist',
- 'patron_edit_system_id1type_menupopup',
- '1'
- );
- } catch(E) {
- mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu ERROR: ' + js2JSON(E) + '\n');
- //mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu failed\n');
- }
-}
-
-function set_patron_edit_ident_type_menu() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var menuitem_id = 'cit1item' + PATRON.au.ident_type();
- var menuitem = document.getElementById(
- menuitem_id
- );
- var id1 = document.getElementById('patron_edit_system_id1type_menulist');
- if (id1) { id1.selectedItem = menuitem; }
-}
-
-function populate_patron_edit_ident_type_menu2() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- populate_ident_types(
- 'patron_edit_system_id2type_menulist',
- 'patron_edit_system_id2type_menupopup',
- '2'
- );
- } catch(E) {
- //mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu2 ERROR: ' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu2 failed\n');
- }
-}
-
-function set_patron_edit_ident_type_menu2() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var menuitem_id = 'cit2item' + PATRON.au.ident_type2();
- var menuitem = document.getElementById(
- menuitem_id
- );
- var id2_e = document.getElementById('patron_edit_system_id2type_menulist');
- if (id2_e) { id2_e.selectedItem = menuitem; }
-}
-
-function populate_patron_survey_grid(grid) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- if (typeof(grid) != 'object') {
- grid = document.getElementById(grid);
- }
- if (!grid) { return; }
- var rows = grid.lastChild; if (!rows) { return; }
- try {
- empty_widget( rows );
- // 'open-ils.circ.survey.required.retrieve',
- // 'open-ils.circ.survey.retrieve.all',
- var result = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.survey.retrieve.required',
- [ mw.G.auth_ses[0] ]
- )[0];
- if (typeof(result) != 'object') { throw('survey.retrieve.all did not return an object'); }
- var desc_1 = new Object();
- var desc_3 = new Object();
- var survey_hash = new Object();
- for (var i in result) {
- var survey = result[i];
- survey_hash[ survey.id() ] = survey;
- if ( (survey.required() == '0') && (survey.usr_summary() == '0') ) { continue; }
- mw.sdump('D_LEGACY','Survey: ' + survey.id() + ' : ' + survey.name() + '\n');
- var row = document.createElement('row');
- rows.appendChild(row);
- desc_1[ survey.id() ] = document.createElement('description');
- desc_1[ survey.id() ].setAttribute('value', 'Not Taken');
- row.appendChild(desc_1[ survey.id() ]);
- var desc_2 = document.createElement('label');
- desc_2.setAttribute('class','link');
- desc_2.setAttribute('onclick','survey_test(event,' + survey.id() + ');');
- row.appendChild(desc_2);
- desc_2.setAttribute('value', survey.name() );
- desc_3[ survey.id() ] = document.createElement('description');
- row.appendChild(desc_3[ survey.id() ]);
-
- if (survey.required() == '1') {
- row.setAttribute('hidden','false');
- } else {
- row.setAttribute('hidden','true');
- }
- mw.sdump('D_LEGACY','creating desc_1: ' + desc_1 + '\n');
- var result2 = mw.user_async_request(
- 'open-ils.circ',
- 'open-ils.circ.survey.response.retrieve',
- [ mw.G.auth_ses[0], survey.id(), PATRON.au.id() ],
- function (request) {
- var result2 = request.getResultObject();
- mw.sdump('D_LEGACY','result2 = ' + js2JSON(result2) + '\n');
- if (result2.length > 0) {
- var last_response = result2.pop();
- mw.sdump('D_LEGACY','desc_1 = ' + desc_1[ last_response.survey() ] + '\n');
- mw.sdump('D_LEGACY','effective_date = [' + last_response.effective_date() + '] answer_date = [' + last_response.answer_date() + ']\n');
- var date = last_response.effective_date().substr(0,10);
- if (!date) { date = last_response.answer_date().substr(0,10); }
- var first_answer = '';
- try {
- first_answer = find_id_object_in_list(
- find_id_object_in_list(
- survey_hash[ last_response.survey() ].questions(),
- last_response.question()
- ).answers(),
- last_response.answer()
- ).answer();
- } catch(E) {
- mw.sdump('D_LEGACY',js2JSON(E) + '\n');
- }
- desc_1[ last_response.survey() ].setAttribute('value', date);
- desc_3[ last_response.survey() ].setAttribute('value', first_answer);
- mw.sdump('D_LEGACY','desc_1 = ' + date + '\n');
- }
- }
- );
- }
- } catch(E) {
- mw.sdump('D_LEGACY','populate_patron_edit_survey_grid ERROR: ' + js2JSON(E) + '\n');
- mw.handle_error(E);
- }
-}
-
-function toggle_patron_survey_grid_rows(e,grid) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var label = e.target.getAttribute('label');
- var alt_label = e.target.getAttribute('alt_label');
- e.target.setAttribute('label',alt_label);
- e.target.setAttribute('alt_label',label);
- toggle_hidden_grid_rows(grid);
-}
-
-function retrieve_patron_by_barcode(barcode,method) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- if (!barcode) { barcode = PATRON.barcode(); }
- mw.sdump('D_LEGACY','Entering PATRON.retrieve_patron() with barcode: ' + barcode + '\n');
- //unregister_patron_window(this);
- var result;
- if (!method) method = 'open-ils.actor.user.fleshed.retrieve_by_barcode';
- try {
- if (params._patron) {
- result = [ params._patron ];
- } else {
- result = mw.user_request(
- 'open-ils.actor',
- method,
- [ mw.G.auth_ses[0], barcode ]
- );
- }
- if (typeof(result[0]) != 'object') {
- mw.sdump('D_LEGACY','unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
- throw('unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
- }
- } catch(E) {
- mw.sdump('D_LEGACY','error in search.actor.user.barcode\n' + js2JSON(E) + '\n');
- mw.handle_error(E);
- return false;
- }
- /*for (var i in result[0]) {
- var element = result[0][i];
- if (typeof(element) != 'function') {
- mw.sdump('D_LEGACY','Copying ' + i + ' to PATRON\n');
- PATRON[i] = element;
- }
- }*/
- PATRON.au = result[0];
- //register_patron_window(this);
- //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
- patron_callback('retrieve_patron');
- return PATRON.related_refresh(PATRON.au.id());
-}
-PATRON.retrieve_patron_by_barcode = retrieve_patron_by_barcode;
-PATRON.retrieve_patron = retrieve_patron_by_barcode;
-PATRON.retrieve_via_method = retrieve_patron_by_barcode;
-PATRON.refresh = retrieve_patron_by_barcode;
-
-function get_barcode() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- //mw.sdump('D_LEGACY','PATRON.au.array.length = ' + PATRON.au.array.length + '\n');
- //mw.sdump('D_LEGACY','get_barcode: PATRON.au = ' + js2JSON(PATRON.au) + '\n.cards() = ' + js2JSON(PATRON.au.cards()) + '\n.card() = ' + js2JSON(PATRON.au.card()) + '\n');
- //return find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
- return PATRON.au.card().barcode();
- } catch(E) {
- mw.sdump('D_LEGACY','get_barcode() error == ' + js2JSON(E) + '\n');
- return '';
- }
-}
-PATRON.barcode = get_barcode;
-
-function validate_patron() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- //mw.sdump('D_LEGACY','validate_patron: PATRON.au = ' + js2JSON(PATRON.au) + '\nPATRON.au.array.length = ' + PATRON.au.array.length + '\n');
- var s = '';
- if ( PATRON.barcode() == 'REQUIRED') {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_barcode_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('Barcode required\n');
- }
- if ( ! PATRON.au.usrname() ) {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_usrname_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('Login Name required\n');
- }
-
- if ( ! PATRON.au.family_name() ) {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_family_name_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('Family Name required\n');
- }
- if ( ! PATRON.au.first_given_name() ) {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_first_given_name_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('First Given Name required\n');
- }
- if ( ! PATRON.au.ident_value() ) {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_id1value_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('Identification required\n');
- }
- if ( ! PATRON.au.dob() ) {
- if (!s) {
- var textbox = document.getElementById( 'patron_edit_system_dob_textbox' );
- textbox.select(); textbox.focus();
- }
- s += ('Date of Birth required\n');
- } else {
- var date = PATRON.au.dob();
- var flag = false;
- var darray = date.split('-');
- var year = darray[0]; if ( (!year) || (year.length != 4) || (!parseInt(year)) ) flag = true;
- var month = darray[1]; if ( (!month) || (month.length !=2) || (!parseInt(month)) ) flag = true;
- var day = darray[2]; if ( (!day) || (day.length !=2) || (!parseInt(day)) ) flag = true;
- if (flag) {
- s += ('Date Format is YYYY-MM-DD\n');
- }
- if (!valid_year_month_day(year,month,day)) {
- s += ('Invalid Date\n');
- }
- }
- if ( ! PATRON.au.mailing_address() ) {
- s += ('Mailing Address required\n');
- }
- if ( ! PATRON.au.billing_address() ) {
- s += ('Billing Address required\n');
- }
- if (s) {
- mw.sdump('D_LEGACY',s); alert(s); return false;
- }
- return true;
-}
-
-function backup_patron(P) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- backup_au = P.au.clone();
-}
-
-function restore_patron(P) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- P.au = backup_au.clone();
- //hash_ac[ P.au.card() ] = find_id_object_in_list( P.au.cards(), P.au.card() );
- hash_ac[ P.au.card().id() ] = P.au.card();
- hash_au[ P.au.id() ] = P.au;
-}
-
-function save_patron() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','Entering PATRON.save()\n\n=-=-=-=-=-=-=-=\n\n');
- mw.sdump('D_LEGACY','PATRON.au = ' + js2JSON(PATRON.au) + '\n');
- mw.sdump('D_LEGACY','PATRON.au.a.length = ' + PATRON.au.a.length + '\n\n');
- //var backup_json = js2JSON(PATRON.au);
- //mw.sdump('D_LEGACY','backup_json = ' + backup_json + '\n\n');
- backup_patron(PATRON);
- mw.sdump('D_LEGACY','\n\n=-=-=-=-=-=-=-=-=-=-\n\n');
- check_for_new_addresses();
- check_for_new_stat_cats();
- if (! validate_patron() ) {
- mw.sdump('D_LEGACY','restoring backup\n');
- restore_patron(PATRON);
- return false;
- }
- if (! PATRON.au.usrname() ) {
- PATRON.au.usrname(
- PATRON.barcode()
- );
- }
- PATRON.au.survey_responses( response_list );
- mw.sdump('D_LEGACY','before PATRON.au = ' + js2JSON(PATRON.au) + '\n');
- var result;
- try {
- result = mw.user_request(
- 'open-ils.actor',
- 'open-ils.actor.patron.update',
- [ mw.G.auth_ses[0], PATRON.au ]
- );
- if (typeof(result[0]) != 'object') {
- mw.sdump('D_LEGACY','unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
- throw('unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
- }
- } catch(E) {
- mw.sdump('D_LEGACY','error in \n' + js2JSON(E) + '\n');
- mw.sdump('D_LEGACY','restoring backup 2\n');
- restore_patron(PATRON);
- mw.handle_error(E);
- //mw.sdump('D_LEGACY','PATRON.au = ' + js2JSON(PATRON.au) + '\nPATRON.au.a.length = ' + PATRON.au.a.length + '\n');
- //PATRON.summary_refresh();
- return false;
- }
- PATRON.au = result[0];
- if (! PATRON.au) {
- mw.sdump('D_LEGACY','Restoring backup\n');
- restore_patron(PATRON);
- mw.handle_error('Save Failed');
- return;
- }
- hash_aua = {};
- response_list = [];
- mw.sdump('D_LEGACY','after PATRON.au = ' + js2JSON(PATRON.au) + '\n');
- //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
- PATRON.summary_refresh();
- patron_callback('save', { 'au' : PATRON.au });
- var refresh_result = PATRON.related_refresh(PATRON.au.id());
- alert('Patron successfully updated.');
- return refresh_result;
-}
-PATRON.save = save_patron;
-
-function check_for_new_addresses() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- for (var id in hash_aua) {
- if ( (id < 0) && ( hash_aua[id].ischanged() ) ) {
- mw.sdump('D_LEGACY','Pushing new address\n');
- if (!PATRON.au.addresses()) { PATRON.au.addresses( [] ); }
- PATRON.au.addresses().push( hash_aua[id] );
- }
- }
-}
-
-function check_for_new_stat_cats() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var entries = new Array();
- var grid = document.getElementById('patron_edit_stat_cat_grid');
- var nl = grid.getElementsByTagName('menulist');
- for (var i = 0; i < nl.length; i++) {
- var menulist = nl[i];
- if (menulist.getAttribute('original') != menulist.value) {
- var n_actscecm = new actscecm();
- var id = menulist.getAttribute('entry_id')
- //alert('check_for_new_stat_cats: id = ' + id );
- if (id) {
- n_actscecm.ischanged('1');
- n_actscecm.id( id );
- } else {
- n_actscecm.isnew('1');
- n_actscecm.id( new_id-- );
- }
- n_actscecm.stat_cat( menulist.getAttribute('stat_cat_id') );
- n_actscecm.stat_cat_entry( menulist.value );
- n_actscecm.target_usr( PATRON.au.id() );
- entries.push( n_actscecm );
- }
-
- }
- //alert( 'entries = ' + js2JSON( entries ) );
- PATRON.au.stat_cat_entries( entries );
-}
-
-function retrieve_patron_related_info(id) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- if (!id) { id = PATRON.au.id(); }
- mw.sdump('D_LEGACY','Entering PATRON.related_refresh() with id: ' + id + '\n');
- /*
- var checkouts = [];
- if (id > 0) {
- try {
- checkouts = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.actor.user.checked_out',
- [ mw.G.auth_ses[0], id ]
- )[0];
- } catch(E) {
- mw.handle_error(E);
- }
- }
- PATRON.checkouts = checkouts;
- PATRON.nearest_due = '';
- for (var i in checkouts) {
- var checkout = checkouts[i];
- mw.sdump('D_LEGACY','checkout = ' + js2JSON(checkout) + '\n');
- }
- PATRON.holds = [];
- PATRON.bills = [];
- PATRON.summary_refresh();
- try {
- //circ_init_list();
- } catch(E) {
- mw.sdump('D_LEGACY',js2JSON(E) + '\n');
- }
- patron_callback('related_refresh');
- */
- return true;
-}
-PATRON.related_refresh = retrieve_patron_related_info;
-
-/* patron_scan_overlay functions */
-
-function patron_callback(s,params) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- try {
- switch(s) {
- case 'scan_submit' : return patron_scan_submit_callback(params); break;
- case 'related_refresh' : return patron_related_refresh_callback(params); break;
- case 'retrieve_patron' : return patron_retrieve_patron_callback(params); break;
- case 'save' : return patron_save_callback(params); break;
- default : return patron_default_callback(s,params); break;
- }
- } catch(E) {
- /* assume no callback defined */
- return true;
- }
-}
-
-function patron_advanced_button(ev) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var deck = document.getElementById('patron_scan_deck');
- if (deck) { deck.setAttribute('selectedIndex','2'); }
- focus_widget( 'patron_search_family_name_textbox' );
- deck = document.getElementById('circ_deck_deck');
- if (deck) { deck.setAttribute('selectedIndex','6'); }
- //PATRON.search = {};
-}
-PATRON.advanced_search = patron_advanced_button;
-
-function patron_scan_submit(ev) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','Entering PATRON.scan_submit() with target: ' + ev.target + '\n');
- try {
- var rc = PATRON.retrieve_patron( document.getElementById('patron_scan_textbox').value );
- if (rc) {
- /* the PATRON object should already be updated. Switch deck if there is one */
- var deck = document.getElementById('patron_scan_deck');
- if (deck) { deck.setAttribute('selectedIndex','1'); }
- patron_callback('scan_submit');
- /* enable the scan item widgets if there are some */
- enable_widgets(
- 'circ_checkout_scan_search_button',
- 'circ_checkout_scan_textbox',
- 'circ_checkout_scan_submit_button'
- );
- focus_widget( 'circ_checkout_scan_textbox' );
- } else {
- throw('retrieve_patron return code == false');
- }
- } catch(E) {
- mw.sdump('D_LEGACY','Could not retrieve patron. Invalid barcode?\n' + js2JSON(E) + '\n');
- alert('Could not retrieve patron. Invalid barcode?\n' + js2JSON(E) + '\n');
- }
-}
-PATRON.scan_submit = patron_scan_submit;
-
-function patron_scan_search(ev) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','Entering PATRON.scan_search() with target: ' + ev.target + '\n');
- //mw.sdump('D_LEGACY','PATRON.search = ' + pretty_print(js2JSON(PATRON.search)) + '\n');
- try {
- var result = mw.user_request(
- 'open-ils.actor',
- 'open-ils.actor.patron.search.advanced',
- [ mw.G.auth_ses[0], PATRON.search ]
- )[0];
- mw.sdump('D_LEGACY','result = ' + js2JSON(result) + '\n');
- PATRON['search_results'] = result;
- build_patron_search_result_deck();
- } catch(E) {
- mw.handle_error(E);
- }
-}
-PATRON.scan_search = patron_scan_search;
-
-/* patron_summary_overlay functions */
-
-function make_barcode_handler(card_id,user_id) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- return function (ev) {
- magic_field_edit(ev,'ac',card_id,'barcode');
- PATRON.au.ischanged('1');
- magic_field_edit(ev,'au',user_id,'usrname');
- var usr_e = document.getElementById('patron_edit_system_usrname_textbox');
- if (usr_e) {
- usr_e.value = ev.target.value;
- }
- /*ev.target.removeEventListener(
- "change",
- this,
- false
- );*/
- }
-}
-
-function patron_summary_refresh(ev) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- //alert( mw.arg_dump(arguments) );
- // This function needs to be broken up.. it sets the patron edit section as well
- if (!PATRON.au) { return; }
- mw.sdump('D_LEGACY','Entering PATRON.summary_refresh()\n');
- hash_au[PATRON.au.id()] = PATRON.au;
- //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
- /* just redraw the display with the PATRON object as is */
- var barcode_e = document.getElementById('patron_edit_system_barcode_textbox');
- var newcard_e = document.getElementById('patron_new_card_button');
- if (barcode_e) {
- //var barcode_v = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card());
- var barcode_v = PATRON.au.card();
- if (barcode_v) {
- barcode_e.value = barcode_v.barcode();
- if (barcode_e.value != 'REQUIRED') {
- barcode_e.disabled = true;
- newcard_e.hidden = false;
- barcode_e.addEventListener(
- 'change',
- function (ev) {
- PATRON.au.card().barcode( ev.target.value );
- },
- false
- );
- } else {
- barcode_e.addEventListener(
- "change",
- make_barcode_handler(barcode_v.id(),PATRON.au.id()),
- false
- );
- }
- }
- }
- var usrname_e = document.getElementById('patron_edit_system_usrname_textbox');
- if (usrname_e) {
- if (PATRON.au.usrname()) usrname_e.value = PATRON.au.usrname();
- usrname_e.setAttribute("onchange",
- "magic_field_edit(event,'au'," + PATRON.au.id() + ",'usrname');");
- }
- var passwd_e = document.getElementById('patron_edit_system_new_passwd_textbox');
- if (passwd_e) {
- passwd_e.setAttribute("onchange",
- "magic_field_edit(event,'au'," + PATRON.au.id() + ",'passwd');");
- }
- var name_e = document.getElementById('patron_status_caption');
- if (name_e) {
- var name = '';
- if (PATRON.au.prefix()) { name += PATRON.au.prefix() + ' '; }
- if (PATRON.au.family_name()) { name += PATRON.au.family_name() + ', '; }
- if (PATRON.au.first_given_name()) { name += PATRON.au.first_given_name() + ' '; }
- if (PATRON.au.second_given_name()) { name += PATRON.au.second_given_name() + ' '; }
- if (PATRON.au.suffix()) { name += PATRON.au.suffix(); }
-
- name_e.setAttribute('label',name);
- }
- name_e = document.getElementById('patron_edit_system_family_name_textbox');
- if (name_e) {
- if (PATRON.au.family_name()) { name_e.value = PATRON.au.family_name(); }
- name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'family_name');");
- }
- name_e = document.getElementById('patron_edit_system_first_given_name_textbox');
- if (name_e) {
- if (PATRON.au.first_given_name()) { name_e.value = PATRON.au.first_given_name(); }
- name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'first_given_name');");
- }
- name_e = document.getElementById('patron_edit_system_second_given_name_textbox');
- if (name_e) {
- if (PATRON.au.second_given_name()) { name_e.value = PATRON.au.second_given_name(); }
- name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'second_given_name');");
- }
- name_e = document.getElementById('patron_edit_system_prefix_menulist');
- if (name_e) {
- if (PATRON.au.prefix()) { name_e.value = PATRON.au.prefix(); }
- name_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'prefix');");
- }
- name_e = document.getElementById('patron_edit_system_suffix_menulist');
- if (name_e) {
- if (PATRON.au.suffix()) { name_e.value = PATRON.au.suffix(); }
- name_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'suffix');");
- }
- var disable_e = document.getElementById('patron_edit_system_disable_checkbox');
- if (disable_e) {
- disable_e.checked = (PATRON.au.active() != 1);
- disable_e.setAttribute("oncommand","try{PATRON.au.ischanged('1'); if (PATRON.au.active() == 1) {PATRON.au.active('0');} else {PATRON.au.active('1');}}catch(E){alert(E);}");
- }
- var profile_e = document.getElementById('patron_status_data_profile');
- if (profile_e) {
- //profile_e.setAttribute('value',find_id_object_in_list(mw.G.ap_list, PATRON.au.profile() ).name() );
- profile_e.setAttribute('value',mw.G.ap_hash[ PATRON.au.profile() ].name() );
- }
- profile_e = document.getElementById('patron_edit_system_profile_menulist');
- if (profile_e) {
- //hash_ap[PATRON.au.profile().id()] = PATRON.au.profile();
- profile_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'profile');");
- set_patron_edit_profile_menu();
- }
- var email_e = document.getElementById('patron_edit_contact_email_textbox');
- if (email_e) {
- if (PATRON.au.email()) email_e.value = PATRON.au.email();
- email_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'email');");
- }
- var dayphone_e = document.getElementById('patron_contact_dayphone_data');
- if (dayphone_e) {
- if (PATRON.au.day_phone()) dayphone_e.setAttribute('value', PATRON.au.day_phone() );
- }
- dayphone_e = document.getElementById('patron_edit_contact_dayphone_textbox');
- if (dayphone_e) {
- if (PATRON.au.day_phone()) dayphone_e.value = PATRON.au.day_phone();
- dayphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'day_phone');");
- }
- var eveningphone_e = document.getElementById('patron_contact_eveningphone_data');
- if (eveningphone_e) {
- if (PATRON.au.evening_phone()) eveningphone_e.setAttribute('value', PATRON.au.evening_phone() );
- }
- eveningphone_e = document.getElementById('patron_edit_contact_eveningphone_textbox');
- if (eveningphone_e) {
- if (PATRON.au.evening_phone()) eveningphone_e.value = PATRON.au.evening_phone();
- eveningphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'evening_phone');");
- }
- var otherphone_e = document.getElementById('patron_contact_otherphone_data');
- if (otherphone_e) {
- if (PATRON.au.other_phone()) otherphone_e.setAttribute('value', PATRON.au.other_phone() );
- }
- otherphone_e = document.getElementById('patron_edit_contact_otherphone_textbox');
- if (otherphone_e) {
- if (PATRON.au.other_phone()) otherphone_e.value = PATRON.au.other_phone();
- otherphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'other_phone');");
- }
- var standing_e = document.getElementById('patron_status_data_standing');
- if (standing_e) {
- /*var standing = find_id_object_in_list(
- mw.G.cst_list,
- PATRON.au.standing()
- );*/
- var standing = mw.G.cst_hash[ PATRON.au.standing() ];
- mw.sdump('D_LEGACY','standing = ' + js2JSON(standing) + '\n');
- standing_e.setAttribute( 'value', standing.value() );
- if (standing.value() == 'Good') {
- addCSSClass(standing_e,'good');
- } else {
- removeCSSClass(standing_e,'good');
- }
- }
- var claims_returned_e = document.getElementById('patron_status_data_claims_returned');
- if (claims_returned_e) {
- claims_returned_e.setAttribute('value',PATRON.au.claims_returned_count());
- }
- var credit_e = document.getElementById('patron_status_data_credit');
- if (credit_e) {
- credit_e.setAttribute('value',PATRON.au.credit_forward_balance());
- }
- var homelib_e = document.getElementById('patron_status_data_homelib');
- if (homelib_e) {
- homelib_e.setAttribute('value',
- find_ou(
- mw.G.org_tree,
- PATRON.au.home_ou()
- ).name()
- );
- }
- homelib_e = document.getElementById('patron_edit_system_library_menulist');
- if (homelib_e) {
- homelib_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'home_ou',false);");
- set_patron_edit_library_menu();
- }
- var fees_e = document.getElementById('patron_status_data_fees');
- if (fees_e) {
- fees_e.setAttribute('value',PATRON.bills.length);
- }
- var checkouts_e = document.getElementById('patron_status_data_checkouts');
- if (checkouts_e) {
- checkouts_e.setAttribute('value',PATRON.checkouts.length);
- }
- var holds_e = document.getElementById('patron_status_data_holds');
- if (holds_e) {
- holds_e.setAttribute('value',PATRON.holds.length);
- }
- var nearest_due_e = document.getElementById('patron_status_data_nearest_due');
- if (nearest_due_e) {
- nearest_due_e.setAttribute('value',PATRON.nearest_due);
- }
- var id1value_e = document.getElementById('patron_edit_system_id1value_textbox');
- if (id1value_e) {
- if (PATRON.au.ident_value()) id1value_e.setAttribute('value',PATRON.au.ident_value());
- id1value_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_value');");
- }
- var id2value_e = document.getElementById('patron_edit_system_id2value_textbox');
- if (id2value_e) {
- if (PATRON.au.ident_value2()) id2value_e.setAttribute('value',PATRON.au.ident_value2());
- id2value_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_value2');");
- }
- var id1type_e = document.getElementById('patron_edit_system_id1type_menulist');
- if (id1type_e) {
- id1type_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_type');");
- set_patron_edit_ident_type_menu();
- }
- var id2type_e = document.getElementById('patron_edit_system_id2type_menulist');
- if (id2type_e) {
- id2type_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_type2');");
- set_patron_edit_ident_type_menu2();
- }
- var dob_e = document.getElementById('patron_edit_system_dob_textbox');
- if (dob_e) {
- if (PATRON.au.dob()) dob_e.setAttribute('value',PATRON.au.dob());
- dob_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'dob',false);");
- }
- //populate_patron_survey_grid('patron_survey_grid');
- populate_patron_survey_grid('patron_edit_survey_grid');
- populate_patron_edit_surveys();
-
- var address_rows = document.getElementById('patron_contact_address_rows');
- if (address_rows) {
- empty_widget(address_rows);
- var addresses = PATRON.au.addresses();
- for (var i in addresses) {
- if (typeof(addresses[i])=='object') {
- var address = addresses[i];
- if (
- (address.id() == PATRON.au.mailing_address()) ||
- (address.id() == PATRON.au.billing_address())
- ) {
- //mw.sdump('D_LEGACY','address dump: ' + i + ' : ' + addresses[i] + '\n');
- rows_append_address( address_rows, address, false );
- }
- }
- }
- }
- address_rows = document.getElementById('patron_edit_address_rows');
- if (address_rows) {
- empty_widget(address_rows);
- var addresses = PATRON.au.addresses();
- for (var i in addresses) {
- if (typeof(addresses[i])=='object') {
- //mw.sdump('D_LEGACY','address dump: ' + i + ' : ' + js2JSON(addresses[i]) + '\n');
- rows_append_address( address_rows, addresses[i], true );
- }
- }
- var blank = new aua();
- blank.id( new_id-- );
- blank.isnew("1");
- blank.usr( PATRON.au.id() );
- /*if ( addresses.length == 0 ) {*/
- if (hash_aua.length == 0) {
- blank.address_type( 'REQUIRED' );
- blank.ischanged( "1" );
- PATRON.au.mailing_address( blank.id() );
- PATRON.au.billing_address( blank.id() );
- } else {
- blank.address_type( 'NEW' );
- }
- blank.city( 'CITY' );
- blank.country( 'USA' );
- blank.county( 'COUNTY' );
- blank.post_code( 'ZIP' );
- blank.state( 'GA' );
- blank.street1( 'STREET1' );
- blank.street2( 'STREET2' );
- rows_append_address( address_rows, blank , true );
- }
-
- var alert_message_e = document.getElementById('patron_edit_system_alert_message_textbox');
- if (alert_message_e) {
- if (PATRON.au.alert_message()) alert_message_e.setAttribute('value',PATRON.au.alert_message());
- alert_message_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'alert_message',false);");
- }
- var stat_cats_e = document.getElementById('patron_statcat_rows');
- if (stat_cats_e) {
- try {
- empty_widget( stat_cats_e );
- for (var i = 0; i < PATRON.au.stat_cat_entries().length; i++) {
-
- // fieldmapper
- var entry = PATRON.au.stat_cat_entries()[i];
- var stat_cat = mw.G.actsc_hash[ entry.stat_cat() ];
-
- // build XUL
- var row = document.createElement('row');
- stat_cats_e.appendChild(row);
- var sc_label = document.createElement('label');
- row.appendChild(sc_label);
- var sce_label = document.createElement('label');
- row.appendChild(sce_label);
-
- // set values
- sc_label.setAttribute('value', stat_cat.name() );
- sce_label.setAttribute('value', entry.stat_cat_entry() );
- }
- } catch(E) {
- mw.handle_error(E);
- }
- }
- stat_cats_e = document.getElementById('patron_edit_stat_cat_grid');
- if (stat_cats_e) {
- //alert('stat_cats_e');
- try {
- //alert('in try');
- for (var i = 0; i < PATRON.au.stat_cat_entries().length; i++) {
- var entry = PATRON.au.stat_cat_entries()[i];
- //alert('entry = ' + js2JSON(entry) );
- var stat_cat = entry.stat_cat();
- if (typeof stat_cat == 'object') stat_cat = stat_cat.id();
- var menulist = document.getElementById('menulist_stat_cat_' + stat_cat);
- if (menulist) {
-
- //alert('menulist');
-
- menulist.value = entry.stat_cat_entry();
- menulist.setAttribute( 'original', menulist.value );
- menulist.setAttribute( 'entry_id', entry.id() );
- //alert('summary_refresh: entry.id() = ' + entry.id() );
-
- }
- }
- } catch(E) {
- mw.handle_error(E);
- }
- }
- /*
- if (PATRON.au.alert_message()) {
- snd_bad(); snd_bad();
- s_alert(
- 'PATRON ALERT MESSAGE\n\n\n\n' +
- PATRON.au.alert_message() +
- '\n\n\n\nTo remove this alert permanently, Edit the patron and erase the message in "Alert Message".\n\n'
- );
- }
- */
-}
-PATRON.summary_refresh = patron_summary_refresh;
-
-function rows_append_address( rows, address, edit ) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
-
-
- // patron_summary
-
- //mw.sdump('D_LEGACY','Entering rows_append_address()\n');
- if (typeof(rows) != 'object') {
- rows = document.getElementById(box);
- }
- if (typeof(rows) != 'object') {
- mw.sdump('D_LEGACY','rows_append_address: could not find ' + rows + '\n');
- alert('rows_append_address: could not find ' + rows + '\n');
- return false;
- }
- var row = document.createElement('row');
- //row.setAttribute('id','row_address_'+yesno(edit)+address.id());
- hash_aua[ address.id() ] = address;
- rows.appendChild(row);
- var groupbox = document.createElement('groupbox');
- if (edit) {
- groupbox.setAttribute('id','groupbox_address_'+address.id());
- } else {
- groupbox.setAttribute('id','groupbox_summary_address_'+address.id());
- }
- groupbox.setAttribute('flex','1');
- row.appendChild(groupbox);
- var caption = document.createElement('caption');
- var caption_string = address.address_type();
- if ( PATRON.au.mailing_address() == address.id() ) {
- caption_string = '(MAILING) ' + caption_string;
- }
- if ( PATRON.au.billing_address() == address.id() ) {
- caption_string = '(PHYSICAL) ' + caption_string;
- }
- caption.setAttribute( 'label',caption_string );
- groupbox.appendChild(caption);
-
- // patron_edit
-
- if (edit) {
- var hbox = document.createElement('hbox');
- groupbox.appendChild(hbox);
- var label = document.createElement('label');
- label.setAttribute('value','Type:');
- hbox.appendChild(label);
- var textbox = document.createElement('textbox');
- textbox.setAttribute('size','20');
- textbox.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'address_type');");
- hbox.appendChild(textbox);
- textbox.value = address.address_type();
- var label2 = document.createElement('label');
- label2.setAttribute('value','Physical:');
- hbox.appendChild(label2);
- var checkbox_billing = document.createElement('checkbox');
- checkbox_billing.setAttribute('group','billing');
- checkbox_billing.setAttribute('oncommand','radio_checkbox(event); PATRON.au.billing_address(' + address.id() + '); PATRON.au.ischanged("1");');
- hbox.appendChild(checkbox_billing);
- if ( PATRON.au.billing_address() == address.id() ) {
- checkbox_billing.checked = true;
- }
- var label3 = document.createElement('label');
- label3.setAttribute('value','Mailing:');
- hbox.appendChild(label3);
- var checkbox_mailing = document.createElement('checkbox');
- checkbox_mailing.setAttribute('group','mailing');
- checkbox_mailing.setAttribute('oncommand','radio_checkbox(event); PATRON.au.mailing_address(' + address.id() + '); PATRON.au.ischanged("1");');
- hbox.appendChild(checkbox_mailing);
- if ( PATRON.au.mailing_address() == address.id() ) {
- checkbox_mailing.checked = true;
- }
- var label4 = document.createElement('label');
- label4.setAttribute('value','Invalid:');
- hbox.appendChild(label4);
- var checkbox_invalid = document.createElement('checkbox');
- checkbox_invalid.setAttribute('oncommand','invalid_checkbox(event,' + address.id() + ');');
- hbox.appendChild(checkbox_invalid);
- mw.sdump('D_LEGACY','address ' + address.id() + ' valid = ' + address.valid() + '\n');
- if ( address.valid() == '1' || address.valid() == 't' ) {
- checkbox_invalid.checked = false;
- } else {
- checkbox_invalid.checked = true;
- }
- var label5 = document.createElement('spacer');
- label5.setAttribute('flex','1');
- hbox.appendChild(label5);
- if (address.id()>-1) {
- var label6 = document.createElement('button');
- label6.setAttribute('label','Delete');
- label6.setAttribute('alt_label','Un-Delete');
- label6.setAttribute('toggle','0');
- label6.setAttribute('oncommand','toggle_address(event,' + address.id() + ');');
- hbox.appendChild(label6);
- }
- }
- var street1;
- if (edit) {
- street1 = document.createElement('textbox');
- street1.setAttribute('size','40');
- street1.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'street1');");
- } else {
- street1 = document.createElement('label');
- }
- street1.setAttribute( 'value',address.street1() );
- groupbox.appendChild(street1);
- var street2;
- if (edit) {
- street2 = document.createElement('textbox');
- street2.setAttribute('size','40');
- street2.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'street2');");
- } else {
- street2 = document.createElement('label');
- }
- street2.setAttribute( 'value',address.street2() );
- groupbox.appendChild(street2);
- var hbox = document.createElement('hbox');
- groupbox.appendChild(hbox);
- var city;
- if (edit) {
- city = document.createElement('textbox');
- city.setAttribute('size','20');
- city.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'city');");
- } else {
- city = document.createElement('label');
- }
- city.setAttribute( 'value',address.city() );
- hbox.appendChild(city);
- var county;
- if (edit) {
- county = document.createElement('textbox');
- county.setAttribute('size','20');
- county.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'county');");
- county.setAttribute( 'value',address.county() );
- } else {
- county = document.createElement('label');
- county.setAttribute( 'value','(' + address.county() + '),');
- }
- hbox.appendChild(county);
- if (!address.county()) {
- if (!edit) {
- county.setAttribute( 'display', 'none' );
- city.setAttribute( 'value',address.city() + ',' );
- }
- }
- var state;
- if (edit) {
- state = document.createElement('textbox');
- state.setAttribute('size','2');
- state.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'state');");
- } else {
- state = document.createElement('label');
- }
- state.setAttribute( 'value',address.state() );
- hbox.appendChild(state);
- var country;
- if (edit) {
- country = document.createElement('textbox');
- country.setAttribute('size','3');
- country.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'country');");
- country.setAttribute( 'value',address.country() );
- } else {
- country = document.createElement('label');
- country.setAttribute( 'value','(' + address.country() + '),');
- }
- hbox.appendChild(country);
- var zip;
- if (edit) {
- zip = document.createElement('textbox');
- zip.setAttribute('size','10');
- zip.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'post_code');");
- } else {
- zip = document.createElement('label');
- }
- zip.setAttribute( 'value',address.post_code() );
- hbox.appendChild(zip);
-}
-
-function invalid_checkbox(e,id) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- if (e.target.checked) {
- mw.sdump('D_LEGACY','Marking address ' + id + ' invalid\n');
- mw.sdump('D_LEGACY','\tbefore address: ' + js2JSON(hash_aua[id]) + '\n');
- //hash_aua[id].valid( '0' );
- hash_aua[id].valid( 'f' );
- hash_aua[id].ischanged( '1' );
- mw.sdump('D_LEGACY','\tafter address: ' + js2JSON(hash_aua[id]) + '\n');
- } else {
- mw.sdump('D_LEGACY','Marking address ' + id + ' valid\n');
- mw.sdump('D_LEGACY','\tbefore address: ' + js2JSON(hash_aua[id]) + '\n');
- //hash_aua[id].valid( '1' );
- hash_aua[id].valid( 't' );
- hash_aua[id].ischanged( '1' );
- mw.sdump('D_LEGACY','\tafter address: ' + js2JSON(hash_aua[id]) + '\n');
- }
-}
-
-function toggle_address(e,id) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var groupbox = document.getElementById('groupbox_address_' + id);
- //var address = find_id_object_in_list( hash_aua, id );
- var address = hash_aua[id];
- var button = e.target;
- var label = button.getAttribute('label');
- var alt_label = button.getAttribute('alt_label');
- button.setAttribute('label',alt_label);
- button.setAttribute('alt_label',label);
- var toggle = button.getAttribute('toggle');
- if (toggle == '0') {
- button.setAttribute('toggle','1');
- mw.sdump('D_LEGACY','original node = ' + js2JSON(address) + '\n');
- addCSSClass(groupbox,'deleted_address');
- address.isdeleted('1');
- mw.sdump('D_LEGACY','updated node = ' + js2JSON(address) + '\n');
- mw.sdump('D_LEGACY','PATRON.au.mailing_address() = ' + PATRON.au.mailing_address() + ' address.id() = ' + address.id() + '\n');
- if (PATRON.au.mailing_address() == address.id() ) {
- find_available_address_for('mailing_address');
- }
- mw.sdump('D_LEGACY','PATRON.au.billing_address() = ' + PATRON.au.billing_address() + ' address.id() = ' + address.id() + '\n');
- if (PATRON.au.billing_address() == address.id() ) {
- find_available_address_for('billing_address');
- }
- } else {
- button.setAttribute('toggle','0');
- mw.sdump('D_LEGACY','original node = ' + js2JSON(address) + '\n');
- removeCSSClass(groupbox,'deleted_address');
- address.isdeleted('0');
- mw.sdump('D_LEGACY','updated node = ' + js2JSON(address) + '\n');
- }
- var nl = groupbox.getElementsByTagName('textbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- var t = nl[i];
- t.disabled = ! t.disabled;
- }
- }
-}
-
-function find_available_address_for(which) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','entering find_avialable_address_for(' + which + ')\n');
- var addresses = PATRON.au.addresses();
- mw.sdump('D_LEGACY','considering existing addresses...\n');
- for (var i in addresses) {
- var address = addresses[i];
- mw.sdump('D_LEGACY','i = ' + i + ' addresses[i] = ' + js2JSON(address) + '\n');
- if ( address.isdeleted() == '1') { continue; }
- if ( (address.address_type() == 'NEW') && (address.id() < 0) ) {
- address.address_type('REQUIRED');
- address.ischanged( '1' );
- }
- mw.sdump('D_LEGACY','PATRON.au before = ' + js2JSON(PATRON.au) + '\n');
- var command = 'PATRON.au.' + which + "( '" + address.id() + "' );";
- mw.sdump('D_LEGACY', command + '\n' );
- eval( command );
- mw.sdump('D_LEGACY','PATRON.au after = ' + js2JSON(PATRON.au) + '\n');
- return true;
- }
- mw.sdump('D_LEGACY','considering old and new addresses...\n');
- for (var i in hash_aua) {
- var address = hash_aua[i];
- mw.sdump('D_LEGACY','i = ' + i + ' addresses[i] = ' + js2JSON(address) + '\n');
- if ( address.isdeleted() == '1') { continue; }
- if ( (address.address_type() == 'NEW') && (address.id() < 0) ) {
- address.address_type('REQUIRED');
- address.ischanged( '1' );
- }
- mw.sdump('D_LEGACY','PATRON.au before = ' + js2JSON(PATRON.au) + '\n');
- var command = 'PATRON.au.' + which + "( '" + address.id() + "' );";
- mw.sdump('D_LEGACY', command + '\n' );
- eval( command );
- mw.sdump('D_LEGACY','PATRON.au after = ' + js2JSON(PATRON.au) + '\n');
- return true;
- }
-}
-
-function survey_test(ev,survey_id) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
-
- document.getElementById('circ_deck_deck').setAttribute('selectedIndex','5');
- var vbox = document.getElementById('patron_survey_vbox');
- empty_widget( vbox );
- survey_render_with_results(
- vbox,
- survey_id,
- function (survey) {
- return PATRON.refresh();
- }
- );
-}
-
-function populate_patron_edit_surveys() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var vbox = document.getElementById('patron_edit_survey_vbox');
- if (!vbox) return;
-
- mw.sdump('D_LEGACY','populate_patron_edit_surveys()\n');
-
- empty_widget( vbox );
-
- var surveys = [];
- try {
- surveys = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.survey.retrieve.required',
- [ mw.G.auth_ses[0] ]
- )[0];
- } catch(E) {
- mw.handle_error(E);
- }
-
- for (var i = 0; i < surveys.length; i++) {
- var survey = surveys[i];
- survey_render(
- vbox,
- survey.id(),
- populate_patron_edit_surveys_build_callback( survey ),
- null
- );
- }
-}
-
-function populate_patron_edit_surveys_build_callback( survey ) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- return function (responses) {
- for (var i in responses) {
- response_list.push( responses[i] );
- }
- var nframe = document.getElementById('patron_survey_frame_'+survey.id());
- nframe.hidden = true;
- var complete = document.createElement('description');
- complete.setAttribute('value',survey.name() + ' Complete');
- nframe.parentNode.insertBefore( complete, nframe );
- //nframe.contentWindow.document.body.innerHTML = '<h1>' + survey.name() + ' Complete</h1>';
- return true;
- };
-}
-
-
-function survey_render(vbox,survey_id,commit_callback,submit_callback) {
- sdump('D_LEGACY',arg_dump(arguments));
- if (typeof(vbox) != 'object') { vbox = document.getElementById(vbox); }
- var frame = document.createElement('vbox');
- vbox.appendChild(frame);
- //frame.setAttribute('flex','1'); frame.setAttribute('src','data:text/html,<html><head><LINK href="http://spacely.georgialibraries.org/css/box.css" rel="stylesheet" type="text/css"><LINK href="http://spacely.georgialibraries.org/css/survey.css" rel="stylesheet" type="text/css"></head><body></body></html>');
-
- setTimeout(function(){
- /*var doc = frame.contentWindow.document;*/
- var doc = document;
- window.createAppElement = function (name) { return doc.createElementNS('http://www.w3.org/1999/xhtml','html:'+name); }
- window.createTextNode = function (value) { return doc.createTextNode(value); }
- Survey.retrieveById(
- mw.G.auth_ses[0] ,
- survey_id,
- function(sur) {
- sur.setUser( PATRON.au.id() );
- if (submit_callback) sur.setSubmitCallback( submit_callback );
- if (commit_callback) sur.commitCallback = commit_callback;
- mw.sdump('D_LEGACY','survey id: ' + sur.survey.id() + '\n');
-
- var node = sur.getNode();
-
- try {
- dump( super_dump( node ) );
- } catch(E) {
- dump( js2JSON(E) );
- }
-
- frame.appendChild( node );
- /*frame.setAttribute('style','height: ' + (30+doc.height) + 'px;');*/
- frame.setAttribute('id','patron_survey_frame_' + sur.survey.id());
- }
- );
- },0);
-}
-
-function survey_render_with_results(vbox,survey_id,callback) {
- sdump('D_LEGACY',arg_dump(arguments));
- if (typeof(vbox) != 'object') { vbox = document.getElementById(vbox); }
- var frame = document.createElement('vbox');
- vbox.appendChild(frame);
- //frame.setAttribute('id','patron_survey_frame');
- //frame.setAttribute('flex','1'); frame.setAttribute('src','data:text/html,<html><head><LINK href="http://spacely.georgialibraries.org/css/box.css" rel="stylesheet" type="text/css"><LINK href="http://spacely.georgialibraries.org/css/survey.css" rel="stylesheet" type="text/css"></head><body></body></html>');
- //var doc = frame.contentWindow.document;
- var doc = document;
- //HTMLdoc = doc;
- window.createAppElement = function (name) { return doc.createElementNS('http://www.w3.org/1999/xhtml','html:'+name); }
- window.createTextNode = function (value) { return doc.createTextNode(value); }
- Survey.retrieveById(
- mw.G.auth_ses[0] ,
- survey_id,
- function(sur) {
- sur.setUser( PATRON.au.id() );
- sur.setSubmitCallback( callback );
- mw.sdump('D_LEGACY','survey id: ' + sur.survey.id() + '\n');
- frame.appendChild( sur.getNode() );
- var span = doc.createElement('html:blockquote');
- span.setAttribute('id','survey_response_' + sur.survey.id());
- span.setAttribute('class','survey');
- var warning = doc.createTextNode('Retrieving Responses...');
- span.appendChild(warning);
- frame.appendChild(span);
- mw.user_async_request(
- 'open-ils.circ',
- 'open-ils.circ.survey.response.retrieve',
- [ mw.G.auth_ses[0], sur.survey.id(), PATRON.au.id() ],
- function (request) {
- result = request.getResultObject().reverse();
- span.removeChild( warning );
- if (result.length == 0) { return; }
- //span.appendChild( doc.createTextNode('Previous Responses:') );
- //span.appendChild( doc.createElement('html:br') );
- //span.setAttribute('style','border: black solid thin;');
- var num_of_q = sur.survey.questions().length;
- var current_q = 0;
- span.appendChild( doc.createTextNode(
- 'Previous Responses:'
- ) );
- span.appendChild( doc.createElement('html:br') );
- span.appendChild( doc.createElement('html:br') );
- var block;
- for (var i = 0; i < result.length; i++) {
- if (++current_q > num_of_q) { current_q = 1; }
- mw.sdump('D_LEGACY','current_q = ' + current_q + ' num_of_q = ' + num_of_q + '\n');
- if (current_q == 1) {
- block = doc.createElement('html:blockquote');
- span.appendChild( doc.createTextNode(
- 'Answer Date: ' +
- result[i].answer_date() +
- ', Effective Date: ' +
- result[i].effective_date()
- ) );
- span.appendChild( doc.createElement('html:br') );
- span.appendChild(block);
- }
- block.appendChild(
- doc.createTextNode(
- current_q + ') ' +
- find_id_object_in_list(
- find_id_object_in_list(
- sur.survey.questions(),
- result[i].question()
- ).answers(),
- result[i].answer()
- ).answer() + ' '
- )
- );
- }
- span.appendChild( doc.createElement('html:br') );
- /*frame.setAttribute('style','height: ' + (30+doc.height) + 'px;');*/
- }
- );
- }
- );
-}
-
-
-function handle_patron_search_textbox(ev,group) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var id = ev.target.getAttribute('id');
- var field = id.split(/_/).slice(2,-1).join('_');
- mw.sdump('D_LEGACY','field = ' + field + ' value = ' + ev.target.value + '\n');
- PATRON.search[field] = { 'value' : ev.target.value, 'group' : group };
-}
-
-function build_patron_search_result_deck() {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- var label = document.getElementById('patron_search_results_label');
- if (label) {
- var s = 'Found ' + PATRON.search_results.length + ' matches. ';
- if (PATRON.search_results.length > patron_hits_per_page) {
- s += 'Displaying ' + patron_hits_per_page + ' per page:';
- }
- label.setAttribute('value',s);
- }
- var deck = document.getElementById('patron_search_results_deck');
- if (!deck) return;
-
- empty_widget(deck);
-
- var patron_ids = PATRON.search_results.slice(0,patron_hits_per_page);
- PATRON.search_results = PATRON.search_results.slice(patron_hits_per_page);
- build_patron_search_result_page(deck,patron_ids,PATRON.search_results.length);
-}
-
-function build_patron_search_result_page(deck,patron_ids,remaining) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- mw.sdump('D_LEGACY','build_patron_search_result_page()\n');
- if (typeof(deck)!='object') deck = document.getElementById(deck);
- if (!deck) return;
-
- if (patron_ids.length == 0) return;
-
- var vbox = document.createElement('vbox');
- deck.appendChild(vbox);
- vbox.setAttribute('flex','1');
-
- var idx = deck.childNodes.length - 1;
- deck.selectedIndex = idx;
-
- var button_box = document.createElement('hbox');
- vbox.appendChild(button_box);
-
- var back_button = document.createElement('button');
- button_box.appendChild(back_button);
- back_button.setAttribute('label','Previous');
- back_button.disabled = true;
- if (idx > 0) {
- back_button.disabled = false;
- back_button.setAttribute('oncommand',"var deck = document.getElementById('patron_search_results_deck'); deck.selectedIndex = deck.selectedIndex -1;");
- }
- var forward_button = document.createElement('button');
- button_box.appendChild(forward_button);
- forward_button.setAttribute('label','Next');
- forward_button.disabled = true;
- if (remaining > 0) {
- forward_button.disabled = false;
- forward_button.addEventListener(
- 'command',
- function (ev) {
- var fired = ev.target.getAttribute('fired');
-
- if (fired) {
- deck.selectedIndex = idx + 1;
- } else {
- var next_ids = PATRON.search_results.slice(0,patron_hits_per_page);
- PATRON.search_results = PATRON.search_results.slice(patron_hits_per_page);
- build_patron_search_result_page(deck,next_ids,PATRON.search_results.length);
- ev.target.setAttribute('fired',true);
- }
- },
- false
- );
- }
- var tree = document.createElement('tree');
- vbox.appendChild(tree);
- tree.setAttribute('flex','1');
- tree.setAttribute('enableColumnDrag','true');
- tree.addEventListener(
- 'select',
- function (ev) {
- var row = get_list_from_tree_selection(ev.target)[0];
- if (row) {
- var patron_id = row.getAttribute('patron_id');
- if (patron_id) {
- PATRON.retrieve_via_method( patron_id, 'open-ils.actor.user.fleshed.retrieve' );
- circ_init();
- set_decks( { 'patron_scan_deck' : '1' } );
- focus_widget( row.parentNode );
- }
- }
- },
- false
- );
-
- var t_columns = document.createElement('treecols');
- tree.appendChild(t_columns);
-
- for (var i = 0; i < patron_list_columns.length; i++) {
- var column = patron_list_columns[i];
- var t_column = document.createElement('treecol');
- t_columns.appendChild( t_column );
- t_column.setAttribute('label', column.v);
- if (column.s) {
- t_column.setAttribute('id', 'tc_' + column.s + '_' + column.f);
- } else {
- t_column.setAttribute('id', 'tc_' + column.f);
- }
- t_column.setAttribute('flex', '0');
- try {
- if (column.primary) {
- t_column.setAttribute('primary','true');
- t_column.setAttribute('flex','1');
- }
- if (column.hidden) t_column.setAttribute('hidden','true');
- } catch(E) {
- mw.sdump('D_LEGACY',js2JSON(E) + '\n');
- }
- t_column.setAttribute('field',column.f);
- if (i != (patron_list_columns.length - 1) ) {
- var t_splitter = document.createElement('splitter');
- t_columns.appendChild( t_splitter );
- t_splitter.setAttribute('class','tree-splitter');
- }
- }
- var t_children = document.createElement('treechildren');
- tree.appendChild(t_children);
-
- for (var i = 0; i < patron_ids.length; i++) {
- var t_item = document.createElement('treeitem');
- t_children.appendChild( t_item );
- t_item.setAttribute('patron_id',patron_ids[i]);
-
- var t_row = document.createElement('treerow');
- t_item.appendChild( t_row );
- t_row.setAttribute('patron_id',patron_ids[i]);
-
- //var t_cell = document.createElement('treecell');
- //t_row.appendChild( t_cell );
- //t_cell.setAttribute('label',patron_ids[i]);
-
- mw.user_async_request(
- 'open-ils.actor',
- 'open-ils.actor.user.fleshed.retrieve',
- [ mw.G.auth_ses[0], patron_ids[i] ],
- build_patron_retrieve_for_search_callback( t_row )
- );
- mw.sdump('D_LEGACY','Making call... count = ' + counter_incr('patron_call') + '\n');
- }
-
-}
-
-function build_patron_retrieve_for_search_callback(treerow) {
- mw.sdump('D_LEGACY',arg_dump(arguments));
- return function (request) {
- mw.sdump('D_LEGACY','Running callback... count = ' + counter_incr('patron_callback') + '\n');
- var result = request.getResultObject();
- mw.sdump('D_LEGACY','Result = ' + js2JSON(result) + '\n');
-
- for (var i = 0; i < patron_list_columns.length; i++) {
- var column = patron_list_columns[i];
- var t_cell = document.createElement('treecell');
- treerow.appendChild(t_cell);
- var expression;
- if (column.s) {
- switch(column.s) {
- case 'home_ou':
-expression = 'mw.G.org_tree_hash[ result.home_ou() ].' + column.f + '()';
- break;
- case 'mailing_address':
-expression = 'find_id_object_in_list( result.addresses() , result.mailing_address() ).' + column.f + '()';
- break;
- case 'billing_address':
-expression = 'find_id_object_in_list( result.addresses() , result.billing_address() ).' + column.f + '()';
- break;
- }
- } else {
- expression = 'result.' + column.f + '()';
- }
- //mw.sdump('D_LEGACY','Trying to eval: ' + expression + '\n');
- t_cell.setAttribute(
- 'label',
- eval( expression )
- );
- }
- };
-}
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
-
-<page id="patron_new_win" orient="vertical" style="overflow: auto;" persist="width height"
- onload="patron_init(); patron_edit_init();"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>
- dump('patron_new_win\n');
- </script>
-
- <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
- <!-- Initial Overlays for this XUL file -->
- <!--
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_bundle.xul"?>
- -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_edit_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <script src="chrome://evergreen/content/patron/patron_edit_legacy.js"/>
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="patron_edit_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<overlay id="patron_edit_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('patron_edit_overlay\n');</script>
-
- <vbox id="patron_edit_vbox" flex="1">
- <commandset id="patron_edit_cmds"/>
- <vbox id="patron_edit_vbox2" flex="1"/>
- <hbox id="patron_edit_hbox2" pack="end" flex="0">
- <button id="patron_edit_print" label='Print' accesskey="P" oncommand='window.print()'/>
- <button id="patron_edit_save" label='Save Changes' accesskey="S" command='cmd_patron_save'/>
- </hbox>
- </vbox>
-
- <commandset id="patron_edit_cmds">
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented');
- "/>
- <command id="cmd_patron_save" oncommand="
- PATRON.save();
- "/>
- <command id="cmd_apply" oncommand="
- alert('cmd_apply');
- "/>
- </commandset>
-
- <vbox id="patron_edit_vbox2" align="stretch" style="overflow: auto;" flex="1">
- <vbox id="patron_edit_vbox2a" style="" flex="0">
- <groupbox id="patron_edit_system_groupbox" flex="0"/>
- </vbox>
- <vbox id="patron_edit_vbox2b" style="" flex="0">
- <groupbox id="patron_edit_contact_groupbox" flex="0"/>
- </vbox>
- <vbox id="patron_edit_vbox2c" style="" flex="0">
- <groupbox id="patron_edit_survey_groupbox" flex="0"/>
- </vbox>
- <vbox id="patron_edit_vbox2d" style="" flex="0">
- <groupbox id="patron_edit_stat_cat_groupbox" flex="0"/>
- </vbox>
- </vbox>
-
- <groupbox id="patron_edit_system_groupbox">
- <caption id="patron_edit_system_caption" label="User Info" />
- <hbox id="patron_edit_system_groupbox_hbox">
- <menulist id="patron_edit_system_library_menulist"/>
- </hbox>
- <grid id="patron_edit_system_grid"/>
- </groupbox>
-
- <groupbox id="patron_edit_contact_groupbox">
- <caption id="patron_edit_contact_caption" label="Contact Info" />
- <grid id="patron_edit_contact_phone_grid" />
- <grid id="patron_edit_contact_address_grid" />
- </groupbox>
-
- <groupbox id="patron_edit_survey_groupbox">
- <caption id="patron_edit_survey_caption" label="Required Surveys" />
- <vbox id="patron_edit_survey_vbox" />
- </groupbox>
-
- <groupbox id="patron_edit_stat_cat_groupbox">
- <caption id="patron_edit_stat_cat_caption" label="Statistical Categories" />
- <grid id="patron_edit_stat_cat_grid">
- <columns id="pescg_columns">
- <column id="pescg_c1"/>
- <column id="pescg_c2" flex="1"/>
- </columns>
- <rows id="pescg_rows"/>
- </grid>
- </groupbox>
-
- <grid id="patron_edit_system_grid" flex="1">
- <columns id="patron_edit_system_columns">
- <column id="patron_edit_system_column1"/>
- <column id="patron_edit_system_column2"/>
- <column id="patron_edit_system_column3"/>
- <column id="patron_edit_system_column4"/>
- <column id="patron_edit_system_column5"/>
- <column id="patron_edit_system_column6"/>
- </columns>
- <rows id="patron_edit_system_rows">
- <row id="patron_edit_system_row0"/>
- <row id="patron_edit_system_row0b"/>
- <row id="patron_edit_system_row0a"/>
- <row id="patron_edit_system_row1"/>
- <row id="patron_edit_system_row2"/>
- <row id="patron_edit_system_row2a"/>
- <row id="patron_edit_system_row3"/>
- <row id="patron_edit_system_row4"/>
- <row id="patron_edit_system_row5"/>
- <row id="patron_edit_system_row5a"/>
- <row id="patron_edit_system_row6"/>
- <row id="patron_edit_system_row7"/>
- <row id="patron_edit_system_row8"/>
- </rows>
- </grid>
-
- <row id="patron_edit_system_row0">
- <label id="patron_edit_system_barcode_label" value="Barcode"/>
- <hbox id="patron_edit_system_barcode_box">
- <textbox id="patron_edit_system_barcode_textbox" size="20"/>
- <button id="patron_new_card_button" label="New" hidden="true"/>
- </hbox>
- <label id="patron_edit_system_profile_label" value="Profile"/>
- <menulist id="patron_edit_system_profile_menulist"/>
- </row>
-
- <row id="patron_edit_system_row0b">
- <label id="patron_edit_system_usrname_label" value="Login Name"/>
- <hbox id="patron_edit_system_usrname_box">
- <textbox id="patron_edit_system_usrname_textbox" size="20"/>
- </hbox>
- <label id="patron_edit_system_disable_label" value="Disable"/>
- <checkbox id="patron_edit_system_disable_checkbox"/>
- </row>
-
- <row id="patron_edit_system_row0a">
- <separator id="patron_edit_system_row0a_separator"/>
- </row>
-
- <row id="patron_edit_system_row1">
- <label id="patron_edit_system_family_name_label" value="Last Name"/>
- <textbox id="patron_edit_system_family_name_textbox" size="20"/>
- <label id="patron_edit_system_first_given_name_label" value="First"/>
- <textbox id="patron_edit_system_first_given_name_textbox" size="10"/>
- <label id="patron_edit_system_second_given_name_label" value="Middle"/>
- <textbox id="patron_edit_system_second_given_name_textbox" size="5"/>
- </row>
-
- <row id="patron_edit_system_row2">
- <label id="patron_edit_system_prefix_label" value="Prefix"/>
- <menulist id="patron_edit_system_prefix_menulist"/>
- <label id="patron_edit_system_suffix_label" value="Suffix"/>
- <menulist id="patron_edit_system_suffix_menulist"/>
- </row>
-
- <row id="patron_edit_system_row2a">
- <separator id="patron_edit_system_row2a_separator"/>
- </row>
-
- <row id="patron_edit_system_row3">
- <label id="patron_edit_system_id1value_label" value="ID #1:"/>
- <textbox id="patron_edit_system_id1value_textbox" size="20"/>
- <label id="patron_edit_system_id1type_label" value="Type"/>
- <menulist id="patron_edit_system_id1type_menulist"/>
- </row>
-
- <row id="patron_edit_system_row4">
- <label id="patron_edit_system_id2value_label" value="ID #2:"/>
- <textbox id="patron_edit_system_id2value_textbox" size="20"/>
- <label id="patron_edit_system_id2type_label" value="Type"/>
- <menulist id="patron_edit_system_id2type_menulist"/>
- </row>
-
- <row id="patron_edit_system_row5">
- <label id="patron_edit_system_dob_label" value="DOB:"/>
- <textbox id="patron_edit_system_dob_textbox" size="20"/>
- </row>
-
- <row id="patron_edit_system_row5a">
- <separator id="patron_edit_system_row5a_separator"/>
- </row>
-
- <row id="patron_edit_system_row6">
- <label id="patron_edit_system_new_passwd_label" value="New Password:"/>
- <textbox id="patron_edit_system_new_passwd_textbox" value="UNCHANGED" size="20"/>
- </row>
-
- <row id="patron_edit_system_row7">
- <separator id="patron_edit_system_row7_separator"/>
- </row>
-
- <row id="patron_edit_system_row8">
- <label id="patron_edit_system_alert_message_label" value="Alert Message:"/>
- <textbox id="patron_edit_system_alert_message_textbox" value="" multiline="true" rows="5"/>
- </row>
-
- <menulist id="patron_edit_system_id1type_menulist">
- <menupopup id="patron_edit_system_id1type_menupopup">
- </menupopup>
- </menulist>
-
- <menulist id="patron_edit_system_id2type_menulist">
- <menupopup id="patron_edit_system_id2type_menupopup">
- </menupopup>
- </menulist>
-
- <menulist id="patron_edit_system_prefix_menulist">
- <menupopup id="patron_edit_system_prefix_menupopup">
- </menupopup>
- </menulist>
-
- <menulist id="patron_edit_system_suffix_menulist">
- <menupopup id="patron_edit_system_suffix_menupopup">
- </menupopup>
- </menulist>
-
- <menulist id="patron_edit_system_profile_menulist">
- <menupopup id="patron_edit_system_profile_menupopup">
- </menupopup>
- </menulist>
-
- <menulist id="patron_edit_system_library_menulist">
- <menupopup id="patron_edit_system_library_menupopup">
- </menupopup>
- </menulist>
-
- <grid id="patron_edit_contact_phone_grid" flex="0">
- <columns id="patron_edit_contact_phone_columns">
- <column id="patron_edit_contact_phone_column1"/>
- <column id="patron_edit_contact_phone_column2"/>
- <column id="patron_edit_contact_phone_column3"/>
- <column id="patron_edit_contact_phone_column4"/>
- </columns>
- <rows id="patron_edit_phone_rows">
- <row id="patron_edit_phone_row0a"/>
- <row id="patron_edit_phone_row0"/>
- <row id="patron_edit_phone_row1"/>
- <row id="patron_edit_phone_row2"/>
- </rows>
-
- </grid>
-
- <row id="patron_edit_phone_row0a">
- <label id="patron_edit_contact_email_label" value="Email"/>
- <textbox id="patron_edit_contact_email_textbox" size="20"/>
- <label id="patron_edit_contact_email_invalid_label" value="Invalid" command="cmd_broken"/>
- <checkbox id="patron_edit_contact_email_invalid_checkbox" />
- </row>
- <row id="patron_edit_phone_row0">
- <label id="patron_edit_contact_dayphone_label" value="Day Phone"/>
- <textbox id="patron_edit_contact_dayphone_textbox" size="20"/>
- <label id="patron_edit_contact_dayphone_invalid_label" value="Invalid" command="cmd_broken"/>
- <checkbox id="patron_edit_contact_dayphone_invalid_checkbox" />
- </row>
- <row id="patron_edit_phone_row1">
- <label id="patron_edit_contact_eveningphone_label" value="Evening Phone"/>
- <textbox id="patron_edit_contact_eveningphone_textbox" size="20"/>
- <label id="patron_edit_contact_eveningphone_invalid_label" value="Invalid" command="cmd_broken"/>
- <checkbox id="patron_edit_contact_eveningphone_invalid_checkbox" />
- </row>
- <row id="patron_edit_phone_row2">
- <label id="patron_edit_contact_otherphone_label" value="Other Phone"/>
- <textbox id="patron_edit_contact_otherphone_textbox" size="20"/>
- <label id="patron_edit_contact_otherphone_invalid_label" value="Invalid" command="cmd_broken"/>
- <checkbox id="patron_edit_contact_otherphone_invalid_checkbox" />
- </row>
-
- <grid id="patron_edit_contact_address_grid" flex="0">
- <columns id="patron_edit_contact_address_columns">
- <column id="patron_edit_contact_address_column1"/>
- <column id="patron_edit_contact_address_column2"/>
- </columns>
- <rows id="patron_edit_address_rows"/>
- </grid>
-
-</overlay>
-
+++ /dev/null
-sdump('D_TRACE','Loading patron_holds.js\n');
-
-function patron_holds_init(p) {
- sdump('D_PATRON_HOLDS',"TESTING: patron_holds.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.patron_holds_cols = hold_cols();
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_holds_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
- p.add_patron_holds = p.paged_tree.add_rows;
- p.clear_patron_holds = p.paged_tree.clear_tree;
-
- p.register_patron_holds_select_callback = function (f) {
- sdump('D_PATRON_HOLDS','p.register_patron_holds_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_patron_holds_function = function (f) {
- sdump('D_PATRON_HOLDS','p.register_flesh_patron_holds_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_item_context_builder = function (f) {
- sdump('D_PATRON_HOLDS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_patron_holds_to_cols = function (patron_holds, treeitem) {
- sdump('D_PATRON_HOLDS','p.map_patron_holds_to_cols( ' + patron_holds + ',' + treeitem + ')\n');
- patron_holds_tree_map_patron_holds_to_cols(p, patron_holds, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_holds_tree_map_patron_holds_to_cols(p, patron_hold, treeitem) {
- sdump('D_PATRON_HOLDS',arg_dump(arguments,{1:true}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
-
- var app; var method;
- switch(patron_hold.hold_type()) {
- case 'M': app = 'open-ils.search'; method = 'open-ils.search.biblio.metarecord.mods_slim.retrieve'; break;
- default : app = 'open-ils.search'; method = 'open-ils.search.biblio.record.mods_slim.retrieve'; break;
- }
-
- user_request(
- app,
- method,
- [ patron_hold.target() ],
- function (request) {
- var mvr = request.getResultObject();
- var cols = new Array();
- for (var i = 0; i < p.patron_holds_cols.length; i++) {
- var hash = p.patron_holds_cols[i];
- sdump('D_PATRON_HOLDS','Considering ' + js2JSON(hash) + '\n');
- var obj_string = 'patron_hold';
- switch( hash.fm_class ) {
- case 'mvr' : obj_string = 'mvr'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_PATRON_HOLDS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_PATRON_HOLDS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_PATRON_HOLDS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- }
- );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-sdump('D_TRACE','Loading patron_items.js\n');
-
-function patron_items_init(p) {
- sdump('D_PATRON_ITEMS',"TESTING: patron_items.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.patron_items_cols = circ_cols();
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
- p.add_patron_items = p.paged_tree.add_rows;
- p.clear_patron_items = p.paged_tree.clear_tree;
-
- p.register_patron_items_select_callback = function (f) {
- sdump('D_PATRON_ITEMS','p.register_patron_items_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_patron_items_function = function (f) {
- sdump('D_PATRON_ITEMS','p.register_flesh_patron_items_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_item_context_builder = function (f) {
- sdump('D_PATRON_ITEMS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_patron_items_to_cols = function (patron_items, treeitem) {
- sdump('D_PATRON_ITEMS','p.map_patron_items_to_cols( ' + patron_items + ',' + treeitem + ')\n');
- patron_items_tree_map_patron_items_to_cols(p, patron_items, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_items_tree_map_patron_items_to_cols(p, patron_items, treeitem) {
- sdump('D_PATRON_ITEMS',arg_dump(arguments,{1:true}));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var cols = new Array();
- for (var i = 0; i < p.patron_items_cols.length; i++) {
- var hash = p.patron_items_cols[i];
- sdump('D_PATRON_ITEMS','Considering ' + js2JSON(hash) + '\n');
- var obj_string;
- switch( hash.fm_class ) {
- case 'acp' : obj_string = 'patron_items.copy'; break;
- case 'circ' : obj_string = 'patron_items.circ'; break;
- case 'mvr' : obj_string = 'patron_items.record'; break;
- }
- var cmd = parse_render_string( obj_string, hash.fm_field_render );
- sdump('D_PATRON_ITEMS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_PATRON_ITEMS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_PATRON_ITEMS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
-
-<page id="patron_new_win" orient="vertical" style="overflow: auto;" persist="width height"
- onload="try {
- window.patron_save_callback = function patron_save_callback(p) {
- mw.spawn_patron_display(parent.document, 'replace_tab', 'main_tabbox', { 'patron' : p.au });
- };
- patron_init(); patron_new_init(); patron_edit_init();
- } catch(E) {
- alert('onload patron_new_win: ' + E);
- }
- "
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>
- dump('patron_new_win\n');
- </script>
-
- <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
- <!-- Initial Overlays for this XUL file -->
- <!--
- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_bundle.xul"?>
- -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_edit_overlay.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <script src="chrome://evergreen/content/patron/patron_edit_legacy.js"/>
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="patron_edit_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-sdump('D_TRACE','Loading patron_search.js\n');
-
-var test_variable = false;
-
-function patron_search_init(p) {
- sdump('D_PATRON_SEARCH',"TESTING: patron_search.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- /* gives: p.clamshell, p.right_panel, p.left_panel */
- patron_search_clamshell_init(p);
-
- /* gives: p.search_form */
- patron_search_patron_search_form_init(p);
-
- /* gives: p.search_results */
- patron_search_patron_search_results_init(p);
-
- p.crazy_search = function (crazy_search_hash) {
- return patron_search( crazy_search_hash );
- };
-
- p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
- p.retrieve_button.addEventListener(
- 'command',
- function (ev) {
- spawn_patron_display(
- p.w.app_shell,'new_tab','main_tabbox',
- {
- 'patron' : retrieve_patron_by_id(
- p._patron.id()
- )
- }
- );
- }
- ,false
- );
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return;
-}
-
-function patron_search_clamshell_init(p) {
- p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
- p.left_panel = p.clamshell.first_deck;
- p.right_panel = p.clamshell.second_deck;
-}
-
-function patron_search_patron_search_form_init(p) {
- p.search_form = patron_search_form_init( { 'w' : p.w, 'node' : p.patron_search_form_node, 'debug' : p.ap } );
- p.search_form.register_search_callback(
- function (ev) {
- sdump('D_PATRON_SEARCH','Submitted: ' + js2JSON(p.search_form.crazy_search_hash) + '\n');
- if (p.crazy_search) {
- p.search_results.clear_patrons();
- p.search_results.add_patrons(
- p.crazy_search( p.search_form.crazy_search_hash )
- );
- p.search_results.paged_tree.tree.view.selection.select( 0 );
- p.search_results.paged_tree.tree.focus();
- }
- }
- );
-}
-
-function patron_search_patron_search_results_init(p) {
- p.search_results = patron_search_results_init( { 'w' : p.w, 'node' : p.patron_search_results_node, 'popupset_node' : p.popupset_node, 'debug' : p.app } );
-
- p.redraw_search_results = function() {
- p.search_results.clear_search_results();
- if (!p._patron.checkouts()) patron_get_checkouts( p._patron );
- for (var i = 0; i < p._patron.checkouts().length; i++) {
- p.search_results.add_search_results( [ i ] );
- }
- }
-
- var patron_select_async_count = 0;
-
- function gen_patron_select_async_function(count) {
- return function (request) {
- /* Set new patron */
- if (count == patron_select_async_count) {
-
- p._patron = request.getResultObject();
-
- patron_get_checkouts( p._patron, function(req) {
-
- if (count == patron_select_async_count) {
-
- p._patron.checkouts( req.getResultObject() );
-
- patron_get_holds( p._patron, function(req) {
-
- if (count == patron_select_async_count) {
-
- p._patron.hold_requests( req.getResultObject() );
-
- patron_get_bills( p._patron, function(req) {
-
- if (count == patron_select_async_count) {
-
- p._patron.bills = req.getResultObject();
- render_fm(p.w.document,{'au':p._patron});
- p.retrieve_button.disabled = false;
- }
- });
- }
- });
- }
- });
- };
- };
- }
-
- p.search_results.register_patron_select_callback(
- function (ev) {
- sdump('D_PATRON_SEARCH','Firing patron_select_callback\n');
- p.retrieve_button.disabled = true;
- try {
- /* Get selection */
- var patrons = get_list_from_tree_selection( p.search_results.paged_tree.tree );
- /* Clear Current Patron */
- p._patron = fake_patron();
- render_fm( p.w.document, { 'au' : p._patron } );
- /* Get patron and render status */
- retrieve_patron_by_id(
- patrons[ patrons.length - 1 ].getAttribute('record_id'),
- gen_patron_select_async_function( ++patron_select_async_count )
- );
- } catch(E) {
- sdump('D_ERROR_EXPECTED',js2JSON(E) + '\n');
- }
- }
- );
- p.search_results.register_flesh_patron_function(
- function (treeitem) {
- sdump('D_PATRON_SEARCH','Firing flesh_patron_function\n');
- var record_id = treeitem.getAttribute('record_id');
- retrieve_patron_by_id(
- record_id,
- function (request) {
- sdump('D_PATRON_SEARCH','flesh_patron callback\n');
- try {
- var patron = request.getResultObject();
- sdump('D_PATRON_SEARCH','patron = ' + js2JSON( patron ) + '\n');
- try {
- p.search_results.map_patron_to_cols( patron, treeitem );
- } catch(E) {
- sdump('D_ERROR','map in flesh_patron callback\n' + E+ '\n');
- }
- } catch(E) {
- sdump('D_ERROR','flesh_patron callback\n' + E+ '\n');
- }
- sdump('D_PATRON_SEARCH','leaving flesh_patron callback\n');
- }
- );
- }
- );
- p.search_results.register_context_builder(
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing context_builder\n');
- empty_widget(p.search_results.paged_tree.popup);
- var search_results = get_list_from_tree_selection( p.search_results.paged_tree.tree );
- var menuitem;
-
- /*** PATRON DISPLAY ***/
- menuitem = p.search_results.paged_tree.w.document.createElement('menuitem');
- p.search_results.paged_tree.popup.appendChild( menuitem );
- menuitem.setAttribute('label',getString('patron.context_display'));
- menuitem.addEventListener(
- 'command',
- function (ev) {
- sdump('D_PATRON_DISPLAY','Firing renew context\n');
- for (var i = 0; i < search_results.length; i++) {
- spawn_patron_display(
- p.w.app_shell,'new_tab','main_tabbox',
- {
- 'patron' : retrieve_patron_by_id(
- search_results[i].getAttribute('record_id')
- )
- }
- );
- }
- },
- false
- );
- }
- );
-}
-
-function patron_search(crazy_search_hash) {
- sdump('D_PATRON_SEARCH',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var result = [];
- try {
- result = user_request(
- 'open-ils.actor',
- 'open-ils.actor.patron.search.advanced',
- [ G.auth_ses[0], crazy_search_hash ]
- )[0];
- sdump('D_PATRON_SEARCH','result.length = ' + result.length + '\n');
- } catch(E) {
- handle_error(E);
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return result;
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/patron_search.dtd">
-
-<page id="patron_search_win"
- orient="vertical" style="overflow: auto" width="800" height="500"
- sizemode="maximized" persist="width height"
- onload="params.w = window;
- params.app = 'PatronSearch';
- params.clamshell_node = document.getElementById('ClamShell_main');
- params.patron_search_form_node = document.getElementById('PatronSearchForm_main');
- params.patron_search_results_node = document.getElementById('PatronSearchResults_main');
- mw.focus_widget( document, 'pst1' );
- mw.OpenILS_init(params);"
- onunload="mw.OpenILS_exit(params);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_search.xul\n');</script>
-
- <!-- Stylesheets -->
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
- <?xml-stylesheet href="chrome://evergreen/skin/patron_search.css" type="text/css"?>
-
- <!-- Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/patron/patron_search_overlay.xul"?>
-
- <!-- XUL'ified abstraction for logic to attach to widgets -->
- <commandset id="universal_cmds" />
-
- <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
- <keyset id="PatronSearch_keys" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <box id="PatronSearch_main" class="my_overflow" />
-
- <popupset id="universal_popupset" />
-
-</page>
+++ /dev/null
-sdump('D_TRACE','Loading patron_search_form.js\n');
-
-function patron_search_form_init(p) {
- sdump('D_PATRON_SEARCH_FORM',"TESTING: patron_search_form.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
- p.crazy_search_hash = {}; // hash[ field ] = { 'value' : ???, 'group' : ??? }
-
- var search_button = p.node.getElementsByAttribute('name','button_search')[0];
- var clear_button = p.node.getElementsByAttribute('name','button_clear')[0];
-
- var nl = p.node.getElementsByTagName('textbox');
- for (var i = 0; i < nl.length; i++) {
- nl[i].addEventListener(
- 'change',
- function (ev) {
- return patron_search_form_textbox_handler(
- ev.target,
- p.crazy_search_hash
- );
- },false
- );
- nl[i].addEventListener(
- 'keypress',
- function (ev) {
- patron_search_form_textbox_handler( ev.target, p.crazy_search_hash );
- if ((ev.keyCode == 13)||(ev.keyCode == 77)) search_button.doCommand();
- }, false
- );
- }
-
- p.register_search_callback = function (f) { search_button.addEventListener( 'command',f,false ); };
-
- if (clear_button) {
- clear_button.addEventListener(
- 'command',
- function (ev) {
- var nl = p.node.getElementsByTagName('textbox');
- for (var i = 0; i < nl.length; i++)
- nl[i].value = '';
- p.crazy_search_hash = {};
- },false
- );
- } else {
- sdump('D_PATRON_SEARCH_FORM',"No name=button_clear element.\n");
- }
-
- return p;
-}
-
-function patron_search_form_textbox_handler(textbox,search_hash) {
- sdump('D_PATRON_SEARCH_FORM',arg_dump(arguments));
- var field = textbox.getAttribute('field');
- var group = textbox.getAttribute('group');
- var value = textbox.value;
- search_hash[ field ] = { 'value' : value, 'group' : group };
- try {
- if (value==''||value==null||value==undefined) delete(search_hash[ field ]);
- } catch(E) {
- sdump('D_ERROR',E);
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_search_form.dtd">
-<overlay id="patron_search_form_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_search_form_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_search_form -->
-<box id="PatronSearchForm_main" orient="vertical">
- <box id="PatronSearchForm_insert1"/>
- <groupbox id="psgf_gb">
- <caption id="psgf_gbc" label='&patron_search_form.caption;' />
- <box id="PatronSearchForm_insert2"/>
- <grid id="psg" />
- <box id="PatronSearchForm_insert3"/>
- </groupbox>
- <box id="PatronSearchForm_insert4"/>
-</box>
-
-<!-- group 0 = user group 1 = address group 2 = phone, ident -->
-
-<grid id="psg">
- <columns id="psc">
- <column id="psc1"/>
- <column id="psc2" flex="1"/>
- </columns>
- <rows id="psr">
- <row id="psr1">
- <label id="psl1" control="pst1" value="&patron_search_form.family_name.label;" accesskey="&patron_search_form.family_name.accesskey;"/>
- <textbox id="pst1" field="family_name" group="0"/>
- </row>
- <row id="psr2">
- <label id="psl2" control="pst2" value="&patron_search_form.first_given_name.label;" accesskey="&patron_search_form.first_given_name.accesskey;"/>
- <textbox id="pst2" field="first_given_name" group="0"/>
- </row>
- <row id="psr3">
- <label id="psl3" control="pst3" value="&patron_search_form.second_given_name.label;" accesskey="&patron_search_form.second_given_name.accesskey;"/>
- <textbox id="pst3" field="second_given_name" group="0"/>
- </row>
- <row id="psr4">
- <label id="psl4" control="pst4" value="&patron_search_form.email.label;" accesskey="&patron_search_form.email.accesskey;"/>
- <textbox id="pst4" field="email" group="0"/>
- </row>
- <row id="psr5">
- <label id="psl5" control="pst5" value="&patron_search_form.phone.label;" accesskey="&patron_search_form.phone.accesskey;"/>
- <textbox id="pst5" field="phone" group="2"/>
- </row>
- <row id="psr6">
- <label id="psl6" control="pst6" value="&patron_search_form.ident.label;" accesskey="&patron_search_form.ident.accesskey;"/>
- <textbox id="pst6" field="ident" group="2"/>
- </row>
- <row id="psr6a">
- <label id="psl6a" value=" "/>
- </row>
- <row id="psr7">
- <label id="psl7" control="pst7" value="&patron_search_form.street1.label;" accesskey="&patron_search_form.street1.accesskey;"/>
- <textbox id="pst7" field="street1" group="1"/>
- </row>
- <row id="psr8">
- <label id="psl8" control="pst8" value="&patron_search_form.street2.label;" accesskey="&patron_search_form.street2.accesskey;"/>
- <textbox id="pst8" field="street2" group="1"/>
- </row>
- <row id="psr9">
- <label id="psl9" control="pst9" value="&patron_search_form.city.label;" accesskey="&patron_search_form.city.accesskey;"/>
- <textbox id="pst9" field="city" group="1"/>
- </row>
- <row id="psr10">
- <label id="psl10" control="pst10" value="&patron_search_form.state.label;" accesskey="&patron_search_form.state.accesskey;"/>
- <textbox id="pst10" field="state" group="1"/>
- </row>
- <row id="psr11">
- <label id="psl11" control="pst11" value="&patron_search_form.post_code.label;" accesskey="&patron_search_form.post_code.accesskey;"/>
- <textbox id="pst11" field="post_code" group="1"/>
- </row>
- <row id="psr12">
- <spacer id="pss12"/>
- <button id="psb12" label="&patron_search_form.search.label;" accesskey="&patron_search_form.search.accesskey;" name="button_search"/>
- </row>
- <row id="psr13">
- <spacer id="pss13"/>
- <button id="psb13" label="&patron_search_form.clear.label;" accesskey="&patron_search_form.clear.accesskey;" name="button_clear"/>
- </row>
- </rows>
-</grid>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronSearchForm_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_search_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading patron_search_overlay.xul\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_search_form_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/patron/patron_search_results_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
- <command id="cmd_broken" oncommand="
- alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_search -->
-<box id="PatronSearch_main" flex="1" orient="vertical">
- <box id="ClamShell_main" />
-</box>
-
-<deck id="ClamShell_first_deck" flex="0">
- <vbox id="psm_left" flex="1">
- <box id="PatronSearchForm_main" flex="0"/>
- <box id="PatronDisplayStatus_main" flex="0"/>
- <spacer id="psm_left_s1" flex="1"/>
- </vbox>
-</deck>
-
-<deck id="ClamShell_second_deck" flex="1">
- <box id="PatronSearchResults_main"/>
-</deck>
-
-<hbox id="PatronDisplayStatus_insert2">
- <label id="PatronSearch_patron_name" class="patronNameMedium"
- tooltiptext="&patron_display.name.label;"
- value=" "
- render="true" fm_class="au"
- render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
- <button id="PatronSearch_retrieve_button"
- disabled="true"
- label="&patron_navbar.retrieve;"
- accesskey="&patron_navbar.retrieve.accesskey;"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronSearch_keys">
-</keyset>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE','Loading patron_search_results.js\n');
-
-function patron_search_results_init(p) {
- sdump('D_PATRON_SEARCH_RESULTS',"TESTING: patron_search_results.js: " + mw.G['main_test_variable'] + '\n');
- sdump('D_TRACE_ENTER',arg_dump(arguments));
-
- p.patron_cols = [
- {
- 'active' : 'id_col', 'label' : getString('au_label_active'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : 'yesno( $$.active() )'
- },
- {
- 'id' : 'id_col', 'label' : getString('au_label_id'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.id()'
- },
- {
- 'id' : 'prefix_col', 'label' : getString('au_label_prefix'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.prefix()'
- },
- {
- 'id' : 'family_name_col', 'label' : getString('au_label_family_name'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.family_name()'
- },
- {
- 'id' : 'first_given_name_col', 'label' : getString('au_label_first_given_name'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.first_given_name()'
- },
- {
- 'id' : 'second_given_name_col', 'label' : getString('au_label_second_given_name'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.second_given_name()'
- },
- {
- 'id' : 'suffix_col', 'label' : getString('au_label_suffix'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_field_render' : '.suffix()'
- }
- ];
-
- p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_cols, 'debug' : p.app } );
- p.add_patrons = p.paged_tree.add_rows;
- p.clear_patrons = p.paged_tree.clear_tree;
-
- p.register_patron_select_callback = function (f) {
- sdump('D_PATRON_SEARCH_RESULTS','p.register_patron_select_callback(' + f + ')\n');
- p.paged_tree.register_select_callback( f );
- }
-
- p.register_flesh_patron_function = function (f) {
- sdump('D_PATRON_SEARCH_RESULTS','p.register_flesh_patron_function(' + f + ')\n');
- p.paged_tree.register_flesh_row_function( f );
- }
-
- p.register_context_builder = function (f) {
- sdump('D_PATRON_SEARCH_RESULTS','p.register_context_builder(' + f + ')\n');
- p.paged_tree.register_context_builder( f );
- }
-
- p.map_patron_to_cols = function (patron, treeitem) {
- sdump('D_PATRON_SEARCH_RESULTS','p.map_patron_to_cols(' + patron + ',' + treeitem + ')\n');
- patron_search_results_map_patron_to_cols(p, patron, treeitem);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
- return p;
-}
-
-function patron_search_results_map_patron_to_cols(p, patron, treeitem) {
- sdump('D_PATRON_SEARCH_RESULTS',arg_dump(arguments));
- sdump('D_TRACE_ENTER',arg_dump(arguments));
- var cols = new Array();
- for (var i = 0; i < p.patron_cols.length; i++) {
- var hash = p.patron_cols[i];
- sdump('D_PATRON_SEARCH_RESULTS','Considering ' + js2JSON(hash) + '\n');
- var cmd = parse_render_string('patron',hash.fm_field_render);
- sdump('D_PATRON_SEARCH_RESULTS','cmd = ' + cmd + '\n');
- var col = '';
- try {
- col = eval( cmd );
- sdump('D_PATRON_SEARCH_RESULTS','eval = ' + col + '\n');
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- }
- cols.push( col );
- }
- sdump('D_PATRON_SEARCH_RESULTS','cols = ' + js2JSON(cols) + '\n');
- p.paged_tree.map_cols_to_treeitem( cols, treeitem );
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
+++ /dev/null
-sdump('D_TRACE','Loading patron_utils.js\n');
-
-function fake_patron() {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- var p = new au();
- p.family_name( 'Retrieving' );
- p.checkouts( [] );
- p.hold_requests( [] );
- p.credit_forward_balance('0.00');
- p.bills = [];
- return p;
-}
-
-function hold_status_as_text( status ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (typeof(status) == 'object') status = status.status();
- var text;
- switch(status) {
- case "1" : text = getString('holds_status_waiting_for_copy'); break;
- case "2" : text = getString('holds_status_waiting_for_capture'); break;
- case "3" : text = getString('holds_status_in_transit'); break;
- case "4" : text = getString('holds_status_available'); break;
- default : text = "Eh?"; break;
- }
- return text;
-}
-
-function patron_get_full_name( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- var name = '';
- if (au.prefix()) name += au.prefix() + ' ';
- if (au.family_name()) name += au.family_name() + ', ';
- if (au.first_given_name()) name += au.first_given_name() + ' ';
- if (au.second_given_name()) name += au.second_given_name() + ' ';
- if (au.suffix()) name += au.suffix() + ' ';
- return name;
-}
-
-function patron_get_barcode( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- if (au && au.card && au.card() ) {
- if ( (au.card()!='null') && (typeof(au.card())=='object') ) {
- return au.card().barcode();
- } else {
- return find_id_object_in_list( au.cards(), au.card() ).barcode();
- }
- }
- } catch(E) {
- sdump('D_ERROR',E);
- }
- return '???';
-}
-
-function patron_get_bills( au, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- var bills = user_request(
- 'open-ils.actor',
- 'open-ils.actor.user.transactions.have_balance',
- [ mw.G.auth_ses[0], au.id() ],
- f
- )[0];
-
- if (!f) {
- sdump('D_PATRON_UTILS','bills = ' + js2JSON(bills) + '\n');
- au.bills = bills; // FIXME: make bills a virtual field of au
- return bills;
- }
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- return null;
- }
-
-}
-
-function patron_get_bills_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au.bills == null || au.bills == undefined)
- return '???';
- else {
- return get_bills_total( au.bills );
- }
-}
-
-function get_bills_total( bills ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- var total = 0;
- for (var i = 0; i < bills.length; i++) {
- total += dollars_float_to_cents_integer( bills[i].balance_owed() );
- }
- sdump('D_PATRON_UTILS','bills_total $$$ = ' + cents_as_dollars( total ) + '\n');
- return cents_as_dollars( total );
-}
-
-function patron_get_credit_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- /* FIXME: I can use CSS to style this number as money. */
- return '$' + au.credit_forward_balance();
-}
-
-function patron_get_checkouts( au, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- var checkouts = user_request(
- 'open-ils.circ',
- 'open-ils.circ.actor.user.checked_out',
- [ mw.G.auth_ses[0], au.id() ],
- f
- )[0];
-
- if (!f) {
- sdump('D_PATRON_UTILS','checkouts = ' + js2JSON(checkouts) + '\n');
- if (!checkouts) checkouts = [];
- au.checkouts( checkouts );
- return checkouts;
- }
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- return null;
- }
-}
-
-function patron_get_checkouts_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au.checkouts() == null)
- return '???';
- else
- return au.checkouts().length;
-}
-
-// Need an API call or virtual field to determine this
-function patron_get_checkouts_overdue_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (! au.checkouts()) patron_get_checkouts( au );
- var total = 0;
- if ( (au.checkouts() != null) && (typeof(au.checkouts())=='object') ) {
- for (var i = 0; i < au.checkouts().length; i++) {
- var item = au.checkouts()[i];
- var due_date = item.circ.due_date();
- due_date = due_date.substr(0,4) + due_date.substr(5,2) + due_date.substr(8,2);
- var today = formatted_date( new Date() , '%Y%m%d' );
- if (today > due_date) total++;
- }
- }
- sdump('D_PATRON_UTILS','\toverdue = ' + total + '\n');
- return total;
-}
-
-function patron_get_holds( au, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- var hold_requests = user_request(
- 'open-ils.circ',
- 'open-ils.circ.holds.retrieve',
- [ mw.G.auth_ses[0], au.id() ],
- f
- )[0];
-
- if (!f) {
- sdump('D_PATRON_UTILS','holds = ' + js2JSON(au.hold_requests()) + '\n');
- au.hold_requests( hold_requests );
- return hold_requests;
- }
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- return null;
- }
-}
-
-function patron_get_holds_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au.hold_requests() == null)
- return '???';
- else
- return au.hold_requests().length;
-}
-
-function patron_get_hold_status( hold, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- var status = user_request(
- 'open-ils.circ',
- 'open-ils.circ.hold.status.retrieve',
- [ mw.G.auth_ses[0], hold.id() ],
- f
- )[0];
-
- if (!f) {
- sdump('D_PATRON_UTILS','status = ' + status + '\n');
- hold.status( status );
- return status;
- }
- } catch(E) {
- sdump('D_ERROR',js2JSON(E) + '\n');
- return null;
- }
-}
-
-function patron_get_holds_available_total( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- var total = 0;
- if ( (au.hold_requests() != null) && (typeof(au.hold_requests()) == 'object') ) {
- for (var i = 0; i < au.hold_requests().length; i++) {
- var hold = au.hold_requests()[i];
- if (hold.capture_time()) total++;
- }
- }
- sdump('D_PATRON_UTILS','\tavailable = ' + total + '\n');
- return total;
-}
-
-function patron_get_home_ou_name( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au &&
- au.home_ou &&
- au.home_ou() &&
- mw.G.org_tree_hash &&
- mw.G.org_tree_hash[ au.home_ou() ] &&
- mw.G.org_tree_hash[ au.home_ou() ].name &&
- mw.G.org_tree_hash[ au.home_ou() ].name()
- ) {
- return mw.G.org_tree_hash[ au.home_ou() ].name();
- } else {
- return null;
- }
-}
-
-function patron_get_ident1_type_as_text( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au &&
- au.ident_type &&
- au.ident_type() &&
- mw.G.cit_hash &&
- mw.G.cit_hash[ au.ident_type() ] &&
- mw.G.cit_hash[ au.ident_type() ].name &&
- mw.G.cit_hash[ au.ident_type() ].name()
- ) {
- return mw.G.cit_hash[ au.ident_type() ].name();
- } else {
- return null;
- }
-}
-
-function patron_get_ident2_type_as_text( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au &&
- au.ident_type2 &&
- au.ident_type2() &&
- mw.G.cit_hash &&
- mw.G.cit_hash[ au.ident_type2() ] &&
- mw.G.cit_hash[ au.ident_type2() ].name &&
- mw.G.cit_hash[ au.ident_type2() ].name()
- ) {
- return mw.G.cit_hash[ au.ident_type2() ].name();
- } else {
- return null;
- }
-}
-
-function patron_get_profile_as_text( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au &&
- au.profile &&
- au.profile() &&
- mw.G.ap_hash &&
- mw.G.ap_hash[ au.profile() ] &&
- mw.G.ap_hash[ au.profile() ].name &&
- mw.G.ap_hash[ au.profile() ].name()
- ) {
- return mw.G.ap_hash[ au.profile() ].name();
- } else {
- return null;
- }
-}
-
-function patron_get_standing_as_text( au ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (au &&
- au.standing &&
- au.standing() &&
- mw.G.cst_hash &&
- mw.G.cst_hash[ au.standing() ] &&
- mw.G.cst_hash[ au.standing() ].value &&
- mw.G.cst_hash[ au.standing() ].value()
- ) {
- return mw.G.cst_hash[ au.standing() ].value();
- } else {
- return null;
- }
-}
-
-function patron_get_standing_css_style( value ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments,{0:true}));
- switch(value) {
- case 'Good' : case '1' : return 'background-color: lightgreen;'; break;
- case 'Barred' : case '2' : return 'background-color: yellow;'; break;
- case 'Blocked' : case '3' : return 'background-color: red;'; break;
- default: return 'background-color: white;'; break;
- }
-}
-
-function patron_pay_bills( payment_blob ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments,{0:true}));
- try {
- //alert("Bill's API call goes here. payment_blob = \n" + pretty_print( js2JSON( payment_blob ) ) + '\n');
- //alert( 'payment_blob\n' + js2JSON( payment_blob ) );
- var result = user_request(
- 'open-ils.circ',
- 'open-ils.circ.money.payment',
- [ mw.G.auth_ses[0], payment_blob ]
- )[0];
- return true;
- } catch(E) {
- handle_error(E);
- return false;
- }
-}
-
-function retrieve_patron_by_barcode( barcode, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (!barcode) return null;
- return user_request( 'open-ils.actor', 'open-ils.actor.user.fleshed.retrieve_by_barcode', [ mw.G.auth_ses[0], barcode ], f )[0];
-}
-
-function retrieve_patron_by_id( id, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- if (!id) return null;
- return user_request( 'open-ils.actor', 'open-ils.actor.user.fleshed.retrieve', [ mw.G.auth_ses[0], id ], f )[0];
-}
-
-function save_patron( au, f ) {
- sdump('D_PATRON_UTILS',arg_dump(arguments));
- try {
- var result = user_request(
- 'open-ils.actor',
- 'open-ils.actor.patron.update',
- [ mw.G.auth_ses[0], au ],
- f
- )[0];
- if (!f) sdump('D_PATRON_UTILS','result = ' + js2JSON(result) + '\n');
- return result;
- } catch(E) {
- handle_error(E);
- return null;
- }
-}
-
-function patron_edit_rows() {
- var rows = [
-{
- 'id' : 'standing', 'label' : getString('au_standing_label'), 'flex' : 1, 'class' : 'pale_violet_red',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cst_hash[ $$.standing() ].value()',
- 'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cst_hash,function(key,value){return [value.value(), key];}),
- 'entry_event' : 'command', 'entry_code' : '{ au.standing( ev.target.value ); }',
- 'rdefault' : '.standing()'
-},
-{
- 'id' : 'alert_message', 'label' : getString('au_alert_message_label'), 'flex' : 1, 'class' : 'pale_violet_red',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.alert_message()',
- 'entry_widget' : 'textbox', 'rdefault' : '.alert_message()',
- 'entry_event' : 'change', 'entry_code' : '{ alert(js2JSON(au)); au.alert_message( ev.target.value ); }'
-},
-{
- 'id' : 'create_date', 'label' : getString('au_create_date_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.create_date()',
- 'entry_widget' : 'textbox', 'entry_widget_attributes' : { 'readonly' : 'true' }, 'rdefault' : '.create_date()',
- 'entry_event' : 'change', 'entry_code' : '{ au.create_date( ev.target.value ); }'
-},
-{
- 'id' : 'expire_date', 'label' : getString('au_expire_date_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.expire_date()',
- 'entry_widget' : 'textbox', 'rdefault' : '.expire_date()',
- 'entry_event' : 'change', 'entry_code' : '{ au.expire_date( ev.target.value ); }'
-},
-{
- 'id' : 'active', 'label' : getString('au_active_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'yesno($$.active())',
- 'entry_widget' : 'menulist', 'populate_with' : { 'Yes' : 1 , 'No' : 0 }, 'rdefault' : '.active()',
- 'entry_event' : 'command', 'entry_code' : '{ au.active( ev.target.value ); }'
-},
-{
- 'id' : 'card', 'label' : getString('au_card_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.card().barcode()',
- 'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'New Card', 'oncommand' : 'alert("test");' },
- 'entry_event' : 'command', 'entry_code' : '{ new_card(au); }'
-},
-{
- 'id' : 'home_ou', 'label' : getString('au_home_ou_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.org_tree_hash[ $$.home_ou() ].shortname()',
- 'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.org_tree_hash,function(key,value){return [value.shortname(), key];}),
- 'entry_event' : 'command', 'entry_code' : '{ au.home_ou( ev.target.value ); }',
- 'rdefault' : '.home_ou()'
-},
-{
- 'id' : 'profile', 'label' : getString('au_profile_label'), 'flex' : 1, 'class' : 'peach_puff',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'ap_hash[ $$.profile() ].name()',
- 'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.ap_hash,function(key,value){return [value.name(), key];}),
- 'entry_event' : 'command', 'entry_code' : '{ au.profile( ev.target.value ); }',
- 'rdefault' : '.profile()'
-},
-{
- 'id' : 'prefix', 'label' : getString('au_prefix_label'), 'flex' : 1, 'class' : 'dark_salmon',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.prefix()',
- 'entry_widget' : 'menulist', 'entry_widget_attributes' : { 'editable' : 'true' },
- 'entry_event' : 'command', 'entry_code' : '{ au.prefix( ev.target.value ); }',
- 'populate_with' : { 'Mr.' : 'Mr.' , 'Mrs.' : 'Mrs.' }, 'rdefault' : '.prefix()'
-},
-{
- 'id' : 'family_name', 'label' : getString('au_family_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.family_name()',
- 'entry_widget' : 'textbox', 'rdefault' : '.family_name()',
- 'entry_event' : 'change', 'entry_code' : '{ au.family_name( ev.target.value ); }'
-},
-{
- 'id' : 'first_given_name', 'label' : getString('au_first_given_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.first_given_name()',
- 'entry_widget' : 'textbox', 'rdefault' : '.first_given_name()',
- 'entry_event' : 'change', 'entry_code' : '{ au.frist_given_name( ev.target.value ); }'
-},
-{
- 'id' : 'second_given_name', 'label' : getString('au_second_given_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.second_given_name()',
- 'entry_widget' : 'textbox', 'rdefault' : '.second_given_name()',
- 'entry_event' : 'change', 'entry_code' : '{ au.second_given_name( ev.target.value ); }'
-},
-{
- 'id' : 'suffix', 'label' : getString('au_suffix_label'), 'flex' : 1, 'class' : 'dark_salmon',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.suffix()',
- 'entry_widget' : 'menulist', 'entry_widget_attributes' : { 'editable' : 'true' },
- 'populate_with' : { 'Sr.' : 'Sr.' , 'Jr.' : 'Jr.' }, 'rdefault' : '.suffix()',
- 'entry_event' : 'command', 'entry_code' : '{ au.suffix( ev.target.value ); }'
-},
-{
- 'id' : 'dob', 'label' : getString('au_dob_label'), 'flex' : 1, 'class' : 'cadet_blue',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.dob()',
- 'entry_widget' : 'textbox', 'rdefault' : '.dob()',
- 'entry_event' : 'change', 'entry_code' : '{ au.dob( ev.target.value ); }'
-},
-{
- 'id' : 'ident_type', 'label' : getString('au_ident_type_label'), 'flex' : 1, 'class' : 'cadet_blue',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cit_hash[ $$.ident_type() ].name()',
- 'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cit_hash,function(key,value){return [value.name(), key];}),
- 'rdefault' : '.ident_type()',
- 'entry_event' : 'command', 'entry_code' : '{ au.ident_type( ev.target.value ); }'
-},
-{
- 'id' : 'ident_value', 'label' : getString('au_ident_value_label'), 'flex' : 1, 'class' : 'cadet_blue',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.ident_value()',
- 'entry_widget' : 'textbox', 'rdefault' : '.ident_value()',
- 'entry_event' : 'change', 'entry_code' : '{ au.ident_value( ev.target.value ); }'
-},
-{
- 'id' : 'ident_type2', 'label' : getString('au_ident_type2_label'), 'flex' : 1, 'class' : 'cadet_blue',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cit_hash[ $$.ident_type2() ].name()',
- 'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cit_hash,function(key,value){return [value.name(), key];}),
- 'rdefault' : '.ident_type2()',
- 'entry_event' : 'command', 'entry_code' : '{ au.ident_type2( ev.target.value ); }'
-},
-{
- 'id' : 'ident_value2', 'label' : getString('au_ident_value2_label'), 'flex' : 1, 'class' : 'cadet_blue',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.ident_value2()',
- 'entry_widget' : 'textbox', 'rdefault' : '.ident_value2()',
- 'entry_event' : 'change', 'entry_code' : '{ au.ident_value2( ev.target.value ); }'
-},
-{
- 'id' : 'addresses', 'label' : getString('au_addresses_label'), 'flex' : 1, 'class' : 'coral',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.addresses().length + " addresses"',
- 'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/Edit/New' },
- 'entry_event' : 'command', 'entry_code' : '{ edit_addresses(au); }'
-},
-{
- 'id' : 'day_phone', 'label' : getString('au_day_phone_label'), 'flex' : 1, 'class' : 'coral',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.day_phone()',
- 'entry_widget' : 'textbox', 'rdefault' : '.day_phone()',
- 'entry_event' : 'change', 'entry_code' : '{ au.day_phone( ev.target.value ); }'
-},
-{
- 'id' : 'evening_phone', 'label' : getString('au_evening_phone_label'), 'flex' : 1, 'class' : 'coral',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.evening_phone()',
- 'entry_widget' : 'textbox', 'rdefault' : '.evening_phone()',
- 'entry_event' : 'change', 'entry_code' : '{ au.evening_phone( ev.target.value ); }'
-},
-{
- 'id' : 'other_phone', 'label' : getString('au_other_phone_label'), 'flex' : 1, 'class' : 'coral',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.other_phone()',
- 'entry_widget' : 'textbox', 'rdefault' : '.other_phone()',
- 'entry_event' : 'change', 'entry_code' : '{ au.other_phone( ev.target.value ); }'
-},
-{
- 'id' : 'email', 'label' : getString('au_email_label'), 'flex' : 1, 'class' : 'coral',
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.email()',
- 'entry_widget' : 'textbox', 'rdefault' : '.email()',
- 'entry_event' : 'change', 'entry_code' : '{ au.email( ev.target.value ); }'
-},
-{
- 'id' : 'master_account', 'label' : getString('au_master_account_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.master_account()',
- 'entry_widget' : 'textbox', 'rdefault' : '.master_account()',
- 'entry_event' : 'change', 'entry_code' : '{ au.master_account( ev.target.value ); }'
-},
-{
- 'id' : 'net_access_level', 'label' : getString('au_net_access_level_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.net_access_level()',
- 'entry_widget' : 'textbox', 'rdefault' : '.net_access_level()',
- 'entry_event' : 'change', 'entry_code' : '{ au.net_access_level( ev.target.value ); }'
-},
-{
- 'id' : 'passwd', 'label' : getString('au_passwd_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.passwd()',
- 'entry_widget' : 'textbox', 'rdefault' : '.passwd()',
- 'entry_event' : 'change', 'entry_code' : '{ au.passwd( ev.target.value ); }'
-},
-{
- 'id' : 'photo_url', 'label' : getString('au_photo_url_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.photo_url()',
- 'entry_widget' : 'textbox', 'rdefault' : '.photo_url()',
- 'entry_event' : 'change', 'entry_code' : '{ au.photo_url( ev.target.value ); }'
-},
-{
- 'id' : 'stat_cat_entries', 'label' : getString('au_stat_cat_entries_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.stat_cat_entries().length + " entries"',
- 'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/Edit' },
- 'entry_event' : 'command', 'entry_code' : '{ edit_stat_cat_entries(au); }'
-},
-{
- 'id' : 'survey_responses', 'label' : getString('au_survey_responses_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.survey_responses().length + " responses"',
- 'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/New' },
- 'entry_event' : 'command', 'entry_code' : '{ new_survey_responses(au); }'
-},
-{
- 'id' : 'usrgroup', 'label' : getString('au_usrgroup_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.usrgroup()',
- 'entry_widget' : 'textbox', 'rdefault' : '.usrgroup()',
- 'entry_event' : 'change', 'entry_code' : '{ au.usrgroup( ev.target.value ); }'
-},
-{
- 'id' : 'usrname', 'label' : getString('au_usrname_label'), 'flex' : 1,
- 'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.usrname()',
- 'entry_widget' : 'textbox', 'rdefault' : '.usrname()',
- 'entry_event' : 'change', 'entry_code' : '{ au.usrname( ev.target.value ); }'
-},
-];
-
- return rows;
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/stat_cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-
-<page id="stat_cat_win" title="Copy Stat-Cat Editor"
- orient="vertical" style="overflow: auto;" persist="width height"
- onload="copy_stat_cat_editor_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
- <!-- Overlays for this XUL file -->
- <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?> -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_bundle.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <vbox id="copy_stat_cat_editor" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/stat_cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-
-<window id="stat_cat_win" title="Patron Stat-Cat Editor"
- orient="vertical" style="overflow: auto" persist="width height"
- onload="patron_stat_cat_editor_init();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
- <!-- Overlays for this XUL file -->
- <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?> -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_bundle.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <vbox id="patron_stat_cat_editor" class="test_class"/>
-
-</window>
-
+++ /dev/null
-var local_copy_stat_cats = [];
-var local_copy_stat_cats_hash = {};
-var local_copy_stat_cat_entries = {};
-var local_patron_stat_cats = [];
-var local_patron_stat_cats_hash = {};
-var local_patron_stat_cat_entries = {};
-var local_generic_stat_cats = [];
-var local_generic_stat_cats_hash = {};
-var local_generic_stat_cat_entries = {};
-var new_id = -1;
-
-function copy_stat_cat_editor_init() {
- sdump('D_LEGACY','entering copy_stat_cat_editor_init for copy_stat_cat.js\n');
- sdump('D_LEGACY','TESTING: stat_cat.js: ' + mw.G['main_test_variable'] + '\n');
- populate_local_copy_stat_cats(
- 'copy_stat_cat_grid',
- map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
- );
-}
-
-function patron_stat_cat_editor_init() {
- sdump('D_LEGACY','entering patron_stat_cat_editor_init for patron_stat_cat.js\n');
- sdump('D_LEGACY','TESTING: stat_cat.js: ' + mw.G['main_test_variable'] + '\n');
- populate_local_patron_stat_cats(
- 'patron_stat_cat_grid',
- map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
- );
-}
-
-function new_entry_listener(ev) {
- if (ev.target.tagName != 'textbox') return;
- var row = ev.target.parentNode;
- var rows = row.parentNode;
- var clone = row.cloneNode(true);
- if (row.nextSibling) {
- rows.insertBefore(clone,row.nextSibling);
- } else {
- rows.appendChild(clone);
- }
- clone.getElementsByTagName('textbox')[0].addEventListener('change',new_entry_listener,false);
- ev.target.removeEventListener('change',new_entry_listener,false);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// COPY
-
-function populate_local_copy_stat_cats(grid,libs) {
- sdump('D_LEGACY','populate_local_copy_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
- sdump('D_LEGACY','populate_local_copy_stat_cats: pertinent libs = ' + mw.js2JSON(libs) + '\n');
- sdump('D_LEGACY','libs.constructor = ' + libs.constructor + '\n');
-
- try {
- local_copy_stat_cats = user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.multirange.union.retrieve',
- [ mw.G.auth_ses[0], libs ]
- );
- //sdump('D_LEGACY','1: local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
- local_copy_stat_cats = local_copy_stat_cats[0];
- //sdump('D_LEGACY','2: local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
- local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
- } catch(E) {
- mw.handle_error(E);
- }
- populate_local_copy_stat_cats_grid(grid);
-}
-
-function populate_local_copy_stat_cats_grid(grid) {
-
- sdump('D_LEGACY','local_copy_stat_cats = ' + pretty_print( js2JSON( local_copy_stat_cats ) ) + '\n');
-
- if (typeof(grid) != 'object') { grid = document.getElementById(grid); }
- var rows = grid.getElementsByTagName('rows')[0];
- empty_widget(rows);
-
- var row0 = document.createElement('row');
- rows.appendChild(row0);
- row0.appendChild( document.createElement('label') );
- row0.appendChild( document.createElement('label') );
- var delete_label = document.createElement('label');
- row0.appendChild( delete_label );
- delete_label.setAttribute('value','Delete');
- var owner_label = document.createElement('label');
- row0.appendChild( owner_label );
- owner_label.setAttribute('value','Owner');
-
- for (var i in local_copy_stat_cats) {
-
- var copy_stat_cat = local_copy_stat_cats[i];
-
- var row1 = document.createElement('row');
- rows.appendChild(row1);
- row1.setAttribute('asc_id',copy_stat_cat.id());
- row1.setAttribute('object_type','asc');
- addCSSClass(row1,'row' + i % 2);
-
- var label1 = document.createElement('label');
- row1.appendChild(label1);
- label1.setAttribute('value','Statistical Category:');
-
- if ( find_ou( mw.G.user_ou,copy_stat_cat.owner() ) ) {
- var textbox1 = document.createElement('textbox');
- row1.appendChild(textbox1);
- textbox1.value = copy_stat_cat.name();
- textbox1.setAttribute('original',textbox1.value);
-
- var checkbox1 = document.createElement('checkbox');
- row1.appendChild(checkbox1);
- checkbox1.setAttribute('delete','true');
-
- var menulist1 = document.createElement('menulist');
- row1.appendChild(menulist1);
- menulist1.setAttribute('original',copy_stat_cat.owner());
-
- var menupopup1 = document.createElement('menupopup');
- menulist1.appendChild(menupopup1);
- //sdump('D_LEGACY','About to populate with copy_stat_cat.owner() = ' + copy_stat_cat.owner() + '\n');
- populate_lib_list_with_branch(menulist1,menupopup1,copy_stat_cat.owner(),mw.G.user_ou);
- } else {
-
- var label1a = document.createElement('label');
- row1.appendChild(label1a);
- label1a.setAttribute('value',copy_stat_cat.name() );
-
- row1.appendChild( document.createElement('label') );
-
- var label1c = document.createElement('label');
- row1.appendChild(label1c);
- label1c.setAttribute( 'value',mw.G.org_tree_hash[copy_stat_cat.owner()].name() );
- }
-
- var row2 = document.createElement('row');
- rows.appendChild(row2);
- row2.setAttribute('asc_id',copy_stat_cat.id());
- row2.setAttribute('object_type','asc');
- addCSSClass(row2,'row' + i % 2);
-
- var label2 = document.createElement('label');
- row2.appendChild(label2);
- label2.setAttribute('value','OPAC Visible');
-
- if ( find_ou( mw.G.user_ou,copy_stat_cat.owner() ) ) {
- var checkbox2 = document.createElement('checkbox');
- row2.appendChild(checkbox2);
- checkbox2.checked = (copy_stat_cat.opac_visible() == '1')
- checkbox2.setAttribute('original',checkbox2.checked);
- } else {
- var label2a = document.createElement('label');
- row2.appendChild(label2a);
- label2a.setAttribute('value',yesno( copy_stat_cat.opac_visible() ));
- }
-
- for (var j in copy_stat_cat.entries() ) {
-
- var stat_entry = copy_stat_cat.entries()[j];
- local_copy_stat_cat_entries[stat_entry.id()] = stat_entry;
-
- var row = document.createElement('row');
- rows.appendChild(row);
- row.setAttribute('asc_id',copy_stat_cat.id());
- row.setAttribute('asce_id',stat_entry.id());
- row.setAttribute('object_type','asce');
- addCSSClass(row,'row' + i % 2);
-
- var label = document.createElement('label');
- row.appendChild(label);
- label.setAttribute('value','Entry:');
-
- if ( find_ou( mw.G.user_ou,stat_entry.owner() ) ) {
- var textbox = document.createElement('textbox');
- row.appendChild(textbox);
- textbox.value = stat_entry.value();
- textbox.setAttribute('original',textbox.value);
-
- var checkbox = document.createElement('checkbox');
- row.appendChild(checkbox);
- checkbox.setAttribute('delete','true');
-
- var menulist = document.createElement('menulist');
- row.appendChild(menulist);
- menulist.setAttribute('original',stat_entry.owner());
-
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- //sdump('D_LEGACY','About to populate with stat_entry.owner() = ' + stat_entry.owner() + '\n');
- populate_lib_list_with_branch(menulist,menupopup,stat_entry.owner(),mw.G.user_ou);
- } else {
-
- var labela = document.createElement('label');
- row.appendChild(labela);
- labela.setAttribute('value',stat_entry.value());
-
- row.appendChild( document.createElement('label') );
-
- var labelc = document.createElement('label');
- row.appendChild(labelc);
- labelc.setAttribute( 'value',mw.G.org_tree_hash[stat_entry.owner()].name() );
- }
- }
-
- var row3 = document.createElement('row');
- rows.appendChild(row3);
- row3.setAttribute('asc_id',copy_stat_cat.id());
- row3.setAttribute('object_type','asce');
- row3.setAttribute('new','true');
- addCSSClass(row3,'row' + i % 2);
-
- var label3 = document.createElement('label');
- row3.appendChild(label3);
- label3.setAttribute('value','New Entry:');
-
- var textbox3 = document.createElement('textbox');
- row3.appendChild(textbox3);
- textbox3.setAttribute('original','');
- textbox3.addEventListener(
- 'change',
- new_entry_listener,
- false
- );
-
- var checkbox3 = document.createElement('checkbox');
- row3.appendChild(checkbox3);
- checkbox3.setAttribute('delete','true');
-
- var menulist3 = document.createElement('menulist');
- row3.appendChild(menulist3);
- menulist3.setAttribute('original',mw.G.user_ou.id());
-
- var menupopup3 = document.createElement('menupopup');
- menulist3.appendChild(menupopup3);
- //sdump('D_LEGACY','About to populate with mw.G.user_ou\n');
- populate_lib_list_with_branch(menulist3,menupopup3,mw.G.user_ou,mw.G.user_ou);
-
- var row4 = document.createElement('row');
- rows.appendChild(row4);
- addCSSClass(row4,'row' + i % 2);
-
- var label4 = document.createElement('label');
- row4.appendChild(label4);
- label4.setAttribute('value',' ');
-
- var row5 = document.createElement('row');
- rows.appendChild(row5);
-
- var label5 = document.createElement('label');
- row5.appendChild(label5);
- label5.setAttribute('value',' ');
-
- }
-
- var row6 = document.createElement('row');
- rows.appendChild(row6);
-
- var label6 = document.createElement('label');
- row6.appendChild(label6);
- label6.setAttribute('value',' ');
-
- sdump('D_LEGACY','local_copy_stat_cat_entries = ' + pretty_print( js2JSON( local_copy_stat_cat_entries ) ) + '\n');
-}
-function save_copy_changes() {
-
- // XUL
-
- var nl = document.getElementsByTagName('textbox');
- for (var i = 0; i < nl.length; i++) {
- var t = nl[i];
- var row = t.parentNode;
- var object_type = row.getAttribute('object_type');
- var asc_id = row.getAttribute('asc_id');
- var asce_id = row.getAttribute('asce_id');
- var new_flag = row.getAttribute('new');
- var original = t.getAttribute('original');
- sdump('D_LEGACY','Considering textbox: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' value = ' + t.value + '\n');
-
- if ( (original != t.value) && (t.value != null) && (t.value != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'asc':
- local_copy_stat_cats_hash[asc_id].ischanged('1');
- local_copy_stat_cats_hash[asc_id].name( t.value );
- break;
- case 'asce':
- if (!asce_id) {
- asce_id = new_id--;
- row.setAttribute('asce_id', asce_id);
- local_copy_stat_cats_hash[ asc_id ].entries().push( new asce() );
- local_copy_stat_cat_entries[asce_id] =
- local_copy_stat_cats_hash[ asc_id].entries()[ local_copy_stat_cats_hash[ asc_id].entries().length -1 ];
- local_copy_stat_cat_entries[asce_id].id( asce_id );
- local_copy_stat_cat_entries[asce_id].isnew('1');
- local_copy_stat_cat_entries[asce_id].stat_cat( asc_id );
- local_copy_stat_cat_entries[asce_id].owner(
- mw.G.user_ou.id()
- );
- local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
- }
- local_copy_stat_cat_entries[asce_id].ischanged('1');
- local_copy_stat_cat_entries[asce_id].value( t.value );
- break;
- }
- }
- }
- var nl = document.getElementsByTagName('menulist');
- for (var i = 0; i < nl.length; i++) {
- var m = nl[i];
- var row = m.parentNode;
- var object_type = row.getAttribute('object_type');
- var asc_id = row.getAttribute('asc_id');
- var asce_id = row.getAttribute('asce_id');
- var new_flag = row.getAttribute('new');
- var original = m.getAttribute('original');
-
- sdump('D_LEGACY','Considering menulist: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' value = ' + m.value + '\n');
-
- if ( (original != m.value) && (m.value != null) && (m.value != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'asc':
- local_copy_stat_cats_hash[asc_id].ischanged('1');
- local_copy_stat_cats_hash[asc_id].owner( m.value );
- break;
- case 'asce':
- if (asce_id) {
- local_copy_stat_cat_entries[asce_id].ischanged('1');
- local_copy_stat_cat_entries[asce_id].owner( m.value );
- } else {
- sdump('D_LEGACY','\tbut nothing to do.\n');
- }
- break;
- }
- }
- }
-
- var nl = document.getElementsByTagName('checkbox');
- for (var i = 0; i < nl.length; i++) {
- var c = nl[i];
- var row = c.parentNode;
- var object_type = row.getAttribute('object_type');
- var asc_id = row.getAttribute('asc_id');
- var asce_id = row.getAttribute('asce_id');
- var new_flag = row.getAttribute('new');
- var delete_flag = c.getAttribute('delete');
- if (delete_flag == 'true') { delete_flag = true; }
- else if (delete_flag == 'false') { delete_flag = false; }
- var original = c.getAttribute('original');
- if (original == 'true') { original = true; }
- else if (original == 'false' ) { original = false; }
-
- sdump('D_LEGACY','Considering checkbox: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' checked = ' + m.checked + ' delete_flag = ' + delete_flag + '\n');
-
- if ( (original != c.checked) && (c.checked != null) && (c.checked != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'asc':
- local_copy_stat_cats_hash[asc_id].ischanged('1');
- if (delete_flag) {
- local_copy_stat_cats_hash[asc_id].isdeleted('1');
- } else {
- local_copy_stat_cats_hash[asc_id].opac_visible( c.checked );
- }
- break;
- case 'asce':
- if (asce_id) {
- local_copy_stat_cat_entries[asce_id].ischanged('1');
- if (delete_flag) {
- local_copy_stat_cat_entries[asce_id].isdeleted('1');
- } else {
- // This actually doesn't exist on the asce object
- //local_copy_stat_cat_entries[asce_id].opac_visible( c.checked );
- }
- } else {
- sdump('D_LEGACY',"\tBut nothing to do.\n");
- }
- break;
- }
- }
- }
-
- sdump('D_LEGACY','local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
-
- // fieldmapper
- sdump('D_LEGACY','Creating, Updating, Deleting, Oh My...\n');
- for (var i = 0; i < local_copy_stat_cats.length; i++) {
- var copy_stat_cat = local_copy_stat_cats[i];
- sdump('D_LEGACY','Considering copy_stat_cat = ' + js2JSON(copy_stat_cat) + '\n');
-
- if ( (copy_stat_cat.name() == undefined) || (copy_stat_cat.name() == null)
- || (copy_stat_cat.name() == '') ) continue;
- if ( copy_stat_cat.isnew() == '1' ) {
- // This will handle copy_stat_cat and and it's entries
- try {
- if ( copy_stat_cat.isdeleted() != '1') {
- var r1 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.create',
- [ mw.G.auth_ses[0], copy_stat_cat ]
- )[0];
- sdump('D_LEGACY','r1 = ' + js2JSON(r1) + '\n');
- }
- } catch(E) {
- mw.handle_error(E);
- }
-
- } else {
- // We will also need to loop through the entries
-
- if ( (copy_stat_cat.ischanged() == '1') || (copy_stat_cat.isdeleted() == '1') ) {
- try {
- if (copy_stat_cat.isdeleted() == '1') {
- var r2 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.delete',
- [ mw.G.auth_ses[0], copy_stat_cat ]
- )[0];
- sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
- } else {
- var r2 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.update',
- [ mw.G.auth_ses[0], copy_stat_cat ]
- )[0];
- sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
- }
- } catch(E) {
- mw.handle_error(E);
- }
- }
- if (copy_stat_cat.isdeleted() != '1')
- for (var j = 0; j < copy_stat_cat.entries().length; j++) {
- var stat_entry = copy_stat_cat.entries()[j];
- sdump('D_LEGACY','\tConsidering stat_entry = ' + js2JSON(stat_entry) + '\n');
-
- if (stat_entry.isnew() == '1') {
- if (stat_entry.isdeleted() != '1') {
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.entry.create',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
- }
- } else if (stat_entry.isdeleted() == '1') {
-
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.entry.delete',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
- } else {
-
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.asset.entry.update',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
- }
-
- }
-
- }
- }
-
- sdump('D_LEGACY','\n\n\n=-=-=-=-=-=-=-=-=\n\n\n');
-
- local_copy_stat_cat_entries = {};
- local_copy_stat_cats = [];
- local_copy_stat_cats_hash = {};
- sdump('D_LEGACY','Successfully updated the Stat Cats\n');
- alert('Successfully updated the Stat Cats\n');
- populate_local_copy_stat_cats(
- 'copy_stat_cat_grid',
- map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
- );
- document.getElementById('copy_stat_cat_new').disabled = false;
-}
-
-function new_copy_stat_cat(ev) {
- ev.target.disabled = true;
- var n_asc = new asc();
- n_asc.isnew( '1' );
- n_asc.id( new_id-- );
- n_asc.owner( mw.G.user_ou.id() );
- n_asc.entries( [] );
- local_copy_stat_cats.push( n_asc );
- local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
- populate_local_copy_stat_cats_grid('copy_stat_cat_grid');
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// PATRON
-
-function populate_local_patron_stat_cats(grid,libs) {
- sdump('D_LEGACY','populate_local_patron_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
- try {
- local_patron_stat_cats = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.retrieve.all',
- [ mw.G.auth_ses[0] ]
- );
- //sdump('D_LEGACY','1: local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
- local_patron_stat_cats = local_patron_stat_cats[0];
- //sdump('D_LEGACY','2: local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
- local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
- } catch(E) {
- mw.handle_error(E);
- }
- populate_local_patron_stat_cats_grid(grid);
-}
-
-function populate_local_patron_stat_cats_grid(grid) {
-
- sdump('D_LEGACY','local_patron_stat_cats = ' + pretty_print( js2JSON( local_patron_stat_cats ) ) + '\n');
-
- if (typeof(grid) != 'object') { grid = document.getElementById(grid); }
- var rows = grid.getElementsByTagName('rows')[0];
- empty_widget(rows);
-
- var row0 = document.createElement('row');
- rows.appendChild(row0);
- row0.appendChild( document.createElement('label') );
- row0.appendChild( document.createElement('label') );
- var delete_label = document.createElement('label');
- row0.appendChild( delete_label );
- delete_label.setAttribute('value','Delete');
- var owner_label = document.createElement('label');
- row0.appendChild( owner_label );
- owner_label.setAttribute('value','Owner');
-
- for (var i in local_patron_stat_cats) {
- //sdump('D_LEGACY','local_patron_stat_cats['+i+'] = '+local_patron_stat_cats[i]+' ; typeof = '+typeof(local_patron_stat_cats[i]) + '\n');
-
- var patron_stat_cat = local_patron_stat_cats[i];
-
- var row1 = document.createElement('row');
- rows.appendChild(row1);
- row1.setAttribute('actsc_id',patron_stat_cat.id());
- row1.setAttribute('object_type','actsc');
- addCSSClass(row1,'row' + i % 2);
-
- var label1 = document.createElement('label');
- row1.appendChild(label1);
- label1.setAttribute('value','Statistical Category:');
-
- if ( find_ou( mw.G.user_ou,patron_stat_cat.owner() ) ) {
- var textbox1 = document.createElement('textbox');
- row1.appendChild(textbox1);
- textbox1.value = patron_stat_cat.name();
- textbox1.setAttribute('original',textbox1.value);
-
- var checkbox1 = document.createElement('checkbox');
- row1.appendChild(checkbox1);
- checkbox1.setAttribute('delete','true');
-
- var menulist1 = document.createElement('menulist');
- row1.appendChild(menulist1);
- menulist1.setAttribute('original',patron_stat_cat.owner());
-
- var menupopup1 = document.createElement('menupopup');
- menulist1.appendChild(menupopup1);
- //sdump('D_LEGACY','About to populate with patron_stat_cat.owner() = ' + patron_stat_cat.owner() + '\n');
- populate_lib_list_with_branch(menulist1,menupopup1,patron_stat_cat.owner(),mw.G.user_ou);
- } else {
-
- var label1a = document.createElement('label');
- row1.appendChild(label1a);
- label1a.setAttribute('value',patron_stat_cat.name() );
-
- row1.appendChild( document.createElement('label') );
-
- var label1c = document.createElement('label');
- row1.appendChild(label1c);
- label1c.setAttribute( 'value',mw.G.org_tree_hash[patron_stat_cat.owner()].name() );
- }
-
- var row2 = document.createElement('row');
- rows.appendChild(row2);
- row2.setAttribute('actsc_id',patron_stat_cat.id());
- row2.setAttribute('object_type','actsc');
- addCSSClass(row2,'row' + i % 2);
-
- var label2 = document.createElement('label');
- row2.appendChild(label2);
- label2.setAttribute('value','OPAC Visible');
-
- if ( find_ou( mw.G.user_ou,patron_stat_cat.owner() ) ) {
- var checkbox2 = document.createElement('checkbox');
- row2.appendChild(checkbox2);
- checkbox2.checked = (patron_stat_cat.opac_visible() == '1')
- checkbox2.setAttribute('original',checkbox2.checked);
- } else {
- var label2a = document.createElement('label');
- row2.appendChild(label2a);
- label2a.setAttribute('value',yesno( patron_stat_cat.opac_visible() ));
- }
-
- for (var j in patron_stat_cat.entries() ) {
-
- var stat_entry = patron_stat_cat.entries()[j];
- local_patron_stat_cat_entries[stat_entry.id()] = stat_entry;
-
- var row = document.createElement('row');
- rows.appendChild(row);
- row.setAttribute('actsc_id',patron_stat_cat.id());
- row.setAttribute('actsce_id',stat_entry.id());
- row.setAttribute('object_type','actsce');
- addCSSClass(row,'row' + i % 2);
-
- var label = document.createElement('label');
- row.appendChild(label);
- label.setAttribute('value','Entry:');
-
- if ( find_ou( mw.G.user_ou,stat_entry.owner() ) ) {
- var textbox = document.createElement('textbox');
- row.appendChild(textbox);
- textbox.value = stat_entry.value();
- textbox.setAttribute('original',textbox.value);
-
- var checkbox = document.createElement('checkbox');
- row.appendChild(checkbox);
- checkbox.setAttribute('delete','true');
-
- var menulist = document.createElement('menulist');
- row.appendChild(menulist);
- menulist.setAttribute('original',stat_entry.owner());
-
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- //sdump('D_LEGACY','About to populate with stat_entry.owner() = ' + stat_entry.owner() + '\n');
- populate_lib_list_with_branch(menulist,menupopup,stat_entry.owner(),mw.G.user_ou);
- } else {
-
- var labela = document.createElement('label');
- row.appendChild(labela);
- labela.setAttribute('value',stat_entry.value());
-
- row.appendChild( document.createElement('label') );
-
- var labelc = document.createElement('label');
- row.appendChild(labelc);
- labelc.setAttribute( 'value',mw.G.org_tree_hash[stat_entry.owner()].name() );
- }
- }
-
- var row3 = document.createElement('row');
- rows.appendChild(row3);
- row3.setAttribute('actsc_id',patron_stat_cat.id());
- row3.setAttribute('object_type','actsce');
- row3.setAttribute('new','true');
- addCSSClass(row3,'row' + i % 2);
-
- var label3 = document.createElement('label');
- row3.appendChild(label3);
- label3.setAttribute('value','New Entry:');
-
- var textbox3 = document.createElement('textbox');
- row3.appendChild(textbox3);
- textbox3.setAttribute('original','');
- textbox3.addEventListener(
- 'change',
- new_entry_listener,
- false
- );
-
- var checkbox3 = document.createElement('checkbox');
- row3.appendChild(checkbox3);
- checkbox3.setAttribute('delete','true');
-
- var menulist3 = document.createElement('menulist');
- row3.appendChild(menulist3);
- menulist3.setAttribute('original',mw.G.user_ou.id());
-
- var menupopup3 = document.createElement('menupopup');
- menulist3.appendChild(menupopup3);
- //sdump('D_LEGACY','About to populate with mw.G.user_ou\n');
- populate_lib_list_with_branch(menulist3,menupopup3,mw.G.user_ou,mw.G.user_ou);
-
- var row4 = document.createElement('row');
- rows.appendChild(row4);
- addCSSClass(row4,'row' + i % 2);
-
- var label4 = document.createElement('label');
- row4.appendChild(label4);
- label4.setAttribute('value',' ');
-
- var row5 = document.createElement('row');
- rows.appendChild(row5);
-
- var label5 = document.createElement('label');
- row5.appendChild(label5);
- label5.setAttribute('value',' ');
-
- }
-
- var row6 = document.createElement('row');
- rows.appendChild(row6);
-
- var label6 = document.createElement('label');
- row6.appendChild(label6);
- label6.setAttribute('value',' ');
-
- sdump('D_LEGACY','local_patron_stat_cat_entries = ' + pretty_print( js2JSON( local_patron_stat_cat_entries ) ) + '\n');
-}
-
-function save_patron_changes() {
-
- // XUL
-
- var nl = document.getElementsByTagName('textbox');
- for (var i = 0; i < nl.length; i++) {
- var t = nl[i];
- var row = t.parentNode;
- var object_type = row.getAttribute('object_type');
- var actsc_id = row.getAttribute('actsc_id');
- var actsce_id = row.getAttribute('actsce_id');
- var new_flag = row.getAttribute('new');
- var original = t.getAttribute('original');
- sdump('D_LEGACY','Considering textbox: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' value = ' + t.value + '\n');
-
- if ( (original != t.value) && (t.value != null) && (t.value != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'actsc':
- local_patron_stat_cats_hash[actsc_id].ischanged('1');
- local_patron_stat_cats_hash[actsc_id].name( t.value );
- break;
- case 'actsce':
- if (!actsce_id) {
- actsce_id = new_id--;
- row.setAttribute('actsce_id', actsce_id);
- local_patron_stat_cats_hash[ actsc_id ].entries().push( new actsce() );
- local_patron_stat_cat_entries[actsce_id] =
- local_patron_stat_cats_hash[ actsc_id].entries()[ local_patron_stat_cats_hash[ actsc_id].entries().length -1 ];
- local_patron_stat_cat_entries[actsce_id].id( actsce_id );
- local_patron_stat_cat_entries[actsce_id].isnew('1');
- local_patron_stat_cat_entries[actsce_id].stat_cat( actsc_id );
- local_patron_stat_cat_entries[actsce_id].owner(
- mw.G.user_ou.id()
- );
- local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
- }
- local_patron_stat_cat_entries[actsce_id].ischanged('1');
- local_patron_stat_cat_entries[actsce_id].value( t.value );
- break;
- }
- }
- }
- var nl = document.getElementsByTagName('menulist');
- for (var i = 0; i < nl.length; i++) {
- var m = nl[i];
- var row = m.parentNode;
- var object_type = row.getAttribute('object_type');
- var actsc_id = row.getAttribute('actsc_id');
- var actsce_id = row.getAttribute('actsce_id');
- var new_flag = row.getAttribute('new');
- var original = m.getAttribute('original');
-
- sdump('D_LEGACY','Considering menulist: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' value = ' + m.value + '\n');
-
- if ( (original != m.value) && (m.value != null) && (m.value != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'actsc':
- local_patron_stat_cats_hash[actsc_id].ischanged('1');
- local_patron_stat_cats_hash[actsc_id].owner( m.value );
- break;
- case 'actsce':
- if (actsce_id) {
- local_patron_stat_cat_entries[actsce_id].ischanged('1');
- local_patron_stat_cat_entries[actsce_id].owner( m.value );
- } else {
- sdump('D_LEGACY','\tbut nothing to do.\n');
- }
- break;
- }
- }
- }
-
- var nl = document.getElementsByTagName('checkbox');
- for (var i = 0; i < nl.length; i++) {
- var c = nl[i];
- var row = c.parentNode;
- var object_type = row.getAttribute('object_type');
- var actsc_id = row.getAttribute('actsc_id');
- var actsce_id = row.getAttribute('actsce_id');
- var new_flag = row.getAttribute('new');
- var delete_flag = c.getAttribute('delete');
- if (delete_flag == 'true') { delete_flag = true; }
- else if (delete_flag == 'false') { delete_flag = false; }
- var original = c.getAttribute('original');
- if (original == 'true') { original = true; }
- else if (original == 'false' ) { original = false; }
-
- sdump('D_LEGACY','Considering checkbox: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' checked = ' + m.checked + ' delete_flag = ' + delete_flag + '\n');
-
- if ( (original != c.checked) && (c.checked != null) && (c.checked != undefined) ) {
- sdump('D_LEGACY',"\tWe're in...\n");
- switch(object_type) {
- case 'actsc':
- local_patron_stat_cats_hash[actsc_id].ischanged('1');
- if (delete_flag) {
- local_patron_stat_cats_hash[actsc_id].isdeleted('1');
- } else {
- local_patron_stat_cats_hash[actsc_id].opac_visible( c.checked );
- }
- break;
- case 'actsce':
- if (actsce_id) {
- local_patron_stat_cat_entries[actsce_id].ischanged('1');
- if (delete_flag) {
- local_patron_stat_cat_entries[actsce_id].isdeleted('1');
- } else {
- // This actually doesn't exist on the actsce object
- //local_patron_stat_cat_entries[actsce_id].opac_visible( c.checked );
- }
- } else {
- sdump('D_LEGACY',"\tBut nothing to do.\n");
- }
- break;
- }
- }
- }
-
- sdump('D_LEGACY','local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
-
- // fieldmapper
- sdump('D_LEGACY','Creating, Updating, Deleting, Oh My...\n');
- for (var i = 0; i < local_patron_stat_cats.length; i++) {
- var patron_stat_cat = local_patron_stat_cats[i];
- sdump('D_LEGACY','Considering patron_stat_cat = ' + js2JSON(patron_stat_cat) + '\n');
-
- if ( (patron_stat_cat.name() == undefined) || (patron_stat_cat.name() == null)
- || (patron_stat_cat.name() == '') ) continue;
- if ( patron_stat_cat.isnew() == '1' ) {
- // This will handle patron_stat_cat and and it's entries
- try {
- if ( patron_stat_cat.isdeleted() != '1' ) {
- var r1 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.create',
- [ mw.G.auth_ses[0], patron_stat_cat ]
- )[0];
- sdump('D_LEGACY','r1 = ' + js2JSON(r1) + '\n');
- }
- } catch(E) {
- mw.handle_error(E);
- }
-
- } else {
- // We will also need to loop through the entries
-
- if ( (patron_stat_cat.ischanged() == '1') || (patron_stat_cat.isdeleted() == '1') ) {
- try {
- if (patron_stat_cat.isdeleted() == '1') {
- var r2 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.delete',
- [ mw.G.auth_ses[0], patron_stat_cat ]
- )[0];
- sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
- } else {
- var r2 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.update',
- [ mw.G.auth_ses[0], patron_stat_cat ]
- )[0];
- sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
-
- }
- } catch(E) {
- mw.handle_error(E);
- }
- }
- if (patron_stat_cat.isdeleted() != '1')
- for (var j = 0; j < patron_stat_cat.entries().length; j++) {
- var stat_entry = patron_stat_cat.entries()[j];
- sdump('D_LEGACY','\tConsidering stat_entry = ' + js2JSON(stat_entry) + '\n');
-
- if (stat_entry.isnew() == '1') {
- if (stat_entry.isdeleted() != '1') {
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.entry.create',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
- }
- } else if (stat_entry.isdeleted() == '1') {
-
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.entry.delete',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
- } else {
-
- var r3 = mw.user_request(
- 'open-ils.circ',
- 'open-ils.circ.stat_cat.actor.entry.update',
- [ mw.G.auth_ses[0], stat_entry ]
- );
- sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
- }
-
- }
-
- }
- }
-
- sdump('D_LEGACY','\n\n\n=-=-=-=-=-=-=-=-=\n\n\n');
-
- local_patron_stat_cat_entries = {};
- local_patron_stat_cats = [];
- local_patron_stat_cats_hash = {};
- sdump('D_LEGACY','Successfully updated the Stat Cats\n');
- alert('Successfully updated the Stat Cats\n');
- populate_local_patron_stat_cats(
- 'patron_stat_cat_grid',
- map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
- );
- document.getElementById('patron_stat_cat_new').disabled = false;
-}
-
-function new_patron_stat_cat(ev) {
- ev.target.disabled = true;
- var n_actsc = new actsc();
- n_actsc.isnew( '1' );
- n_actsc.id( new_id-- );
- n_actsc.owner( mw.G.user_ou.id() );
- n_actsc.entries( [] );
- local_patron_stat_cats.push( n_actsc );
- local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
- populate_local_patron_stat_cats_grid('patron_stat_cat_grid');
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// GENERIC
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-<overlay id="stat_cat_bundle"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('stat_cat_bundle\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_overlay.xul"?>
-
- <script src="stat_cat.js" />
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-<overlay id="stat_cat_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <vbox id="copy_stat_cat_editor" class="test_class" flex="1">
- <grid id="copy_stat_cat_grid" flex="1" style="overflow: auto;"/>
- <hbox id="copy_stat_cat_hbox2" flex="0">
- <button id="copy_stat_cat_new" label="New Stat Cat" oncommand="new_copy_stat_cat(event);"/>
- <spacer id="copy_stat_cat_spacer1" flex="1"/>
- <button id="copy_stat_cat_save" label="Save Changes" oncommand="save_copy_changes(event);"/>
- </hbox>
- </vbox>
-
- <grid id="copy_stat_cat_grid">
- <columns id="cscg_columns">
- <column id="cscg_label_column"/>
- <column id="cscg_textbox_column"/>
- <column id="cscg_checkbox_column"/>
- <column id="cscg_menulist_column"/>
- </columns>
- <rows id="cscg_rows"/>
- </grid>
-
- <vbox id="patron_stat_cat_editor" class="test_class" flex="1">
- <grid id="patron_stat_cat_grid" flex="1" style="overflow: auto;"/>
- <hbox id="patron_stat_cat_hbox2" flex="0">
- <button id="patron_stat_cat_new" label="New Stat Cat" oncommand="new_patron_stat_cat(event);"/>
- <spacer id="patron_stat_cat_spacer1" flex="1"/>
- <button id="patron_stat_cat_save" label="Save Changes" oncommand="save_patron_changes(event);"/>
- </hbox>
- </vbox>
-
- <grid id="patron_stat_cat_grid">
- <columns id="pscg_columns">
- <column id="pscg_label_column"/>
- <column id="pscg_textbox_column"/>
- <column id="pscg_checkbox_column"/>
- <column id="pscg_menulist_column"/>
- </columns>
- <rows id="pscg_rows"/>
- </grid>
-
-</overlay>
-
+++ /dev/null
-dump('Loading survey.js\n');
-
-var SURVEY = {};
-
-function survey_init() {
- dump('TESTING: survey.js: ' + mw.G.main_test_variable + '\n');
- populate_lib_list_with_branch('lib_menulist','lib_menupopup',mw.G.user_ou,mw.G.user_ou);
- SURVEY['asv'] = new asv(); SURVEY['asv'].isnew('1');
- SURVEY['num_of_questions'] = 0;
- document.getElementById('survey_name').focus();
-}
-
-function save_survey() {
- SURVEY.asv.description(
- document.getElementById('survey_description').value
- );
- SURVEY.asv.name(
- document.getElementById('survey_name').value
- );
- SURVEY.asv.owner(
- document.getElementById('lib_menulist').value
- );
- var survey_start = document.getElementById('survey_start').value;
- if (survey_start) {
- SURVEY.asv.start_date(
- survey_start
- );
- } else {
- SURVEY.asv.start_date(
- null
- );
- }
- var survey_end = document.getElementById('survey_end').value;
- if (survey_end) {
- SURVEY.asv.end_date(
- survey_end
- );
- } else {
- SURVEY.asv.end_date(
- null
- );
- }
- if ( document.getElementById('required_checkbox').checked ) {
- SURVEY.asv.required('1');
- } else {
- SURVEY.asv.required('0');
- }
- if ( document.getElementById('opac_checkbox').checked ) {
- SURVEY.asv.opac('1');
- } else {
- SURVEY.asv.opac('0');
- }
- if ( document.getElementById('poll_checkbox').checked ) {
- SURVEY.asv.poll('1');
- } else {
- SURVEY.asv.poll('0');
- }
-
- if ( document.getElementById('patron_summary_checkbox').checked ) {
- SURVEY.asv.usr_summary('1');
- } else {
- SURVEY.asv.usr_summary('0');
- }
- dump('before survey = ' + js2JSON( SURVEY.asv ) + '\n');
- try {
- var result = user_request(
- 'open-ils.circ',
- 'open-ils.circ.survey.create',
- [ mw.G.auth_ses[0], SURVEY.asv ]
- )[0];
- dump('result = ' + js2JSON( result ) + '\n');
- if (! (result instanceof asv) ) {
- throw('save_survey: result not an asv');
- }
- } catch(E) {
- dump('Survey failed: ' + js2JSON(E) + '\n');
- alert('Survey failed: ' + js2JSON(E) + '\n');
- throw(E);
- }
- dump('after survey = ' + js2JSON( SURVEY.asv ) + '\n');
-}
-
-function setDescription(e,t) {
- var page = document.getElementById(e);
- var desc = page.getAttribute('description');
- var value = document.getElementById(t).value;
- page.setAttribute('description',desc + ' ' + value);
-}
-
-var new_id = -1;
-function add_answer(e, my_asvq_id) {
- var row = e.target.parentNode;
- var rows = row.parentNode;
- var answer = e.target.previousSibling; answer.select();
-
- if (! answer.value ) { return; }
-
- /* XUL */
- var n_row = document.createElement('row');
- rows.insertBefore( n_row, row );
- var label_1 = document.createElement('label');
- n_row.appendChild( label_1 );
- var label_2 = document.createElement('label');
- label_2.setAttribute('value', answer.value );
- n_row.appendChild( label_2 );
-
- /* OBJECT */
-
- var my_asva = new asva(); my_asva.isnew('1'); my_asva.id( new_id-- );
- my_asva.answer( answer.value );
-
- var my_asvq = find_id_object_in_list( SURVEY.asv.questions(), my_asvq_id );
- if (my_asvq.answers() == null) {
- my_asvq.answers( [] );
- }
-
- my_asvq.answers().push( my_asva );
-
- var num_of_answers = my_asvq.answers().length;
- var last_number = 96 + num_of_answers;
- var next_number = 97 + num_of_answers;
- var last_letter = String.fromCharCode( last_number );
- var next_letter = String.fromCharCode( next_number );
- label_1.setAttribute('value', last_letter + ')' );
- row.firstChild.setAttribute('value', next_letter + ')' );
-
- if (num_of_answers == 26) {
- rows.removeChild(row);
- }
-}
-
-function add_question() {
- SURVEY.num_of_questions++;
- var question = document.getElementById('new_question');
-
- if (! question.value ) { return; }
-
- document.getElementById('survey_add').canAdvance = true;
-
- var my_asvq = new asvq(); my_asvq.isnew('1'); my_asvq.id( new_id-- );
- my_asvq.question( question.value );
-
- if ( SURVEY.asv.questions() == null ) {
- SURVEY.asv.questions( [] );
- }
-
- SURVEY.asv.questions().push( my_asvq );
-
- add_question_row(my_asvq);
-
- document.getElementById('new_question_label').setAttribute('value', '#' + (SURVEY.num_of_questions + 1) );
- question.select();
-}
-
-function add_question_row(my_asvq) {
- var rows = document.getElementById('page2_grid1_rows');
- var row = document.createElement('row');
- rows.insertBefore(row, document.getElementById('page2_grid1_row1'));
-
- var label_number = document.createElement('label');
- label_number.setAttribute('value','#' + SURVEY['num_of_questions']);
- row.appendChild(label_number);
-
- var grid = document.createElement('grid');
- row.appendChild(grid);
- var g_cols = document.createElement('columns');
- grid.appendChild(g_cols);
- var g_col_1 = document.createElement('column');
- g_cols.appendChild(g_col_1);
- var g_col_2 = document.createElement('column');
- g_col_2.setAttribute('flex','1');
- g_cols.appendChild(g_col_2);
- var g_col_3 = document.createElement('column');
- g_cols.appendChild(g_col_3);
- var g_rows = document.createElement('rows');
- grid.appendChild(g_rows);
- var g_row_1 = document.createElement('row');
- g_rows.appendChild(g_row_1);
- var g_label_1 = document.createElement('label');
- g_row_1.appendChild(g_label_1);
- var g_label_2 = document.createElement('label');
- g_label_2.setAttribute('value', my_asvq.question() );
- g_row_1.appendChild(g_label_2);
- var g_row_2 = document.createElement('row');
- g_rows.appendChild(g_row_2);
- var g_label2_1 = document.createElement('label');
- g_label2_1.setAttribute('value', 'a)' );
- g_row_2.appendChild(g_label2_1);
- var g_tb = document.createElement('textbox');
- g_tb.setAttribute('flex','1');
- g_row_2.appendChild(g_tb);
- var g_b = document.createElement('button');
- g_b.setAttribute('label','Save this Response');
- g_b.setAttribute('oncommand','add_answer(event,' + my_asvq.id() + ');');
- g_row_2.appendChild(g_b);
-
- var blank = document.createElement('row');
- rows.insertBefore( blank , document.getElementById('page2_grid1_row1') );
- var blank2 = document.createElement('label');
- blank2.setAttribute('value', ' ');
- blank.appendChild( blank2 );
-}
-
-function page1_check_advance() {
- if ( document.getElementById('survey_name').value ) {
- document.getElementById('survey_add').canAdvance = true;
- } else {
- document.getElementById('survey_add').canAdvance = false;
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/survey.dtd">
-<overlay id="survey_bundle"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('survey_bundle\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/survey/survey_overlay.xul"?>
-
- <script src="survey.js" />
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/survey.dtd">
-<overlay id="survey_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <wizardpage id="page1"
- description="&survey.wizard.page1;"
- onpageadvanced="setDescription('page2','survey_name');"
- onpageshow="document.getElementById('survey_add').canAdvance = false; document.getElementById('survey_name').focus();"
- >
- <grid id="page1_grid1"/>
- </wizardpage>
-
- <grid id="page1_grid1">
- <columns id="page1_grid1_columns">
- <column id="page1_grid1_column1"/>
- <column id="page1_grid1_column2"/>
- <column id="page1_grid1_column3"/>
- <column id="page1_grid1_column4"/>
- </columns>
- <rows id="page1_grid1_rows">
- <row id ="page1_grid1_row1"/>
- <row id ="page1_grid1_row1c"/>
- <row id ="page1_grid1_row1a"/>
- <row id ="page1_grid1_row1b"/>
- <row id ="page1_grid1_row2"/>
- <row id ="page1_grid1_row3"/>
- </rows>
- </grid>
-
- <row id="page1_grid1_row1">
- <label id="page1_row1_label1" value="Available to:" class="wizard_label"/>
- <menulist id="lib_menulist">
- <menupopup id="lib_menupopup"/>
- </menulist>
- <label id="page1_row1_label2" value="Required:" class="wizard_label"/>
- <checkbox id="required_checkbox"/>
- </row>
-
- <row id="page1_grid1_row1c">
- <label id="page1_row1c_label1"/>
- <label id="page1_row1c_label2"/>
- <label id="page1_row1c_label3" value="Poll Format:" class="wizard_label"/>
- <checkbox id="poll_checkbox"/>
- </row>
-
-
- <row id="page1_grid1_row1a">
- <label id="page1_row1a_label1"/>
- <label id="page1_row1a_label2"/>
- <label id="page1_row1a_label3" value="OPAC Visible:" class="wizard_label"/>
- <checkbox id="opac_checkbox"/>
- </row>
-
- <row id="page1_grid1_row1b">
- <label id="page1_row1b_label1"/>
- <label id="page1_row1b_label2"/>
- <label id="page1_row1b_label3" value="Staff Client:" class="wizard_label"/>
- <checkbox id="patron_summary_checkbox"/>
- </row>
-
- <row id="page1_grid1_row2">
- <label id="page1_row2_label1" value="Name:" class="wizard_label"/>
- <textbox id="survey_name" onchange="page1_check_advance();" onkeyup="page1_check_advance();" />
- <label id="page1_row2_label2" value="Start:" class="wizard_label"/>
- <textbox id="survey_start"/>
- </row>
-
- <row id="page1_grid1_row3">
- <label id="page1_row3_label1" value="Description:" class="wizard_label"/>
- <textbox id="survey_description" multiline="true" rows="4"/>
- <label id="page1_row3_label2" value="End:" class="wizard_label"/>
- <vbox id="page1_row3_vbox1">
- <textbox id="survey_end"/>
- </vbox>
- </row>
-
- <wizardpage id="page2"
- description="&survey.wizard.page2;"
- onpageshow="document.getElementById('survey_add').canAdvance = false; document.getElementById('new_question').focus();"
- >
- <separator id="page2_separator1"/>
- <grid id="page2_grid1"/>
- </wizardpage>
-
- <grid id='page2_grid1'>
- <columns id="page2_grid1_columns">
- <column id="page2_grid1_column1"/>
- <column id="page2_grid1_column2" flex="1"/>
- <column id="page2_grid1_column3"/>
- </columns>
- <rows id="page2_grid1_rows"/>
- </grid>
-
-
- <rows id="page2_grid1_rows">
- <row id="page2_grid1_row1">
- <label id="new_question_label" value="#1"/>
- <textbox id="new_question" flex="1"/>
- <button id="page2_button1" label="Save this Question" oncommand="add_question(event);"/>
- </row>
- </rows>
-
-</overlay>
-
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/survey.css" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/survey.dtd">
-<wizard id="survey_add" title="&survey.wizard.title;"
- orient="vertical" style="overflow: auto"
- onload="survey_init();" width="800" height="600"
- onwizardfinish="save_survey();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
- <!-- Overlays for this XUL file -->
- <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?> -->
- <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
- <?xul-overlay href="chrome://evergreen/content/survey/survey_bundle.xul"?>
-
- <!-- OpenSRF -->
- <script>var myPackageDir = "evergreen";</script>
- <OpenSRF id="OpenSRF_js" />
-
- <!-- Layout to be filled in by overlays and javascript -->
- <wizardpage id="page1"/>
- <wizardpage id="page2"/>
-
-</wizard>
-
+++ /dev/null
-// Modified by Jason for Evergreen
-
-function startEvergreenStaffClient() {
- if (! window.open('chrome://evergreen/content/auth/auth.xul','auth_win','chrome') )
- alert('Could not start Evergreen');
-}
-
-function startEvergreenOPAC() {
- var text = evergreenGetSelectedText();
- var url = 'http://dev.gapines.org/';
- if (text) {
- url = 'http://dev.gapines.org/opac/'
- + '?target=mr_result'
- + '&mr_search_type=keyword'
- + '&mr_search_query=' + encodeURIComponent( text )
- + '&mr_search_location=1'
- + '&mr_search_depth=0'
- + '&page=0'
- + '&sub_frame=1';
- }
- if (! window.open(url,'dev.gapines.org') )
- alert('Could not load http://dev.gapines.org/');
-}
-
-function evergreenGetSelectedText() {
- var node = document.popupNode;
- var selection = "";
- var nodeLocalName = node.localName.toUpperCase();
- if ((nodeLocalName == "TEXTAREA") || (nodeLocalName == "INPUT" && node.type == "text")) {
- selection = node.value.substring(node.selectionStart, node.selectionEnd);
- }
- else {
- var focusedWindow = new XPCNativeWrapper(document.commandDispatcher.focusedWindow, 'document', 'getSelection()');
- selection = focusedWindow.getSelection().toString();
- }
- selection = selection.replace(/(^\s+)|(\s+$)/g, "");
-
- return selection;
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="util"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script src="chrome://evergreen/content/util/browser_overlay.js"/>
-
- <popup id="contentAreaContextMenu">
- <menuitem id="evergreen_right_click_menu"
- label="Search Evergreen OPAC"
- accesskey=""
- insertafter="context-stop"
- oncommand="startEvergreenOPAC();"/>
- </popup>
-
- <menupopup id="menu_ToolsPopup">
- <menuitem id="evergreen_tools_menu"
- insertafter="devToolsSeparator"
- label="Evergreen Staff Client"
- accesskey="g"
- oncommand="startEvergreenStaffClient();" />
- </menupopup>
-
-</overlay>
+++ /dev/null
-var timer = {};
-
-function timer_init(id) {
- timer[id] = (new Date).getTime();
-}
-
-function timer_elapsed(id) {
- if (! timer[id]) { timer_init(id); }
- var ms = (new Date).getTime() - timer[id];
- return( ms + 'ms (' + ms/1000 + 's)' );
-}
-
-function db_date2Date(date) {
- var y = date.substr(0,4);
- var mo = date.substr(5,2);
- var d = date.substr(8,2);
- var h = date.substr(11,2);
- var mi = date.substr(14,2);
- var s = date.substr(17,2);
- return new Date(y,mo,d,h,mi,s);
-}
-
-function formatted_date(date,format) {
- // pass in a Date object or epoch seconds or a postgres style date string (2005-07-19 10:38:25.211964-04)
- if (typeof(date) == 'string') {
- if (date.match(/:/) || date.match(/-/)) {
- date = db_date2Date(date);
- } else {
- date = new Date( parseInt( date + '000' ) );
- }
- } else if (typeof(date) == 'undefined') {
- date = new Date( parseInt( date + '000' ) );
- }
- var mm = date.getMonth() + 1; mm = mm.toString(); if (mm.length == 1) mm = '0' +mm;
- var dd = date.getDate().toString(); if (dd.length == 1) dd = '0' +dd;
- var yyyy = date.getFullYear().toString();
- var yy = yyyy.substr(2);
- var H = date.getHours(); H = H.toString(); if (H.length == 1) H = '0' + H;
- var I = date.getHours(); if (I > 12) I -= 12; I = I.toString();
- var M = date.getMinutes(); M = M.toString(); if (M.length == 1) M = '0' + M;
- var s = format;
- s = s.replace( /%m/g, mm );
- s = s.replace( /%d/g, dd );
- s = s.replace( /%Y/g, yyyy );
- s = s.replace( /%D/g, mm + '/' + dd + '/' + yy );
- s = s.replace( /%F/g, yyyy + '-' + mm + '-' + dd );
- s = s.replace( /%H/g, H );
- s = s.replace( /%I/g, I );
- s = s.replace( /%M/g, M );
- return s;
-}
-
-function interval_to_seconds ( $interval ) {
-
- $interval = $interval.replace( /and/, ',' );
- $interval = $interval.replace( /,/, ' ' );
-
- var $amount = 0;
- var results = $interval.match( /\s*\+?\s*(\d+)\s*(\w{1})\w*\s*/g);
- for (var i in results) {
- var result = results[i].match( /\s*\+?\s*(\d+)\s*(\w{1})\w*\s*/ );
- if (result[2] == 's') $amount += result[1] ;
- if (result[2] == 'm') $amount += 60 * result[1] ;
- if (result[2] == 'h') $amount += 60 * 60 * result[1] ;
- if (result[2] == 'd') $amount += 60 * 60 * 24 * result[1] ;
- if (result[2] == 'w') $amount += 60 * 60 * 24 * 7 * result[1] ;
- if (result[2] == 'M') $amount += ((60 * 60 * 24 * 365)/12) * result[1] ;
- if (result[2] == 'y') $amount += 60 * 60 * 24 * 365 * result[1] ;
- }
- return $amount;
-}
-
-
+++ /dev/null
-sdump('D_TRACE',"Loading error.js\n");
-
-var consoleService = Components.classes['@mozilla.org/consoleservice;1']
- .getService(Components.interfaces.nsIConsoleService);
-
-var printDebug = false;
-var consoleDump = true;
-var debugDump = true;
-var arg_dump_full = false;
-
-var sdump_levels = {
- 'D_NONE' : false,
- 'D_ALL' : false,
- 'D_ERROR' : true,
- 'D_DEBUG' : true,
- 'D_TRACE' : false,
- 'D_TRACE_ENTER' : false,
- 'D_TRACE_EXIT' : false,
- 'D_TIMEOUT' : false,
- 'D_FILTER' : false,
- 'D_CONSTRUCTOR' : false,
- 'D_FIREFOX' : false,
- 'D_LEGACY' : false,
-
- 'D_CLAM' : false,
- 'D_PAGED_TREE' : false,
- 'D_GRID_LIST' : false,
- 'D_HTML_TABLE' : false,
- 'D_TAB' : false,
-
- 'D_AUTH' : true,
-
- 'D_OPAC' : true,
-
- 'D_PATRON_SEARCH' : false,
- 'D_PATRON_SEARCH_FORM' : false,
- 'D_PATRON_SEARCH_RESULTS' : false,
-
- 'D_PATRON_DISPLAY' : false,
- 'D_PATRON_DISPLAY_STATUS' : false,
- 'D_PATRON_DISPLAY_CONTACT' : false,
-
- 'D_PATRON_ITEMS' : false,
- 'D_PATRON_CHECKOUT_ITEMS' : false,
- 'D_PATRON_HOLDS' : false,
- 'D_PATRON_BILLS' : false,
- 'D_PATRON_EDIT' : false,
-
- 'D_CHECKIN' : false,
- 'D_CHECKIN_ITEMS' : false,
-
- 'D_HOLD_CAPTURE' : false,
- 'D_HOLD_CAPTURE_ITEMS' : false,
-
- 'D_CAT' : false,
-
- 'D_PATRON_UTILS' : false,
- 'D_CIRC_UTILS' : false,
-
- 'D_FILE' : true,
- 'D_EXPLODE' : false,
- 'D_FM_UTILS' : false,
- 'D_PRINT' : true,
- 'D_SES' : true,
- 'D_SES_FUNC' : false,
- 'D_SES_RESULT' : true,
- 'D_SPAWN' : false,
- 'D_STRING' : false,
- 'D_UTIL' : false,
- 'D_WIN' : false,
- 'D_WIDGETS' : false
-
-};
-
-var sdump_last_time = new Date();
-
-function filter_console_init(p) {
- sdump('D_FILTER',arg_dump(arguments,{0:true}));
-
- var filterConsoleListener = {
- observe: function( msg ) {
- try {
- p.observe_msg( msg );
- } catch(E) {
- alert(E);
- }
- },
- QueryInterface: function (iid) {
- if (!iid.equals(Components.interfaces.nsIConsoleListener) &&
- !iid.equals(Components.interfaces.nsISupports)) {
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- return this;
- }
- };
- try {
- consoleService.registerListener(filterConsoleListener);
- } catch(E) {
- alert(E);
- }
-
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function sdump(level,msg) {
- try {
- var now = new Date();
- var message = now.valueOf() + '\tdelta = ' + (now.valueOf() - sdump_last_time.valueOf()) + '\n' + level + '\n' + msg;
- if (sdump_levels['D_NONE']) return null;
- if (sdump_levels[level]||sdump_levels['D_ALL']) {
- sdump_last_time = now;
- if (debugDump)
- debug(message);
- if (consoleDump)
- consoleService.logStringMessage(message);
- }
- } catch(E) {
- dump('Calling sdump but ' + E + '\n');
- }
-}
-
-function arg_dump(args,dump_these) {
- var s = '*>*>*> Called function ';
- try {
- if (!dump_these)
- dump_these = {};
- s += args.callee.toString().match(/\w+/g)[1] + ' : ';
- for (var i = 0; i < args.length; i++)
- s += typeof(args[i]) + ' ';
- s += '\n';
- for (var i = 0; i < args.length; i++)
- if (dump_these[i]) {
-
- var arg = args[i];
- //dump('dump_these[i] = ' + dump_these[i] + ' arg = ' + arg + '\n');
-
- if (typeof(dump_these[i])=='string') {
-
- if (dump_these[i].slice(0,1) == '.') {
- var cmd = 'arg' + dump_these[i];
- var result;
- try {
- result = eval( cmd );
- } catch(E) {
- result = cmd + ' ==> ' + E;
- }
- s += '\targ #' + i + ': ' + cmd + ' = ' + result;
- } else {
- var result;
- try {
- result = eval( dump_these[i] );
- } catch(E) {
- result = dump_these[i] + ' ==> ' + E;
- }
- s += '\targ #' + i + ': ' + result;
- }
-
- } else {
- s += '\targ #' + i + ' = ';
- try {
- //s += js2JSON( arg );
- s += arg;
- } catch(E) {
- s += arg;
- }
- }
-
- s += '\n';
- if (arg_dump_full)
- s += 'Definition: ' + args.callee.toString() + '\n';
-
- }
- return s;
- } catch(E) {
- return s + '\nDEBUG ME: ' + js2JSON(E) + '\n';
- }
-}
-
-function handle_error(E,annoy) {
- var s = '';
- if (instanceOf(E,ex)) {
- s += E.err_msg();
- //s += '\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n';
- //s += 'This error was anticipated.\n\n';
- //s += js2JSON(E).substr(0,200) + '...\n\n';
- if (snd_bad) snd_bad();
- } else {
- s += '\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n';
- s += 'This is a bug that we will fix later.\n\n';
- try {
- s += mw.js2JSON(E).substr(0,1024) + '\n\n';
- } catch(E2) {
- try {
- s += E.substr(0,1024) + '\n\n';
- } catch(E3) {
- s += E + '\n\n';
- }
- }
- if (snd_really_bad) snd_really_bad();
- }
- sdump('D_ERROR',s);
- if (annoy)
- s_alert(s);
- else
- alert(s);
-}
-
+++ /dev/null
-sdump('D_TRACE','Loading explode.js\n');
-var EXPLODE = {};
-
-function explode_aou(id) {
- return find_ou( mw.G.org_tree, id );
-}
-EXPLODE.aou = explode_aou;
-EXPLODE.au_homelib = explode_aou;
-
-function explode_ap(id) {
- //return find_id_object_in_list( mw.G.ap_list, id );
- return mw.G.ap_hash[ id ];
-}
-EXPLODE.ap = explode_ap;
-EXPLODE.au_profile = explode_ap;
-
-function magic_field_edit( ev, otype, o_id, field, explode ) {
- sdump('D_TRACE','\nIn magic_field_edit\n')
- var target = ev.target;
- sdump('D_EXPLODE','\ttarget = ' + target + '\n');
- sdump('D_EXPLODE','\totype = ' + otype + '\n');
- sdump('D_EXPLODE','\tfield = ' + field + '\n');
- var value = target.value;
- sdump('D_EXPLODE','\tvalue = ' + value + '\n');
- sdump('D_EXPLODE','\texplode = ' + explode + '\n');
- try {
- if (explode) {
- var command = ( 'value = EXPLODE.' + otype + '_' + field + '(' + value + ');' );
- sdump('D_EXPLODE','\tcommand = ' + command + '\n');
- eval( command );
- }
- } catch(E) {
- sdump('D_EXPLODE', '\tNo EXPLODE.' + otype + '_' + field + '() defined\n' );
- }
- sdump('D_EXPLODE','\tvalue = ' + value + '\n');
- sdump('D_EXPLODE','\t' + otype + '_id = ' + o_id + '\n');
- // ######## method 1, node in element
- var row = document.getElementById( otype + o_id );
- if (row) {
- var node = JSON2js(row.getAttribute('node'));
- sdump('D_EXPLODE','\telem: original node = ' + js2JSON(node) + '\n');
- var command = ( 'node.' + field + '(' + js2JSON(value) + ');');
- eval(command);
- var command2 = ( 'node.ischanged("1");');
- eval(command2);
- sdump('D_EXPLODE','\telem: after edit = ' + js2JSON(node) + '\n');
- row.setAttribute('node',js2JSON(node));
- } else {
- sdump('D_EXPLODE','\tCould not find containing element with id = ' + otype + o_id + '\n');
- }
- // ######## method 2, node in hash
- try {
- var myhash = eval('hash_'+otype);
- if (typeof(myhash) == 'object') {
- if (! myhash[o_id] ) { myhash[o_id] = eval('new ' + otype + '();'); }
- sdump('D_EXPLODE','\thash: original node = ' + js2JSON(myhash[o_id]) + '\n');
- var command = ('myhash[o_id].' + field + '(' + js2JSON(value) + ');');
- eval(command);
- var command2 = ( 'myhash[o_id].ischanged("1");');
- eval(command2);
- sdump('D_EXPLODE','\thash: after edit = ' + js2JSON(myhash[o_id]) + '\n');
- }
- } catch(E) {
- sdump('D_EXPLODE','magic_field_edit: ' + js2JSON(E) + '\n');
- }
-}
-
+++ /dev/null
-sdump('D_TRACE','Loading file.js\n');
-
-var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
- getService( Components.interfaces.nsIProperties );
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////
-
-function set_object_in_file(file,obj) {
- try {
- if (obj) {
- if (typeof(file)=='string') file = get_file( file );
- var f = create_output_stream(file);
- var obj_json = js2JSON( obj );
- f.write( obj_json, String( obj_json ).length ); f.close();
- } else {
- throw('Tried setting obj = ' + obj + '\n');
- }
- } catch(E) {
- sdump('D_FILE', 'set_object_in_file: ' + js2JSON(E) + '\n');
- throw(E);
- }
-}
-
-function get_object_in_file(file) {
- try {
- if (typeof(file)=='string') file = get_file( file );
- if (file.exists()) {
- var f = create_input_stream(file);
- var data = f.read(-1);
- var obj = JSON2js( data );
- f.close();
- return obj;
- } else {
- throw('File does not exist. ');
- }
- } catch(E) {
- sdump('D_FILE', 'get_object_in_file: ' + js2JSON(E) + '\n');
- throw(E);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////
-
-function create_input_stream(file) {
- try {
- if (typeof(file)=='string') file = get_file( file );
- var f = Components.classes["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Components.interfaces.nsIFileInputStream);
- if (file && file.exists()) {
- f.init(file, 0x01, 0, 0);
- var s = Components.classes["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Components.interfaces.nsIScriptableInputStream);
- if (f) {
- s.init(f);
- return s;
- }
- }
- } catch(E) {
- sdump('D_ERROR', E);
- }
- return null;
-}
-
-function create_output_stream(file) {
- try {
- if (typeof(file)=='string') file = get_file( file );
- var f = Components.classes["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Components.interfaces.nsIFileOutputStream);
- if (file) {
- if (! file.exists()) file.create( 0, 0640 );
- f.init(file, 0x02 | 0x08 | 0x20, 0644, 0);
- return f;
- }
- } catch(E) {
- sdump('D_ERROR', E);
- }
- return null;
-}
-
-function get_file( fname ) {
- try {
- file = dirService.get( "AChrom", Components.interfaces.nsIFile );
- file.append(mw.myPackageDir); file.append("content"); file.append("conf"); file.append(fname);
- sdump('D_FILE','get_file( ' + fname + ').path = ' + file.path + '\n');
- return file;
- } catch(E) {
- sdump('D_ERROR', E);
- return null;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="filter_console_win"
- onload="try { my_init(); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading filter_console.xul\n');</script>
-
- <script>
- <![CDATA[
-
- var rows; var containing; var not_containing;
-
- function my_init() {
-
- rows = document.getElementById('filter_console_grid_rows');
- containing = document.getElementById('filter_console_containing');
- not_containing = document.getElementById('filter_console_not_containing');
-
- mw.filter_console_init( {'observe_msg':observe_msg} );
- build_sdump_menu();
- }
-
- function build_sdump_menu() {
- try {
- var mp = document.getElementById('fcmp');
- for (var i in mw.sdump_levels) {
- var m = document.createElement( 'menuitem' );
- mp.appendChild(m);
- m.setAttribute('type','checkbox');
- m.setAttribute('label',i);
- m.setAttribute('checked',mw.sdump_levels[i]);
- m.setAttribute('oncommand',
- "mw.sdump_levels."+i+"=!mw.sdump_levels."+i+
- "; this.setAttribute('checked',mw.sdump_levels."+i+");");
- }
- } catch(E) {
- alert(E);
- }
- }
-
- function observe_msg(msg) {
-
- try {
- var row = document.createElement('row');
- rows.appendChild(row);
-
- var hbox = document.createElement('hbox');
- row.appendChild(hbox);
- hbox.flex = 1;
-
- var tb = document.createElement('textbox');
- hbox.appendChild(tb);
- tb.setAttribute('multiline','true');
- tb.setAttribute('readonly','true');
- tb.setAttribute('rows','5');
- tb.setAttribute('flex','1');
- tb.setAttribute('value',msg.message);
-
- } catch(E) { dump(E) }
- }
-
- function test_filter(msg) {
- var pass = true;
- var c_array = containing.value.split(' ');
- var nc_array = not_containing.value.split(' ');
- for (var i = 0; i < c_array.length; i++) {
- var term = c_array[i];
- if (term != '' && term != null && term != undefined)
- if (! msg.match( term ) )
- pass = false;
- }
- for (var i = 0; i < nc_array.length; i++) {
- var term = nc_array[i];
- if (term != '' && term != null && term != undefined)
- if (msg.match( term ) )
- pass = false;
- }
- return pass;
- }
-
- function clear_rows(prune) {
- var delete_these = [];
- for (var i = 0; i < rows.childNodes.length; i++) {
- var row = rows.childNodes[i];
- var tb = row.firstChild.firstChild;
- var delete_me = ! test_filter(tb.value);
- if (!prune) delete_me = true;
- if (delete_me) delete_these.push( row );
- }
- var row; while (row = delete_these.pop()) { rows.removeChild(row); }
- }
-
- function hide_rows() {
- for (var i = 0; i < rows.childNodes.length; i++) {
- var row = rows.childNodes[i];
- var tb = row.firstChild.firstChild;
- row.hidden = ! test_filter(tb.value);
- }
- }
-
- function calc_delta() {
- var first;
- var last;
- for (var i = 0; i < rows.childNodes.length; i++) {
- var row = rows.childNodes[i];
- if (! row.hidden ) {
- var tb = row.firstChild.firstChild;
- if (!first) first = parseInt( tb.value.split(' ')[0] );
- last = parseInt( tb.value.split(' ')[0] );
- }
- }
- document.getElementById('fc_calc_delta_label').setAttribute('value',last-first);
- }
-
- ]]>
- </script>
-
- <popupset>
- <menupopup id="fcmp" position="after_start">
- </menupopup>
- </popupset>
-
- <vbox id="filter_console_vbox" flex="1">
- <groupbox id="filter_console_groupbox" orient="vertical" flex="1">
- <caption id="fcgbc" label="Filterable Javascript Console"/>
- <grid id="filter_console_nav_grid">
- <columns id="fcnvc"><column id="fcnvc1"/><column id="fcnvc2" flex="1"/></columns>
- <rows id="fcnvr">
- <row id="fcnvr1">
- <label id="fcgbhb1l" value="Containing:" class="text_right" accesskey="o" control="filter_console_containing"/>
- <textbox id="filter_console_containing" flex="1"/>
- </row>
- <row id="fcnvr2">
- <label id="fcgbhb1l" value="Not Containing:" class="text_right" accesskey="N" control="filter_console_not_containing"/>
- <textbox id="filter_console_not_containing" flex="1"/>
- </row>
- <row id="fcnvr3">
- <spacer id="fcnvr3s1"/>
- <hbox id="fcnvr3hb1" flex="1">
- <button id="fc_sdump_levels" popup="fcmp" label="Set SDUMP Logging" accesskey="S"/>
- <button id="fc_filter_view" label="View with Filters" accesskey="V" oncommand="hide_rows();"/>
- <button id="fc_calc_delta" label="Delta (Last-1st sdump)" accesskey="D" oncommand="calc_delta();"/>
- <label id="fc_calc_delta_label" />
- <spacer id="fcnvr3hb1s1" flex="1"/>
- <button id="fc_filter_prune" label="Prune Hidden" accesskey="P" oncommand="clear_rows(true);"/>
- <button id="fc_clear" label="Clear" accesskey="C" oncommand="clear_rows(false);"/>
- </hbox>
- </row>
- </rows>
- </grid>
- <grid id="filter_console_grid" flex="1" style="overflow: auto;">
- <columns id="fcgc"><column id="fcgc1" flex="1"/></columns>
- <rows id="filter_console_grid_rows"/>
- </grid>
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-sdump('D_TRACE','Loading fm_utils.js\n');
-
-function get_my_orgs(user_ou) {
-
- // self and ancestors
- var current_item_id = user_ou.id();
- //sdump('D_FM_UTILS','mw.G[user_ou] = ' + js2JSON(mw.G['user_ou']) + '\n');
- //sdump('D_FM_UTILS','current_item_id = ' + current_item_id + '\n');
- var item_ou; var my_orgs = {}; var other_orgs = {};
- while( item_ou = find_ou(mw.G['org_tree'],current_item_id) ) {
- //sdump('D_FM_UTILS','\titem_ou = ' + js2JSON(item_ou) + '\n');
- my_orgs[ item_ou.id() ] = item_ou;
- current_item_id = item_ou.parent_ou();
- if (!current_item_id) { break; }
- }
-
- current_item_id = user_ou.id();
- //sdump('D_FM_UTILS','self & ancestors : my_orgs = <<<'+js2JSON(my_orgs)+'>>>\n');
- // descendants
- var my_children;
- var find_ou_result = find_ou(mw.G['org_tree'],current_item_id);
- if (find_ou_result) {
- my_children = find_ou_result.children() }
- else {
- sdump('D_FM_UTILS','ERROR: find_ou(org_tree,'+current_item_id+') returned with no properties\n');
- };
- //sdump('D_FM_UTILS','my_children: ' + my_children + ' : ' + js2JSON(my_children) + '\n');
- if (my_children) {
- for (var i = 0; i < my_children.length; i++) {
- var my_child = my_children[i];
- my_orgs[ my_child.id() ] = my_child;
- //sdump('D_FM_UTILS','my_child.children(): ' + my_child.children() + ' : ' + js2JSON(my_child.children()) + '\n');
- if (my_child.children() != null) {
- for (var j = 0; j < my_child.children().length; j++) {
- var my_gchild = my_child.children()[j];
- my_orgs[ my_gchild.id() ] = my_gchild;
- }
- }
- }
- }
- //sdump('D_FM_UTILS','& descendants : my_orgs = <<<'+js2JSON(my_orgs)+'>>>\n');
- return my_orgs;
-}
-
-function get_other_orgs(org,other_orgs) {
-}
-
-function flatten_ou_branch(branch) {
- //sdump('D_FM_UTILS','flatten: branch = ' + js2JSON(branch) + '\n');
- var my_array = new Array();
- my_array.push( branch );
- for (var i in branch.children() ) {
- var child = branch.children()[i];
- if (child != null) {
- var temp_array = flatten_ou_branch(child);
- for (var j in temp_array) {
- my_array.push( temp_array[j] );
- }
- }
- }
- return my_array;
-}
-
-/*
-function findOrgUnit(id) {
- return find_ou(globalOrgTree, id);
-}
-*/
-
-function find_ou(tree,id) {
- if (typeof(id)=='object') { id = id.id(); }
- if (tree.id()==id) {
- return tree;
- }
- for (var i in tree.children()) {
- var child = tree.children()[i];
- ou = find_ou( child, id );
- if (ou) { return ou; }
- }
- return null;
-}
-
-function find_ou_by_shortname(tree,sn) {
- var ou = new aou();
- if (tree.shortname()==sn) {
- return tree;
- }
- for (var i in tree.children()) {
- var child = tree.children()[i];
- ou = find_ou_by_shortname( child, sn );
- if (ou) { return ou; }
- }
- return null;
-}
-
-function render_fm(d,obj) {
- sdump('D_FM_UTILS',arg_dump(arguments,{1:true}));
- var nl = d.getElementsByAttribute('render','true');
- for (var i = 0; i < nl.length; i++) {
- var node = nl[i];
- var fm_class = node.getAttribute('fm_class');
- var render_value = node.getAttribute('render_value');
- var render_css_style = node.getAttribute('render_css_style');
- var render_css_class = node.getAttribute('render_css_class');
- if ( !fm_class ) continue;
- if ( obj[ fm_class ] ) {
- sdump('D_FM_UTILS',"We're in:\n\trender_value = " + render_value + "\n\trender_css_style = " + render_css_style + "\n\trender_css_class = " + render_css_class + "\n");
- if (render_value) {
- var result = ''; var cmd = '';
- cmd = parse_render_string( 'obj[ fm_class ]', render_value );
- try { result = eval( cmd ); } catch(E) { sdump('D_ERROR',E); }
- set_widget_value_for_display( node, result );
- sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
- }
- if (render_css_style) {
- var result = ''; var cmd = '';
- cmd = parse_render_string( 'obj[ fm_class ]', render_css_style );
- cmd = parse_render_string( 'result', cmd, /\%\%/g );
- try { result = eval(cmd); } catch(E) { sdump('D_ERROR',E); }
- node.setAttribute('style',result);
- sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
- }
- if (render_css_class) {
- var result = ''; var cmd = '';
- cmd = parse_render_string( 'obj[ fm_class ]', render_css_class );
- cmd = cmd.replace( /\%\%/g, 'result' );
- try { result = eval(cmd); } catch(E) { sdump('D_ERROR',E); }
- node.setAttribute('class',result);
- sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
- }
- }
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="fm_view_win"
- onload="try { my_init(); } catch(E) { alert(E); }"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>mw.sdump('D_TRACE','Loading fm_view.xul\n');</script>
-
- <script>
- <![CDATA[
- var tree;
-
- function my_init() {
- var treechildren = window.document.getElementById('tc');
- var fm = mw.user_request('open-ils.actor','opensrf.open-ils.system.fieldmapper',[])[0];
- var fma = []; var fmh = {} ;
- for (var i in fm) { fmh[ fm[i].hint ] = fm[i]; fma.push( [ fm[i].hint, i ] ); }
- fma.sort();
- for (var i = 0; i < fma.length; i++) {
- var hint = fma[i][0]; var name = fma[i][1]; var o = fmh[ hint ];
- var ti = window.document.createElement('treeitem');
- treechildren.appendChild( ti );
- ti.setAttribute( 'container', 'true' );
- var tr = window.document.createElement('treerow');
- ti.appendChild( tr );
- var tc = window.document.createElement('treecell');
- tr.appendChild( tc );
- tc.setAttribute('label',hint);
- tc = window.document.createElement('treecell');
- tr.appendChild( tc );
- tc.setAttribute('label', name );
- var _treechildren = window.document.createElement( 'treechildren' );
- ti.appendChild( _treechildren );
- for (var j in o.fields) {
- var _ti = window.document.createElement( 'treeitem' );
- _treechildren.appendChild( _ti );
- _ti.setAttribute('fm_class',hint);
- _ti.setAttribute('fm_field',j);
- _ti.setAttribute('fm_virtual',o.fields[j].virtual);
- _ti.setAttribute('fm_position',o.fields[j].position);
- var _tr = window.document.createElement( 'treerow' );
- _ti.appendChild( _tr );
- var _tc = window.document.createElement( 'treecell' );
- _tr.appendChild( _tc );
- _tc.setAttribute('label',j);
- _tc = window.document.createElement( 'treecell' );
- _tr.appendChild( _tc );
- _tc.setAttribute('label','\t Position: ' + o.fields[j].position + ' Virtual: ' + o.fields[j].virtual);
- }
- }
- tree = window.document.getElementById('t');
- tree.view.selection.select( 0 ); tree.focus();
- }
-
- function gen_cols() {
- var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
- var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
- var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
- var treeitems = mw.get_list_from_tree_selection( tree );
- setTimeout(
- function() {
- var tb = w.document.getElementById('desc');
- for (var i = 0; i < treeitems.length; i++) {
- var hint = treeitems[i].getAttribute('fm_class');
- var field = treeitems[i].getAttribute('fm_field');
- var text = (
- "{\n\t'id' : '" + field + "', 'label' : getString('" + hint + "_" +
- field + "_label'), 'flex' : 1,\n" +
- "\t'primary' : false, 'hidden' : false, 'fm_class' : '" + hint +
- "', 'fm_field_render' : '." + field + "()'\n},\n"
- );
- tb.value += text;
- }
- dump(tb.value + '\n');
- }, 0
- );
- }
-
- function gen_properties() {
- var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
- var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
- var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
- var treeitems = mw.get_list_from_tree_selection( tree );
- setTimeout(
- function() {
- var tb = w.document.getElementById('desc');
- for (var i = 0; i < treeitems.length; i++) {
- var hint = treeitems[i].getAttribute('fm_class');
- var field = treeitems[i].getAttribute('fm_field');
- var pretty = mw.map_list(
- field.split('_'),
- function (s) {
- return s.substr(0,1).toUpperCase() + s.substr(1);
- }
- ).join(' ');
- var text = (
- hint + '_' + field + '_label=' + pretty + '\n'
- );
- tb.value += text;
- }
- dump(tb.value + '\n');
- }, 0
- );
- }
-
- function gen_wikitable() {
- var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
- var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
- var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
- var treeitems = mw.get_list_from_tree_selection( tree );
- setTimeout(
- function() {
- var tb = w.document.getElementById('desc');
- for (var i = 0; i < treeitems.length; i++) {
- var hint = treeitems[i].getAttribute('fm_class');
- var field = treeitems[i].getAttribute('fm_field');
- var text = (
- '|' + hint + '|' + field
- );
-
- if (treeitems[i].getAttribute('fm_virtual') == '1') text += ' * ';
- text += '|\n'
- tb.value += text;
- }
- dump(tb.value + '\n');
- }, 0
- );
- }
-
-
- ]]>
- </script>
-
- <vbox flex="1" class="my_overflow">
- <groupbox orient="vertical" flex="1">
- <caption label="Fieldmapper Class Viewer"/>
- <hbox>
- <button label="Generate paged_tree cols for selected fields" accesskey="G" oncommand="gen_cols();"/>
- <button label="Generate string bundle properties for selected fields" accesskey="P" oncommand="gen_properties();"/>
- <button label="Generate dokuwiki table for selected fields" accesskey="P" oncommand="gen_wikitable();"/>
- </hbox>
- <tree id="t" flex="1">
- <treecols>
- <treecol id="tcol1" label="opensrf.open-ils.system.fieldmapper" primary="true" flex="0"/>
- <treecol id="tcol2" label="" flex="1"/>
- </treecols>
- <treechildren id="tc"/>
- </tree>
- </groupbox>
- </vbox>
-
-</window>
-
+++ /dev/null
-sdump('D_FUNCTIONAL',"Loading functional.js\n");
-
-function filter_list(list,f) {
- var new_list = [];
- for (var i in list) {
- var t = f( list[i] );
- if (t) new_list.push( list[i] );
- }
- return new_list;
-}
-
-function filter_object(obj,f) {
- var new_obj = {};
- for (var i in obj) {
- var t = f( i, obj[i] );
- if (t) new_obj[i] = obj[i];
- }
- return new_obj;
-}
-
-function find_list(list,f) {
- for (var i in list) {
- var t = f( list[i] );
- if (t) return list[i];
- }
- return null;
-}
-
-function find_object(obj,f) {
- for (var i in obj) {
- var t = f( i, obj[i] );
- if (t) return obj[i];
- }
- return null;
-}
-
-function map_list(list,f) {
- var new_list = [];
- for (var i in list) {
- new_list.push( f( list[i] ) );
- }
- return new_list;
-}
-
-function map_flat_list(list,f) {
- var new_list = [];
- for (var i in list) {
- new_list = new_list.concat( f( list[i] ) );
- }
- return new_list;
-}
-
-function map_object(obj,f) {
- var new_obj = {};
- for (var i in obj) {
- new_obj[ f( i, obj[i] )[0] ] = f( i, obj[i] )[1];
- }
- return new_obj;
-}
-
-function map_object_to_list(obj,f) {
- var new_list = [];
- for (var i in obj) {
- new_list.push( f( obj, i ) );
- }
- return new_list;
-}
-
-function convert_object_list_to_hash(list) {
- var my_hash = new Object();
- if (list) {
- for (var i = 0; i < list.length; i++) {
- my_hash[ list[i].id() ] = list[i];
- }
- }
- return my_hash;
-}
-
-function find_id_object_in_list(list,id) {
- //sdump('D_FUNCTIONAL','find_id_object_in_list(' + js2JSON(list).substr(0,20) + '... ,' + id + ')\n');
- if (list) {
- for (var i = 0; i < list.length; i++ ) {
- try {
- if ( list[i].id() == id ) {
- return list[i];
- }
- } catch(E) {
- sdump('D_FUNCTIONAL','find_id_object_in_list error, i = ' + i + ' typeof(list[i]) = ' + typeof(list[i]) + ' list[i] = ' + js2JSON(list[i]) + ' : ' + js2JSON(E) + '\n');
- }
- }
- }
- //sdump('D_FUNCTIONAL','not found\n');
- return null;
-}
-
-function find_attr_object_in_list(list,attr,value) {
- if (list) {
- for (var i = 0; i < list.length; i++ ) {
- sdump('D_FUNCTIONAL','find_attr_object_in_list: i = ' + i + ' id = ' + list[i].id() + '\n');
- try {
- var command = 'list[' + i + '].'+attr+'() == ' + value;
- if ( eval(command) ) {
- return list[i];
- }
- } catch(E) {
- sdump('D_FUNCTIONAL','find_attr_object_in_list error, i = ' + i + ' typeof(list[i]) = ' + typeof(list[i]) + ' list[i] = ' + js2JSON(list[i]) + ' : list = ' + js2JSON(list) + ' : ' + js2JSON(E) + '\n');
- }
- }
- }
- return null;
-}
-
-
+++ /dev/null
-#!/usr/bin/perl
-
-print "^ file ^ functions ^\n";
-while ($f = pop @ARGV) {
- print("|" . $f . "|");
- open FILE, $f;
- while ($line = <FILE>) {
- if ($line =~ /^function\s+(\w+)\s*(\(.*\))/) {
- print $1 . $2 . '\\' . '\\' . ' ';
- }
- }
- print "|\n";
- close FILE;
-}
+++ /dev/null
-sdump('D_TRACE','Loading populate.js\n');
-
-function populate_listbox_with_local_stat_cats_myself(local_stat_cats,local_cat_entries,listbox,libs,app,method,editable) {
- sdump('D_TRACE','populate_local_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
- local_stat_cats = user_request(
- app,
- method,
- [ mw.G.auth_ses[0], libs ]
- )[0];
- //sdump('D_POPULATE','local_stat_cats = ' + pretty_print( js2JSON( local_stat_cats ) ) + '\n');
-
- var list = listbox;
- if (typeof list != 'object') list = document.getElementById(list);
-
- for (var i in local_stat_cats) {
-
- var stat_cat = local_stat_cats[i];
-
- var listitem = document.createElement('listitem');
- list.appendChild(listitem);
- listitem.setAttribute('allowevents','true');
- sdump('D_POPULATE','listitem = ' + listitem + '\n');
-
- var label = document.createElement('listcell');
- listitem.appendChild(label);
- label.setAttribute('label',stat_cat.name() );
- sdump('D_POPULATE','\tlistcell = ' + label + '\n');
-
- var menucell = document.createElement('listcell');
- listitem.appendChild(menucell);
- sdump('D_POPULATE','\tlistcell = ' + menucell + '\n');
-
- var menulist = document.createElement('menulist');
- menucell.appendChild(menulist);
- if (editable) { menulist.setAttribute('editable','true'); }
- menulist.setAttribute('id','menulist_stat_cat_'+stat_cat.id());
- sdump('D_POPULATE','\tmenulist = ' + menulist + '\n');
-
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- menupopup.setAttribute('stat_cat',stat_cat.id());
- menupopup.setAttribute('oncommand','apply_attribute(event);');
- sdump('D_POPULATE','\t\tmenupopup = ' + menupopup + '\n');
-
- for (var j in stat_cat.entries() ) {
-
- var stat_entry = stat_cat.entries()[j];
- local_stat_cat_entries[stat_entry.id()] = stat_entry;
-
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute('label',stat_entry.value());
- if (editable) {
- menuitem.setAttribute('value',stat_entry.value());
- } else {
- menuitem.setAttribute('value',stat_entry.id());
- }
- menuitem.setAttribute('stat_cat',stat_cat.id());
- menuitem.setAttribute('id','menuitem_stat_cat_entry_' + stat_entry.id());
- sdump('D_POPULATE','\t\t\tmenuitem = ' + menuitem + '\n');
-
- }
-
- }
-
- //sdump('D_POPULATE','local_stat_cat_entries = ' + pretty_print( js2JSON( local_stat_cat_entries ) ) + '\n');
-
-}
-
-function populate_rows_with_local_stat_cats(local_stat_cats,local_stat_cat_entries,rows,editable) {
- //sdump('D_TRACE','populate_local_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
- /*local_stat_cats = user_request(
- app,
- method,
- [ mw.G.auth_ses[0], libs ]
- )[0];*/
- //sdump('D_POPULATE','local_stat_cats = ' + pretty_print( js2JSON( local_stat_cats ) ) + '\n');
-
- if (typeof rows != 'object') rows = document.getElementById(rows);
-
- for (var i in local_stat_cats) {
-
- var stat_cat = local_stat_cats[i];
-
- //alert('local stat_cat = ' + js2JSON(stat_cat) );
-
- var row = document.createElement('row');
- rows.appendChild(row);
-
- var label = document.createElement('label');
- label.setAttribute('value',stat_cat.name());
- row.appendChild(label);
-
- var menulist = document.createElement('menulist');
- row.appendChild(menulist);
- if (editable) { menulist.setAttribute('editable','true'); }
- menulist.setAttribute('id','menulist_stat_cat_'+stat_cat.id());
- //alert('menulist_stat_cat_'+stat_cat.id());
- menulist.setAttribute('stat_cat_id',stat_cat.id());
- sdump('D_POPULATE','\tmenulist = ' + menulist + '\n');
-
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- menupopup.setAttribute('stat_cat',stat_cat.id());
- menupopup.setAttribute('command','cmd_apply');
- sdump('D_POPULATE','\t\tmenupopup = ' + menupopup + '\n');
-
- for (var j in stat_cat.entries() ) {
-
- var stat_entry = stat_cat.entries()[j];
- local_stat_cat_entries[stat_entry.id()] = stat_entry;
-
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute('label',stat_entry.value());
- if (editable) {
- menuitem.setAttribute('value',stat_entry.value());
- } else {
- menuitem.setAttribute('value',stat_entry.id());
- }
- menuitem.setAttribute('stat_cat',stat_cat.id());
- menuitem.setAttribute('id','menuitem_stat_cat_entry_' + stat_entry.id());
- sdump('D_POPULATE','\t\t\tmenuitem = ' + menuitem + '\n');
-
- }
-
- }
-
- sdump('D_POPULATE','local_stat_cat_entries = ' + pretty_print( js2JSON( local_stat_cat_entries ) ) + '\n');
-
-}
-
-function populate_copy_status_list(menulist,menupopup,defaultccs) {
- sdump('D_TRACE','populate_copy_status_list\n');
- var popup = document.getElementById(menupopup);
-
- if (popup) {
- empty_widget(popup);
- for (var i in mw.G.ccs_list) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', mw.G.ccs_list[i].name());
- menuitem.setAttribute('value', mw.G.ccs_list[i].id());
- menuitem.setAttribute('id', 'ccsitem' + mw.G.ccs_list[i].id());
- //sdump('D_POPULATE','pop_ccs_list: i = ' + i + ' ccs = ' + mw.G.ccs_list[i] + ' = ' + js2JSON(mw.G.ccs_list[i]) + '\n');
- popup.appendChild(menuitem);
- }
- var list = document.getElementById(menulist);
- if (list && defaultccs) {
- if (typeof defaultccs == 'object') {
- defaultccs = defaultccs.id();
- }
- var menuitem_id = 'ccsitem' + defaultccs;
- var menuitem = document.getElementById(
- menuitem_id
- );
- var menulist_e = document.getElementById(menulist);
- if (menulist_e && menuitem) {
- sdump('D_POPULATE','Setting default ccs\n');
- menulist_e.selectedItem = menuitem;
- } else {
- sdump('D_POPULATE','Not Setting default ccs\n');
- }
- }
- } else {
- sdump('D_POPULATE','populate_copy_status_list: Could not find menupopup: ' + menupopup + '\n');
- throw('populate_copy_status_list: Could not find menupopup: ' + menupopup + '\n');
- }
-
-}
-
-function populate_copy_location_list(menulist,menupopup,defaultacpl) {
- sdump('D_TRACE','populate_copy_location_list\n');
- var popup = document.getElementById(menupopup);
-
- if (popup) {
- empty_widget(popup);
- for (var i in mw.G.acpl_my_orgs) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', mw.G.acpl_my_orgs[i].name());
- menuitem.setAttribute('value', mw.G.acpl_my_orgs[i].id());
- menuitem.setAttribute('id', 'acplitem' + mw.G.acpl_my_orgs[i].id());
- //sdump('D_POPULATE','populate_copy_location_list: i = ' + i + ' acpl_my_orgs = ' + mw.G.acpl_my_orgs[i] + ' = ' + js2JSON(mw.G.acpl_my_orgs[i]) + '\n');
- popup.appendChild(menuitem);
- }
- var list = document.getElementById(menulist);
- if (list && defaultacpl) {
- if (typeof defaultacpl == 'object') {
- defaultacpl = defaultacpl.id();
- }
- var menuitem_id = 'acplitem' + defaultacpl;
- var menuitem = document.getElementById(
- menuitem_id
- );
- var menulist_e = document.getElementById(menulist);
- if (menulist_e && menuitem) { menulist_e.selectedItem = menuitem; }
- }
- } else {
- sdump('D_POPULATE','populate_copy_location_list: Could not find menupopup: ' + menupopup + '\n');
- throw('populate_copy_location_list: Could not find menupopup: ' + menupopup + '\n');
- }
-
-}
-
-function populate_lib_list(menulist,menupopup,defaultlib,id_flag) {
- sdump('D_TRACE','populate_lib_list\n');
- var default_menuitem;
- if (typeof defaultlib == 'object') {
- defaultlib = defaultlib.id();
- }
- var popup = menupopup;
- if (typeof(popup)!='object') { popup = document.getElementById(menupopup); }
- if (popup) {
- //sdump('D_POPULATE','found popup\n');
- empty_widget(popup);
- var padding_flag = false;
- for (var ou in mw.G.my_orgs) {
- //sdump('D_POPULATE','\tlooping on my_orgs: ' + js2JSON(mw.G.my_orgs[ou]) + '\n');
- //sdump('D_POPULATE','\tlooping on my_orgs: ou = ' + ou + '\n');
- var menuitem = document.createElement('menuitem');
- popup.appendChild(menuitem);
- //sdump('D_POPULATE','\t\tmenuitem = ' + menuitem + '\n');
- var padding = '';
- //var depth = find_id_object_in_list( mw.G.aout_list, mw.G.my_orgs[ou].ou_type() ).depth();
- var depth = mw.G.aout_hash[ mw.G.my_orgs[ou].ou_type() ].depth();
- if (depth == '0') { padding_flag = true; }
- if (padding_flag) {
- for (var i = 0; i < depth; i++) {
- padding = padding + ' ';
- }
- }
- menuitem.setAttribute('label', padding + mw.G.my_orgs[ou].name() );
- menuitem.setAttribute('value', mw.G.my_orgs[ou].id() );
- if (id_flag) menuitem.setAttribute('id', 'libitem' + mw.G.my_orgs[ou].id() );
- //sdump('D_POPULATE','\tname = ' + mw.G.my_orgs[ou].name() + ' id = ' + mw.G.my_orgs[ou].id() + '\n');
- if (defaultlib == mw.G.my_orgs[ou].id()) {
- default_menuitem = menuitem;
- sdump('D_POPULATE','Setting defaultlib = ' + defaultlib + '\n');
- }
- }
- var list = menulist;
- if (typeof(list)!='object') { list = document.getElementById(menulist); }
- if (list && defaultlib && default_menuitem) {
- //sdump('D_POPULATE','default_menuitem = ' + default_menuitem + '\n');
- if (list) { list.selectedItem = default_menuitem; }
- }
- } else {
- sdump('D_POPULATE','populate_lib_list: Could not find ' + menupopup + '\n');
- throw('populate_lib_list: Could not find ' + menupopup + '\n');
- }
-}
-
-function populate_lib_list_with_branch(menulist,menupopup,defaultlib,branch,id_flag) {
- sdump('D_TRACE','populate_lib_list_with_branch\n');
- var default_menuitem;
- if (typeof defaultlib == 'object') {
- defaultlib = defaultlib.id();
- }
- var popup = menupopup;
- if (typeof(popup)!='object') popup = document.getElementById(menupopup);
- if (popup) {
- empty_widget(popup);
- var padding_flag = true;
- var flat_branch = flatten_ou_branch( branch );
- //sdump('D_POPULATE','\n\nflat_branch = ' + js2JSON(flat_branch) + '\n');
- for (var i in flat_branch) {
- //sdump('D_POPULATE','i = ' + js2JSON(i) + ' flat_branch[i] = ' + js2JSON(flat_branch[i]) + '\n');
- var menuitem = document.createElement('menuitem');
- var padding = '';
- //if (flat_branch[i].ou_type().depth() == '0') { padding_flag = true; }
- var depth = mw.G.aout_hash[ flat_branch[i].ou_type() ].depth();
- if (padding_flag) {
- for (var j = 0; j < depth; j++) {
- padding = padding + ' ';
- }
- }
- menuitem.setAttribute('label', padding + flat_branch[i].name() );
- menuitem.setAttribute('value', flat_branch[i].id() );
- if (id_flag) menuitem.setAttribute('id', 'libitem' + flat_branch[i].id() );
- if (defaultlib == flat_branch[i].id()) {
- default_menuitem = menuitem;
- sdump('D_POPULATE','i = ' + i + ' Setting defaultlib = ' + defaultlib + ' menuitem = ' + default_menuitem + ' value = ' + default_menuitem.getAttribute('value') + '\n');
- }
- popup.appendChild(menuitem);
- }
- var list = menulist;
- if (typeof(list)!='object') { list = document.getElementById(menulist); }
- if (list && defaultlib && default_menuitem) {
- //sdump('D_POPULATE','default_menuitem = ' + default_menuitem + ' value = ' + default_menuitem.getAttribute('value') + '\n');
- if (list) { list.selectedItem = default_menuitem; }
- }
- } else {
- sdump('D_POPULATE','populate_lib_list_with_branch: Could not find ' + menupopup + '\n');
- throw('populate_lib_list_with_branch: Could not find ' + menupopup + '\n');
- }
- sdump('D_POPULATE','\tleaving populate_lib_list_with_branch\n');
-}
-
-function populate_user_profile(menulist,menupopup,defaultap) {
- sdump('D_TRACE','Entering populate_user_profile\n');
- var popup = document.getElementById(menupopup);
- if (popup) {
- empty_widget(popup);
- for (var i in mw.G.ap_list) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', mw.G.ap_list[i].name());
- menuitem.setAttribute('value', mw.G.ap_list[i].id());
- menuitem.setAttribute('id', 'apitem' + mw.G.ap_list[i].id());
- //sdump('D_POPULATE','pop_ap_list: i = ' + i + ' ap = ' + mw.G.ap_list[i] + ' = ' + js2JSON(mw.G.ap_list[i]) + '\n');
- popup.appendChild(menuitem);
- }
- var list = document.getElementById(menulist);
- if (list && defaultap) {
- if (typeof defaultap == 'object') {
- defaultap = defaultap.id();
- }
- var menuitem_id = 'apitem' + defaultap;
- var menuitem = document.getElementById(
- menuitem_id
- );
- var menulist_e = document.getElementById(menulist);
- if (menulist_e) { menulist_e.selectedItem = menuitem; }
- }
- } else {
- sdump('D_POPULATE','populate_user_profile: Could not find menupopup: ' + menupopup + '\n');
- throw('populate_user_profile: Could not find menupopup: ' + menupopup + '\n');
- }
-}
-
-function populate_ident_types(menulist,menupopup,repeatid,defaultcit) {
- sdump('D_TRACE','Entering populate_ident_types\n');
- var popup = document.getElementById(menupopup);
- if (popup) {
- empty_widget(popup);
- for (var i in mw.G.cit_list) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', mw.G.cit_list[i].name());
- menuitem.setAttribute('value', mw.G.cit_list[i].id());
- menuitem.setAttribute('id', 'cit' + repeatid + 'item' + mw.G.cit_list[i].id());
- //sdump('D_POPULATE','pop_cit_list: i = ' + i + ' cit = ' + mw.G.cit_list[i] + ' = ' + js2JSON(mw.G.cit_list[i]) + '\n');
- popup.appendChild(menuitem);
- }
- if (menulist && defaultcit) {
- if (typeof defaultcit == 'object') {
- defaultcit = defaultcit.id();
- }
- var menuitem_id = 'cit' + repeatid + 'item' + defaultcit;
- var menuitem = document.getElementById(
- menuitem_id
- );
- var menulist_e = document.getElementById(menulist);
- if (menulist_e) { menulist_e.selectedItem = menuitem; }
- }
- } else {
- sdump('D_POPULATE','populate_ident_types: Could not find menupopup: ' + menupopup + '\n');
- throw('populate_ident_types: Could not find menupopup: ' + menupopup + '\n');
- }
-}
-
-
-
-function populate_name_prefix(menulist,menupopup,defaultvalue) {
- var popup = document.getElementById(menupopup);
- if (popup) {
- empty_widget(popup);
- var prefix_list = [
- 'Mr','Mrs','Ms','Miss', 'Dr',
- '',
- 'Advisor',
- 'Airman',
- 'Admiral',
- 'Agent',
- 'Ambassador',
- 'Baron',
- 'Baroness',
- 'Bishop',
- 'Brother',
- 'Cadet',
- 'Captain',
- 'Cardinal',
- 'Chairperson',
- 'Chancellor',
- 'Chief',
- 'Colonel',
- 'Commander',
- 'Commodore',
- 'Congressman',
- 'Congresswoman',
- 'Constable',
- 'Consul',
- 'Corporal',
- 'Councilperson',
- 'Counselor',
- 'Dean',
- 'Duchess',
- 'Duke',
- 'Elder',
- 'Ensign',
- 'Father',
- 'General',
- 'Governor',
- 'Judge',
- 'Justice',
- 'King',
- 'Lady',
- 'Lieutenant',
- 'Lord',
- 'Major',
- 'Marshal',
- 'Mayor',
- 'Midshipman',
- 'Minister',
- 'Monsignor',
- 'Officer',
- 'Pastor',
- 'Petty Officer',
- 'Pope',
- 'Prince',
- 'Princess',
- 'President',
- 'Private',
- 'Prof',
- 'Queen',
- 'Rabbi',
- 'Representative',
- 'Reverend',
- 'Seaman',
- 'Secretary',
- 'Senator',
- 'Sergeant',
- 'Sheriff',
- 'Sir',
- 'Sister',
- 'Speaker',
- 'Specialist',
- 'Treasurer',
- 'Vice President',
- 'Warrant Officer'
- ];
- for (var i in prefix_list) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', prefix_list[i]);
- menuitem.setAttribute('value', prefix_list[i]);
- popup.appendChild(menuitem);
- }
- var list = document.getElementById(menulist);
- if (list) {
- if (defaultvalue) {
- list.value = defaultvalue;
- }
- } else {
- sdump('D_POPULATE','populate_name_prefix: Could not find menulist: ' + menulist + '\n');
- throw('populate_name_prefix: Could not find menulist: ' + menulist + '\n');
- }
- } else {
- sdump('D_POPULATE','populate_name_prefix: Could not find menupopup: ' + menupopup + '\n');
- throw('populate_name_prefix: Could not find menupopup: ' + menupopup + '\n');
- }
-
-}
-
-function populate_name_suffix(menulist,menupopup,defaultvalue) {
- var popup = document.getElementById(menupopup);
- if (popup) {
- empty_widget(popup);
- var suffix_list = [
- 'Jr','Sr','II','III',
- '',
- 'AA',
- 'AS',
- 'AAS',
- 'BA',
- 'BS',
- 'CFPIM',
- 'CPA',
- 'CPIM',
- 'CPM',
- 'CXE',
- 'DC',
- 'DDS',
- 'DO',
- 'DPM',
- 'DVM',
- 'Esq',
- 'FACAAI',
- 'FACP',
- 'FACS',
- 'FACEP',
- 'FCP',
- 'FICS',
- 'GYN',
- 'JD',
- 'LPN',
- 'MA',
- 'MCSE',
- 'MD',
- 'MS',
- 'NMD',
- 'OB',
- 'PhD',
- 'RN'
- ];
- for (var i in suffix_list) {
- var menuitem = document.createElement('menuitem');
- menuitem.setAttribute('label', suffix_list[i]);
- menuitem.setAttribute('value', suffix_list[i]);
- popup.appendChild(menuitem);
- }
- var list = document.getElementById(menulist);
- if (list) {
- if (defaultvalue) {
- list.value = defaultvalue;
- }
- } else {
- sdump('D_POPULATE','populate_name_suffix: Could not find ' + menulist + '\n');
- throw('populate_name_suffix: Could not find ' + menulist + '\n');
- }
- } else {
- sdump('D_POPULATE','populate_name_suffix: Could not find ' + menupopup + '\n');
- throw('populate_name_suffix: Could not find ' + menupopup + '\n');
- }
-
-}
-
+++ /dev/null
-sdump('D_TRACE','Loading print.js\n');
-
-var print_crlf = '<br />\r\n';
-
-// Higher-level
-
-function print_itemsout_receipt(params,sample_view) {
- print_circ_receipt('itemsout',params,sample_view);
-}
-
-function print_checkout_receipt(params,sample_view) {
- print_circ_receipt('checkout',params,sample_view);
-}
-
-function print_circ_receipt(circ_type,params,sample_view) {
- sdump('D_PRINT',arg_dump(arguments));
- var s = ''; params.current_circ = new circ(); params.current_copy = new acp(); params.current_mvr = new mvr();
- if (params.header) { s += print_template_replace(params.header, params); }
- var circs;
- switch(circ_type) {
- case 'itemsout' : circs = params.au.checkouts(); break;
- case 'checkout' : circs = params.au._current_checkouts; break;
- default: alert('bad!'); break;
- }
- for (var i = 0; i < circs.length; i++) {
- params.current_circ = circs[i].circ;
- params.current_copy = circs[i].copy;
- params.current_mvr = circs[i].record;
- params.current_index = i;
- s += print_template_replace(params.line_item, params);
- }
- if (params.footer) { s += print_template_replace(params.footer, params); }
- s = s.replace( /\n/g, print_crlf );
- if (sample_view) {
- sample_view.setAttribute( 'src', 'data:text/html,<html>' + s + '</html>\r\n' );
- } else {
- sPrint( s, true );
- }
-}
-
-function print_template_replace(s,params) {
-
- function trunc(t) {
- if (params.truncate) {
- try {
- return t.toString().substr(0,params.truncate);
- } catch(E) {
- return t;
- }
- } else {
- return t;
- }
- }
- function ttrunc(t) {
- if (params.title_truncate) {
- try {
- return t.toString().substr(0,params.title_truncate);
- } catch(E) {
- return t;
- }
- } else {
- return t;
- }
- }
- function atrunc(t) {
- if (params.author_truncate) {
- try {
- return t.toString().substr(0,params.author_truncate);
- } catch(E) {
- return t;
- }
- } else {
- return t;
- }
- }
-
-
-
- var b = s.match( /%TRUNC.{0,3}:\s*(\d+)%/ );
- if (b) params.truncate = b[1];
-
- try{s=s.replace(/%TRUNC.{0,3}:\s*\d+%/g,'');}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%LIBRARY%/g,trunc(params.lib.name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PINES_CODE%/g,trunc(params.lib.shortname()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%PATRON_LASTNAME%/g,trunc(params.au.family_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PATRON_FIRSTNAME%/g,trunc(params.au.first_given_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PATRON_MIDDLENAME%/g,trunc(params.au.second_given_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PATRON_BARCODE%/g,trunc(params.au.card().barcode()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%STAFF_LASTNAME%/g,trunc(params.staff.family_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%STAFF_FIRSTNAME%/g,trunc(params.staff.first_given_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%STAFF_MIDDLENAME%/g,trunc(params.staff.second_given_name()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- //try{s=s.replace(/%STAFF_BARCODE%/g,trunc(params.staff.card().barcode()));}
- // catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%TODAY%/g,trunc(new Date()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_m%/g,trunc(formatted_date(new Date(),'%m')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_d%/g,trunc(formatted_date(new Date(),'%d')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_Y%/g,trunc(formatted_date(new Date(),'%Y')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_H%/g,trunc(formatted_date(new Date(),'%H')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_I%/g,trunc(formatted_date(new Date(),'%I')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_M%/g,trunc(formatted_date(new Date(),'%M')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_D%/g,trunc(formatted_date(new Date(),'%D')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%TODAY_F%/g,trunc(formatted_date(new Date(),'%F')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%OUT%/g,trunc(params.current_circ.xact_start()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_m%/g,trunc(formatted_date(params.current_circ.xact_start(),'%m')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_d%/g,trunc(formatted_date(params.current_circ.xact_start(),'%d')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_Y%/g,trunc(formatted_date(params.current_circ.xact_start(),'%Y')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_H%/g,trunc(formatted_date(params.current_circ.xact_start(),'%H')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_I%/g,trunc(formatted_date(params.current_circ.xact_start(),'%I')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_M%/g,trunc(formatted_date(params.current_circ.xact_start(),'%M')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_D%/g,trunc(formatted_date(params.current_circ.xact_start(),'%D')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%OUT_F%/g,trunc(formatted_date(params.current_circ.xact_start(),'%F')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%DUE%/g,trunc(params.current_circ.due_date()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_m%/g,trunc(formatted_date(params.current_circ.due_date(),'%m')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_d%/g,trunc(formatted_date(params.current_circ.due_date(),'%d')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_Y%/g,trunc(formatted_date(params.current_circ.due_date(),'%Y')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_H%/g,trunc(formatted_date(params.current_circ.due_date(),'%H')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_I%/g,trunc(formatted_date(params.current_circ.due_date(),'%I')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_M%/g,trunc(formatted_date(params.current_circ.due_date(),'%M')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_D%/g,trunc(formatted_date(params.current_circ.due_date(),'%D')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%DUE_F%/g,trunc(formatted_date(params.current_circ.due_date(),'%F')));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%DURATION%/g,trunc(params.current_circ.duration()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%COPY_BARCODE%/g,trunc(params.current_copy.barcode()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- var tb = s.match( /%TITLE:?\s*(\d*)%/ );
- if (tb) params.title_truncate = tb[1];
-
- try{s=s.replace(/%TITLE:?\s*\d*%/g,ttrunc(params.current_mvr.title()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- var ab = s.match( /%AUTHOR:?\s*(\d*)%/ );
- if (ab) params.author_truncate = ab[1];
-
- try{s=s.replace(/%AUTHOR%/g,atrunc(params.current_mvr.author()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PUBLISHER%/g,trunc(params.current_mvr.publisher()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
- try{s=s.replace(/%PUBDATE%/g,trunc(params.current_mvr.pubdate()));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- try{s=s.replace(/%NUMBER%/g,(params.current_index+1));}
- catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
- return s;
-}
-
-// Lower-level
-
-function last_sPrint() {
- if (mw.G.last_receipt) sPrint( mw.G.last_receipt, false );
-}
-
-function sPrint(s,silent,params) {
- sdump('D_PRINT',arg_dump(arguments));
- mw.G.last_receipt = s;
- var w = new_window('data:text/html,<html>' + s + '</html>\r\n', { 'window_name':'LastPrint' });
- w.minimize(); mw.minimize();
- setTimeout(
- function() {
- if (!mw.printDebug) {
- NSPrint(w,silent,params); w.minimize(); w.close(); mw.minimize();
- } else {
- sdump('D_PRINT','Not printing due to printDebug flag.');
- }
- },0
- );
-}
-
-function NSPrint(w,silent,params)
-{
- sdump('D_PRINT',arg_dump(arguments));
- if (!w) { w = this; }
- try {
- var webBrowserPrint = w
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebBrowserPrint);
- sdump('D_PRINT','webBrowserPrint = ' + webBrowserPrint);
- if (webBrowserPrint) {
- var gPrintSettings = GetPrintSettings();
- if (silent) gPrintSettings.printSilent = true;
- else gPrintSettings.printSilent = false;
- if (params) {
- gPrintSettings.marginTop = 0;
- gPrintSettings.marginLeft = 0;
- gPrintSettings.marginBottom = 0;
- gPrintSettings.marginRight = 0;
- if (params.marginLeft) gPrintSettings.marginLeft = params.marginLeft;
- }
- gPrintSettings.headerStrLeft = '';
- gPrintSettings.headerStrCenter = '';
- gPrintSettings.headerStrRight = '';
- gPrintSettings.footerStrLeft = '';
- gPrintSettings.footerStrCenter = '';
- gPrintSettings.footerStrRight = '';
- sdump('D_PRINT','gPrintSettings = ' + js2JSON(gPrintSettings));
- alert('gPrintSettings = ' + js2JSON(gPrintSettings));
- webBrowserPrint.print(gPrintSettings, null);
- //alert('Should be printing\n');
- sdump('D_PRINT','Should be printing\n');
- } else {
- //alert('Should not be printing\n');
- sdump('D_PRINT','Should not be printing\n');
- }
- } catch (e) {
- //alert('Probably not printing: ' + e);
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- sdump('D_PRINT','PRINT EXCEPTION: ' + js2JSON(e) + '\n');
- // if you need to debug
- }
-}
-
-var gPrintSettings = null;
-
-function GetPrintSettings()
- {
- sdump('D_PRINT',arg_dump(arguments));
- try {
- if (gPrintSettings == null) {
- var pref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- if (pref) {
- gPrintSettingsAreGlobal = pref.getBoolPref("print.use_global_printsettings", false);
- gSavePrintSettings = pref.getBoolPref("print.save_print_settings", false);
- }
-
- var printService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
- .getService(Components.interfaces.nsIPrintSettingsService);
- if (gPrintSettingsAreGlobal) {
- gPrintSettings = printService.globalPrintSettings;
- setPrinterDefaultsForSelectedPrinter(printService);
- } else {
- gPrintSettings = printService.newPrintSettings;
- }
- }
- } catch (e) {
- sdump('D_PRINT',"GetPrintSettings() "+e+"\n");
- alert("GetPrintSettings() "+e+"\n");
- }
-
- return gPrintSettings;
- }
-
-function setPrinterDefaultsForSelectedPrinter(aPrintService)
- {
- sdump('D_PRINT',arg_dump(arguments));
- if (gPrintSettings.printerName == "") {
- gPrintSettings.printerName = aPrintService.defaultPrinterName;
- }
-
- // First get any defaults from the printer
- aPrintService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings);
-
- // now augment them with any values from last time
- aPrintService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSettings.kInitSaveAll);
- }
-
+++ /dev/null
-sdump('D_TRACE','Loading ses.js\n');
-
-//////////////////////////////////////////////////////////////////////////////
-// Sessions, Requests, Methods, Oh My
-
-// These wrap Bill's RemoteRequest.js
-
-function user_request(app,name,params,f) {
- if (f) {
-
- user_async_request(app,name,params,f);
- return [];
-
- } else {
- try {
- sdump('D_SES','=-=-=-=-= user_request("'+app+'","'+name+'",'+js2JSON(params)+')\n');
- var request = new RemoteRequest( app, name );
- for(var index in params) {
- request.addParam(params[index]);
- }
- request.send(true);
- var result = [];
- result.push( request.getResultObject() );
- sdump('D_SES_RESULT','=-=-= result = ' + js2JSON(result[0]) + '\n');
- return result;
- } catch(E) {
- if (instanceOf(E,perm_ex)) {
- alert('permission exception: ' + js2JSON(E));
- }
- throw(E);
- }
- }
-}
-
-function user_async_request(app,name,params,func) {
- sdump('D_SES','=-=-=-=-= user_async_request("'+app+'","'+name+'",'+js2JSON(params)+',func)\n');
- sdump('D_SES_FUNC','func = ' + func + '\n');
- var request = new RemoteRequest( app, name );
- for(var index in params) {
- request.addParam(params[index]);
- }
- request.setCompleteCallback(func);
- request.send();
-}
-
-function sample_func(request) {
- var result = [];
- result.push( request.getResultObject() );
- /* This callback would be called within the code for the Request object, so you would never see
- a return value. Instead, you should _do_ something with the data. */
- return result;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// The functions below were wrappers for the old jabber way of doing things
-
-function handle_session(app) {
- //if( ses == null || ! AppSession.transport_handle.connected() ) {
- sdump('D_TRACE','Calling new AppSession : ' + timer_elapsed('cat') + '\n');
- ses = new AppSession( app );
- sdump('D_SES', 'after AppSession ses = ' + (ses.state) + '\n' );
- if( ! ses.connect() ) {
- sdump('D_SES', 'after ses.connect ses = ' + js2JSON(ses.state) + '\n' );
- throw( "Connect timed out!" );
- }
- sdump('D_SES', 'after ses.connect ses = ' + js2JSON(ses.state) + '\n' );
- sdump('D_TRACE','Finished new AppSession : ' + timer_elapsed('cat') + '\n');
- //}
-}
-
-function handle_request(ses,meth) {
-
-
- sdump('D_TRACE','Entering handle_request : ' + timer_elapsed('cat') + '\n');
- sdump('D_SES','Calling new AppRequest : ' + timer_elapsed('cat') + '\n');
-
- var req = new AppRequest( ses, meth );
-
- sdump('D_SES','Finished new AppRequest : ' + timer_elapsed('cat') + '\n');
- sdump('D_SES','Calling new req.make_request() : ' + timer_elapsed('cat') + '\n');
-
- req.make_request();
-
- sdump('D_SES', 'after req.make_request ses = ' + js2JSON(ses.state) + '\n' );
- sdump('D_SES','Finished new req.make_request() : ' + timer_elapsed('cat') + '\n');
-
- var result = new Array(); var resp;
-
- sdump('D_SES','Looping on req.recv and resp.getContent(): ' + timer_elapsed('cat') + '\n');
-
- while (resp = req.recv( 30000 ) ) {
- sdump('D_SES', '\tafter req.recv ses = ' + js2JSON(ses.state) + ' : req.is_complete = ' + req.is_complete + '\n' );
- var r = resp.getContent();
- if (r != 'keepalive') {
- result.push( r );
- }
- }
-
- sdump('D_SES','Finished with req.recv and resp.getContent(): ' + timer_elapsed('cat') + '\n');
-
- if (result.length == 0) {
- if ( req.is_complete ) {
- result.push("NO RESPONSE, REQUEST COMPLETE");
- sdump('D_SES',"NO RESPONSE, REQUEST COMPLETE\n");
- } else {
- result.push("NO RESPONSE, REQUEST TIMEOUT");
- sdump('D_SES',"NO RESPONSE, REQUEST TIMEOUT\n");
- }
- }
- req.finish();
- sdump('D_SES', 'after req.finish() ses = ' + js2JSON(ses.state) + '\n' );
- sdump('D_SES','Exiting handle_request : ' + timer_elapsed('cat') + '\n');
- return result;
-}
-
-function _user_request(app,name,params) {
-
- sdump('D_SES','Entering user_request : ' + timer_elapsed('cat') + '\n');
- sdump('D_SES','app='+app+' name='+name+'\n');
- try {
-
- handle_session(app);
-
- var meth;
- if (name) {
- meth = new oilsMethod( name, params );
- } else {
- throw('No method name to execute.');
- }
-
- var result = handle_request(ses,meth);
-
- if (ses) {
- sdump('D_SES','ses.disconnect\n');
- ses.disconnect();
- sdump('D_SES', 'after ses.disconnect() ses = ' + js2JSON(ses.state) + '\n' );
- ses.destroy();
- sdump('D_SES', 'after ses.destroy() ses = ' + js2JSON(ses.state) + '\n' );
- }
-
- sdump('D_SES','Exiting user_request : ' + timer_elapsed('cat') + '\n');
- return result;
-
- } catch( E ) {
- sdump('D_SES','Exiting user_request : ' + timer_elapsed('cat') + '\n');
- alert( pretty_print( js2JSON(E) ) );
- return null;
- }
-
-}
-
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<html onclick="keepFocusInTextbox(event)">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>JavaScript Shell 1.3.1</title>
-
-<script type="text/javascript">
-// Modified by Jason for Evergreen
-var
-histList = [""],
-histPos = 0,
-_scope = {},
-_win, // a top-level context
-question,
-_in,
-_out,
-tooManyMatches = null,
-lastError = null;
-
-function refocus()
-{
- _in.blur(); // Needed for Mozilla to scroll correctly.
- _in.focus();
-}
-
-function init()
-{
- _in = document.getElementById("input");
- _out = document.getElementById("output");
-
- _win = window;
-
- if (opener && !opener.closed)
- {
- println("Using bookmarklet version of shell: commands will run in opener's context.", "message");
- _win = opener;
- }
-
- initTarget();
-
- recalculateInputHeight();
- refocus();
-}
-
-function initTarget()
-{
- _win.Shell = window;
- _win.print = shellCommands.print;
-}
-
-
-// Unless the user is selected something, refocus the textbox.
-// (requested by caillon, brendan, asa)
-function keepFocusInTextbox(e)
-{
- var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard
-
- while (!g.tagName)
- g = g.parentNode;
- var t = g.tagName.toUpperCase();
- if (t=="A" || t=="INPUT")
- return;
-
- if (window.getSelection) {
- // Mozilla
- if (String(window.getSelection()))
- return;
- }
- else if (document.getSelection) {
- // Opera? Netscape 4?
- if (document.getSelection())
- return;
- }
- else {
- // IE
- if ( document.selection.createRange().text )
- return;
- }
-
- refocus();
-}
-
-function inputKeydown(e) {
- // Use onkeydown because IE doesn't support onkeypress for arrow keys
-
- //alert(e.keyCode + " ^ " + e.keycode);
-
- if (e.shiftKey && e.keyCode == 13) { // shift-enter
- // don't do anything; allow the shift-enter to insert a line break as normal
- } else if (e.keyCode == 13) { // enter
- // execute the input on enter
- try { go(); } catch(er) { alert(er); };
- setTimeout(function() { _in.value = ""; }, 0); // can't preventDefault on input, so clear it later
- } else if (e.keyCode == 38) { // up
- // go up in history if at top or ctrl-up
- if (e.ctrlKey || _in.selectionStart == null || _in.selectionStart == 0)
- hist(true);
- } else if (e.keyCode == 40) { // down
- // go down in history if at end or ctrl-down
- if (e.ctrlKey || _in.selectionStart == null || _in.selectionEnd == _in.textLength)
- hist(false);
- } else if (e.keyCode == 9) { // tab
- tabcomplete();
- setTimeout(function() { refocus(); }, 0); // refocus because tab was hit
- } else { }
-
- setTimeout(recalculateInputHeight, 0);
-
- //return true;
-};
-
-function recalculateInputHeight()
-{
- var rows = _in.value.split(/\n/).length
- + 1 // prevent scrollbar flickering in Mozilla
- + (window.opera ? 1 : 0); // leave room for scrollbar in Opera
-
- if (_in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.
- _in.rows = rows;
-}
-
-function println(s, type)
-{
- if((s=String(s)))
- {
- var newdiv = document.createElement("div");
- newdiv.appendChild(document.createTextNode(s));
- newdiv.className = type;
- _out.appendChild(newdiv);
- return newdiv;
- }
-}
-
-function printWithRunin(h, s, type)
-{
- var div = println(s, type);
- var head = document.createElement("strong");
- head.appendChild(document.createTextNode(h + ": "));
- div.insertBefore(head, div.firstChild);
-}
-
-
-var shellCommands =
-{
-load : function load(url)
-{
- var s = _win.document.createElement("script");
- s.type = "text/javascript";
- s.src = url;
- _win.document.getElementsByTagName("head")[0].appendChild(s);
- println("Loading " + url + "...", "message");
-},
-
-print : function print(s) { println(s, "print"); },
-
-// the normal function, "print", shouldn't return a value
-// (suggested by brendan; later noticed it was a problem when showing others)
-pr : function pr(s)
-{
- shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!
- return s;
-},
-
-props : function props(e)
-{
- var ns = ["Methods", "Fields", "Unreachables"];
- var as = [[], [], []]; // array of (empty) arrays of arrays!
- var p, j, i; // loop variables, several used multiple times
-
- var protoLevels = 0;
-
- for (p = e; p; p = p.__proto__)
- {
- for (i=0; i<ns.length; ++i)
- as[i][protoLevels] = [];
- ++protoLevels;
- }
-
- for(var a in e)
- {
- // Shortcoming: doesn't check that VALUES are the same in object and prototype.
-
- var protoLevel = -1;
- try
- {
- for (p = e; p && (a in p); p = p.__proto__)
- ++protoLevel;
- }
- catch(er) { protoLevel = 0; } // "in" operator throws when param to props() is a string
-
- var type = 1;
- try
- {
- if ((typeof e[a]) == "function")
- type = 0;
- }
- catch (er) { type = 2; }
-
- as[type][protoLevel].push(a);
- }
-
- function times(s, n) { return n ? s + times(s, n-1) : ""; }
-
- for (j=0; j<protoLevels; ++j)
- for (i=0;i<ns.length;++i)
- if (as[i][j].length)
- printWithRunin(ns[i] + times(" of prototype", j), as[i][j].join(", "), "propList");
-},
-
-blink : function blink(node)
-{
- if (!node) throw("blink: argument is null or undefined.");
- if (node.nodeType == null) throw("blink: argument must be a node.");
- if (node.nodeType == 3) throw("blink: argument must not be a text node");
- if (node.documentElement) throw("blink: argument must not be the document object");
-
- function setOutline(o) {
- return function() {
- if (node.style.outline != node.style.bogusProperty) {
- // browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).
- node.style.outline = o;
- }
- else if (node.style.MozOutline != node.style.bogusProperty) {
- // browser supports MozOutline (Firefox 1.0.x and older)
- node.style.MozOutline = o;
- }
- else {
- // browser only supports border (IE). border is a fallback because it moves things around.
- node.style.border = o;
- }
- }
- }
-
- function focusIt(a) {
- return function() {
- a.focus();
- }
- }
-
- if (node.ownerDocument) {
- var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE
- if (windowToFocusNow)
- setTimeout(focusIt(windowToFocusNow.top), 0);
- }
-
- for(var i=1;i<7;++i)
- setTimeout(setOutline((i%2)?'3px solid red':'none'), i*100);
-
- setTimeout(focusIt(window), 800);
- setTimeout(focusIt(_in), 810);
-},
-
-scope : function scope(sc)
-{
- if (!sc) sc = {};
- _scope = sc;
- println("Scope is now " + sc + ". If a variable is not found in this scope, window will also be searched. New variables will still go on window.", "message");
-},
-
-mathHelp : function mathHelp()
-{
- printWithRunin("Math constants", "E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2", "propList");
- printWithRunin("Math methods", "abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan", "propList");
-},
-
-ans : undefined,
-
-cls : function cls()
-{
- while (_out.lastChild) { _out.removeChild( _out.lastChild ); }
-}
-};
-
-
-function hist(up)
-{
- // histList[0] = first command entered, [1] = second, etc.
- // type something, press up --> thing typed is now in "limbo"
- // (last item in histList) and should be reachable by pressing
- // down again.
-
- var L = histList.length;
-
- if (L == 1)
- return;
-
- if (up)
- {
- if (histPos == L-1)
- {
- // Save this entry in case the user hits the down key.
- histList[histPos] = _in.value;
- }
-
- if (histPos > 0)
- {
- histPos--;
- // Use a timeout to prevent up from moving cursor within new text
- // Set to nothing first for the same reason
- setTimeout(
- function() {
- _in.value = '';
- _in.value = histList[histPos];
- if (_in.setSelectionRange)
- _in.setSelectionRange(0, 0);
- },
- 0
- );
- }
- }
- else // down
- {
- if (histPos < L-1)
- {
- histPos++;
- _in.value = histList[histPos];
- }
- else if (histPos == L-1)
- {
- // Already on the current entry: clear but save
- if (_in.value)
- {
- histList[histPos] = _in.value;
- ++histPos;
- _in.value = "";
- }
- }
- }
-}
-
-function tabcomplete()
-{
- /*
- * Working backwards from s[from], find the spot
- * where this expression starts. It will scan
- * until it hits a mismatched ( or a space,
- * but it skips over quoted strings.
- * If stopAtDot is true, stop at a '.'
- */
- function findbeginning(s, from, stopAtDot)
- {
- /*
- * Complicated function.
- *
- * Return true if s[i] == q BUT ONLY IF
- * s[i-1] is not a backslash.
- */
- function equalButNotEscaped(s,i,q)
- {
- if(s.charAt(i) != q) // not equal go no further
- return false;
-
- if(i==0) // beginning of string
- return true;
-
- if(s.charAt(i-1) == '\\') // escaped?
- return false;
-
- return true;
- }
-
- var nparens = 0;
- var i;
- for(i=from; i>=0; i--)
- {
- if(s.charAt(i) == ' ')
- break;
-
- if(stopAtDot && s.charAt(i) == '.')
- break;
-
- if(s.charAt(i) == ')')
- nparens++;
- else if(s.charAt(i) == '(')
- nparens--;
-
- if(nparens < 0)
- break;
-
- // skip quoted strings
- if(s.charAt(i) == '\'' || s.charAt(i) == '\"')
- {
- //dump("skipping quoted chars: ");
- var quot = s.charAt(i);
- i--;
- while(i >= 0 && !equalButNotEscaped(s,i,quot)) {
- //dump(s.charAt(i));
- i--;
- }
- //dump("\n");
- }
- }
- return i;
- }
-
- function getcaretpos(inp)
- {
- if(inp.selectionEnd)
- return inp.selectionEnd;
-
- if(inp.createTextRange)
- {
- //dump('using createTextRange\n');
- var docrange = _win.Shell.document.selection.createRange();
- var inprange = inp.createTextRange();
- inprange.setEndPoint('EndToStart', docrange);
- return inprange.text.length;
- }
-
- return inp.value.length; // sucks, punt
- }
-
- function setselectionto(inp,pos)
- {
- if(inp.selectionStart) {
- inp.selectionStart = inp.selectionEnd = pos;
- }
- else if(inp.createTextRange) {
- var docrange = _win.Shell.document.selection.createRange();
- var inprange = inp.createTextRange();
- inprange.move('character',pos);
- inprange.select();
- }
- else { // err...
- /*
- inp.select();
- if(_win.Shell.document.getSelection())
- _win.Shell.document.getSelection() = "";
- */
- }
- }
- // get position of cursor within the input box
- var caret = getcaretpos(_in);
-
- if(caret) {
- //dump("----\n");
- var dotpos, spacepos, complete, obj;
- //dump("caret pos: " + caret + "\n");
- // see if there's a dot before here
- dotpos = findbeginning(_in.value, caret-1, true);
- //dump("dot pos: " + dotpos + "\n");
- if(dotpos == -1 || _in.value.charAt(dotpos) != '.') {
- dotpos = caret;
-//dump("changed dot pos: " + dotpos + "\n");
- }
-
- // look backwards for a non-variable-name character
- spacepos = findbeginning(_in.value, dotpos-1, false);
- //dump("space pos: " + spacepos + "\n");
- // get the object we're trying to complete on
- if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)
- {
- // try completing function args
- if(_in.value.charAt(dotpos) == '(' ||
- (_in.value.charAt(spacepos) == '(' && (spacepos+1) == dotpos))
- {
- var fn,fname;
- var from = (_in.value.charAt(dotpos) == '(') ? dotpos : spacepos;
- spacepos = findbeginning(_in.value, from-1, false);
-
- fname = _in.value.substr(spacepos+1,from-(spacepos+1));
- //dump("fname: " + fname + "\n");
- try {
- with(_win.Shell._scope)
- with(_win)
- with(Shell.shellCommands)
- fn = eval(fname);
- }
- catch(er) {
- //dump('fn is not a valid object\n');
- return;
- }
- if(fn == undefined) {
- //dump('fn is undefined');
- return;
- }
- if(fn instanceof Function)
- {
- // Print function definition, including argument names, but not function body
- if(!fn.toString().match(/function .+?\(\) +\{\n +\[native code\]\n\}/))
- println(fn.toString().match(/function .+?\(.*?\)/), "tabcomplete");
- }
-
- return;
- }
- else
- obj = _win;
- }
- else
- {
- var objname = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
- //dump("objname: |" + objname + "|\n");
- try {
- with(_win.Shell._scope)
- with(_win)
- obj = eval(objname);
- }
- catch(er) {
- printError(er);
- return;
- }
- if(obj == undefined) {
- // sometimes this is tabcomplete's fault, so don't print it :(
- // e.g. completing from "print(document.getElements"
- // println("Can't complete from null or undefined expression " + objname, "error");
- return;
- }
- }
- //dump("obj: " + obj + "\n");
- // get the thing we're trying to complete
- if(dotpos == caret)
- {
- if(spacepos+1 == dotpos || spacepos == dotpos)
- {
- // nothing to complete
- //dump("nothing to complete\n");
- return;
- }
-
- complete = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
- }
- else {
- complete = _in.value.substr(dotpos+1,caret-(dotpos+1));
- }
- //dump("complete: " + complete + "\n");
- // ok, now look at all the props/methods of this obj
- // and find ones starting with 'complete'
- var matches = [];
- var bestmatch = null;
- for(var a in obj)
- {
- //a = a.toString();
- //XXX: making it lowercase could help some cases,
- // but screws up my general logic.
- if(a.substr(0,complete.length) == complete) {
- matches.push(a);
- ////dump("match: " + a + "\n");
- // if no best match, this is the best match
- if(bestmatch == null)
- {
- bestmatch = a;
- }
- else {
- // the best match is the longest common string
- function min(a,b){ return ((a<b)?a:b); }
- var i;
- for(i=0; i< min(bestmatch.length, a.length); i++)
- {
- if(bestmatch.charAt(i) != a.charAt(i))
- break;
- }
- bestmatch = bestmatch.substr(0,i);
- ////dump("bestmatch len: " + i + "\n");
- }
- ////dump("bestmatch: " + bestmatch + "\n");
- }
- }
- bestmatch = (bestmatch || "");
- ////dump("matches: " + matches + "\n");
- var objAndComplete = (objname || obj) + "." + bestmatch;
- //dump("matches.length: " + matches.length + ", tooManyMatches: " + tooManyMatches + ", objAndComplete: " + objAndComplete + "\n");
- if(matches.length > 1 && (tooManyMatches == objAndComplete || matches.length <= 10)) {
-
- printWithRunin("Matches: ", matches.join(', '), "tabcomplete");
- tooManyMatches = null;
- }
- else if(matches.length > 10)
- {
- println(matches.length + " matches. Press tab again to see them all", "tabcomplete");
- tooManyMatches = objAndComplete;
- }
- else {
- tooManyMatches = null;
- }
- if(bestmatch != "")
- {
- var sstart;
- if(dotpos == caret) {
- sstart = spacepos+1;
- }
- else {
- sstart = dotpos+1;
- }
- _in.value = _in.value.substr(0, sstart)
- + bestmatch
- + _in.value.substr(caret);
- setselectionto(_in,caret + (bestmatch.length - complete.length));
- }
- }
-}
-
-function printQuestion(q)
-{
- println(q, "input");
-}
-
-function printAnswer(a)
-{
- if (a !== undefined) {
- println(a, "normalOutput");
- shellCommands.ans = a;
- }
-}
-
-function printError(er)
-{
- var lineNumberString;
-
- lastError = er; // for debugging the shell
- if (er.name)
- {
- // lineNumberString should not be "", to avoid a very wacky bug in IE 6.
- lineNumberString = (er.lineNumber != undefined) ? (" on line " + er.lineNumber + ": ") : ": ";
- println(er.name + lineNumberString + er.message, "error"); // Because IE doesn't have error.toString.
- }
- else
- println(er, "error"); // Because security errors in Moz /only/ have toString.
-}
-
-function go(s)
-{
- _in.value = question = s ? s : _in.value;
-
- if (question == "")
- return;
-
- histList[histList.length-1] = question;
- histList[histList.length] = "";
- histPos = histList.length - 1;
-
- // Unfortunately, this has to happen *before* the JavaScript is run, so that
- // print() output will go in the right place.
- _in.value='';
- recalculateInputHeight();
- printQuestion(question);
-
- if (_win.closed) {
- printError("Target window has been closed.");
- return;
- }
-
- try { ("Shell" in _win) }
- catch(er) {
- printError("The JavaScript Shell cannot access variables in the target window. The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.");
- return;
- }
-
- if (!("Shell" in _win))
- initTarget(); // silent
-
- // Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).
- _win.location.href = "javascript:try{ Shell.printAnswer(eval('with(Shell._scope) with(Shell.shellCommands) {' + Shell.question + String.fromCharCode(10) + '}')); } catch(er) { Shell.printError(er); }; setTimeout(Shell.refocus, 0); void 0";
-}
-
-</script>
-
-<!-- for http://ted.mielczarek.org/code/mozilla/extensiondev/ -->
-<script type="text/javascript" src="chrome://extensiondev/content/rdfhistory.js"></script>
-<script type="text/javascript" src="chrome://extensiondev/content/chromeShellExtras.js"></script>
-
-<style type="text/css">
-body { background: white; color: black; }
-
-#output { white-space: pre; white-space: -moz-pre-wrap; } /* Preserve line breaks, but wrap too if browser supports it */
-h3 { margin-top: 0; margin-bottom: 0em; }
-h3 + div { margin: 0; }
-
-form { margin: 0; padding: 0; }
-#input { width: 100%; border: none; padding: 0; }
-
-.input { color: blue; background: white; font: inherit; font-weight: bold; margin-top: .5em; /* background: #E6E6FF; */ }
-.normalOutput { color: black; background: white; }
-.print { color: brown; background: white; }
-.error { color: red; background: white; }
-.propList { color: green; background: white; }
-.message { color: green; background: white; }
-.tabcomplete { color: purple; background: white; }
-</style>
-</head>
-
-<body onload="params.w = window; params.app = 'Shell'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
-
- <div id="output"><h3>JavaScript Shell 1.3.1</h3><div>Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down, <a accesskey=M href="javascript:go('scope(Math); mathHelp();');">Math</a>, <a accesskey=H href="http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.3.1">help</a></div><div>Values and functions: ans, print(string), <a accesskey=P href="javascript:go('props(ans)')">props(object)</a>, <a accesskey=B href="javascript:go('blink(ans)')">blink(node)</a>, load(scriptURL), scope(object), cls()</div></div>
-
-<div><textarea id="input" class="input" wrap="off" onkeydown="inputKeydown(event)" rows="1"></textarea></div>
-
-</body>
-
-</html>
+++ /dev/null
-sdump('D_TRACE','Loading sound.js\n');
-
-function xp_sound_init() {
- var SOUNDContractID = "@mozilla.org/sound;1";
- var SOUNDIID = Components.interfaces.nsISound;
- var SOUND = Components.classes[SOUNDContractID].createInstance(SOUNDIID);
- return SOUND;
-}
-
-function snd_bad() {
- mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/redalert.wav') );
-}
-
-function snd_really_bad() {
- mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/gong.wav') );
-}
-
-function snd_good() {
- mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/turn.wav') );
-}
-
-function snd_circ_good() {
- mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/clicked.wav') );
-}
-
-function snd_circ_bad() {
- mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/cow.wav') );
-}
-
-function snd_logon() {
-
-}
-
-function snd_logoff() {
-
-}
-
-function snd_exit() {
-
-}
-
-
+++ /dev/null
-function spawn_interface(d,placement,place,chrome,label,passthru_params,clone) {
- sdump('D_SPAWN',arg_dump(arguments,{0:true,1:true,2:true,3:true,4:true,5:true}));
- var w;
- switch(placement) {
- case 'new_tab' :
- mw.new_tab(d,place);
- w = spawn_interface(d,'replace_tab',place,chrome,label,passthru_params,clone); break;
-
- case 'replace_tab' :
- w = mw.replace_tab(d,place,label,chrome); break;
-
- case 'new_window' :
- w = new_window( chrome, { 'window_name' : label } ); break;
-
-
- case 'replace_iframe' :
- case 'replace_browser' :
- case 'replace_editor' :
- var el = placement.slice(8);
- var container = get_widget( d, place );
- empty_widget( d, container );
- w = spawn_interface(d,'new_' + el,place,chrome,label,passthru_params,clone);
- break;
-
- case 'new_iframe' :
- case 'new_browser' :
- case 'new_editor' :
- var el = placement.slice(4);
- var frame = d.createElement( el );
- frame.setAttribute('flex','1');
- get_widget( d, place ).appendChild( frame );
- w = spawn_interface(d,'set_frame',frame,chrome,label,passthru_params,clone);
- break;
-
- case 'set_frame' :
- var frame = get_widget( d, place );
- if (clone) {
- frame.contentWindow.document = mw.G.test_win.document.cloneNode(true);
- } else {
- frame.setAttribute('src',chrome);
- }
- w = frame.contentWindow;
- break;
- }
- w.params = passthru_params;
- w.mw = mw;
- if (placement == 'new_tab' || placement == 'replace_tab') {
- w.app_shell = d;
- } else {
- if (typeof app_shell != 'undefined') w.app_shell = app_shell;
- }
- return w;
-}
-
-/* developer utilities */
-
-function spawn_javascript_console(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://global/content/console.xul';
- return spawn_interface(d,placement,place,chrome,getString('javascript_console_label'),passthru_params,clone);
-}
-
-function spawn_xuleditor(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/util/xuledit.xul';
- return spawn_interface(d,placement,place,chrome,getString('xuleditor_label'),passthru_params,clone);
-}
-
-function spawn_javascript_shell(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/util/shell.html';
- return spawn_interface(d,placement,place,chrome,getString('javascript_shell_label'),passthru_params,clone);
-}
-
-function spawn_filter_console(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/util/filter_console.xul';
- return spawn_interface(d,placement,place,chrome,getString('filter_console_label'),passthru_params,clone);
-}
-
-function spawn_fieldmapper(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/util/fm_view.xul';
- return spawn_interface(d,placement,place,chrome,getString('fieldmapper_label'),passthru_params,clone);
-}
-
-/* current */
-
-function spawn_main() {
- sdump('D_SPAWN','trying to spawn app_shell\n');
- try {
- var w = new_window('chrome://evergreen/content/main/app_shell.xul', {});
- if (!w) { throw('window ref == null'); }
- try {
- w.params = {};
- return w;
- } catch(E) {
- alert('Hrmm. ' + pretty_print( js2JSON(E) ) );
- }
- } catch(E) {
- dump(js2JSON(E)+'\n');
- }
-}
-
-function spawn_checkin(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/circ/checkin.xul';
- return spawn_interface(d,placement,place,chrome,getString('checkin_interface_label'),passthru_params,clone);
-}
-
-function spawn_record_details(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/details.xul';
- return spawn_interface(d,placement,place,chrome,'DETAILS',passthru_params,clone);
-}
-
-function spawn_hold_capture(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/circ/hold_capture.xul';
- return spawn_interface(d,placement,place,chrome,getString('hold_capture_interface_label'),passthru_params,clone);
-}
-
-function spawn_opac_navigator(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/opac/opac.xul';
- //var chrome = 'http://google.com/';
- return spawn_interface(d,placement,place,chrome,getString('opac_navigator_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_barcode_entry(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_barcode_entry.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_barcode_entry_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_display(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_display.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_display_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_search(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_search.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_search_interface_label'),passthru_params,clone);
-}
-
-function spawn_receipt_template_editor(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/circ/receipt_template_editor.xul';
- return spawn_interface(d,placement,place,chrome,getString('receipt_template_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_spine_label_wizard(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/spine_label_wizard.xul';
- return spawn_interface(d,placement,place,chrome,getString('spine_label_wizard'),passthru_params,clone);
-}
-
-/* legacy code, may be removed or refactored */
-
-function spawn_batch_copy_editor(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/copy_edit.xul';
- return spawn_interface(d,placement,place,chrome,getString('copies_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_bill_wizard(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_bill_wizard.xul';
- return spawn_interface(d,placement,place,chrome,getString('bills_wizard_label'),passthru_params,clone);
-}
-
-function spawn_patron_bill_details(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_bill_details.xul';
- return spawn_interface(d,placement,place,chrome,getString('bill_details_label'),passthru_params,clone);
-}
-
-function spawn_copy_browser(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
- return spawn_interface(d,placement,place,chrome,getString('copy_browser_interface_label'),passthru_params,clone);
-}
-
-function spawn_brief_view(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/brief.xul';
- return spawn_interface(d,placement,place,chrome,'BRIEF VIEW',passthru_params,clone);
-}
-
-function spawn_marc_editor(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/cat/marc.xul';
- return spawn_interface(d,placement,place,chrome,getString('marc_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_oclc_import(d,placement,place,passthru_params,clone) {
- sdump('D_SPAWN','trying to spawn_oclc_import('+js2JSON(passthru_params)+')\n');
- // sample TCN: 03715963
- try {
- if (passthru_params.tcn.length < 6) {
- throw("Too short. At the moment, we're really doing a search rather than a retrieve, and it's a substring search at that. We grab the result that matches exactly. But sending a short query would just be mean. :)");
- }
- var result = user_request(
- 'open-ils.search',
- 'open-ils.search.z3950.import',
- [ mw.G.auth_ses[0], passthru_params.tcn ]
- )[0];
- if (result) {
- if (typeof result == 'object') {
- if (result.records && result.records.length > 0) {
- passthru_params['import_tree'] = result.records[0];
- } else {
- throw('no records. result = ' + js2JSON(result) + '\n');
- }
- } else {
- throw('result: ' + js2JSON(result) + '\n');
- }
- spawn_marc_editor(d,placement,place,passthru_params);
- }
- } catch(E) {
- mw.handle_error(E);
- }
-}
-
-function spawn_new_marc_creation(d,placement,place,passthru_params,clone) {
- sdump('D_SPAWN','trying to spawn_new_marc_creation('+js2JSON(passthru_params)+')\n');
- if (! passthru_params.type) passthru_params.type = 'book';
- try {
- var record = user_request(
- 'open-ils.cat',
- 'open-ils.cat.biblio.marc_template.retrieve',
- [ passthru_params.type ]
- )[0];
- passthru_params['import_tree'] = record;
- passthru_params['new_tree'] = true;
- spawn_marc_editor(d,placement,place,passthru_params);
- } catch(E) {
- mw.handle_error(E);
- }
-}
-
-function marc_view(app_shell,record_id) {
- try {
- var html = user_request(
- "open-ils.search",
- "open-ils.search.biblio.record.html",
- [ record_id ]
- )[0];
- html = html.replace( /<table/, '<div id="this_div"><input id="copy_btn" type="submit" value="Copy Browser" /><input id="marc_btn" type="submit" value="MARC Editor" /></div><table' );
- var id = record_id;
- var win = new_window("data:text/html," + html);
- setTimeout(
- function() {
- win.document.title = "View MARC";
- win.focus();
- win.document.getElementById('marc_btn').addEventListener(
- 'click',
- function(ev) {
- spawn_marc_editor(
- app_shell, 'new_tab', 'main_tabbox', {
- 'find_this_id' : record_id
- }
- ).find_this_id = record_id;
- },
- false
- );
- win.document.getElementById('copy_btn').addEventListener(
- 'click',
- function(ev) {
- spawn_copy_browser(
- app_shell, 'new_tab', 'main_tabbox', {
- 'find_this_id' : record_id
- }
- ).find_this_id = record_id;
- },
- false
- );
- }, 0
- );
- } catch(E) {
- handle_error(E);
- }
-}
-
-function spawn_patron_edit(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_register(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/patron/patron_new_legacy.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_register_interface_label'),passthru_params,clone);
-}
-
-function spawn_copy_stat_cat_edit(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/stat_cat/copy_stat_cat_editor.xul';
- return spawn_interface(d,placement,place,chrome,getString('copy_stat_cat_editor_interface'),passthru_params,clone);
-}
-
-function spawn_patron_stat_cat_edit(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/stat_cat/patron_stat_cat_editor.xul';
- return spawn_interface(d,placement,place,chrome,getString('patron_stat_cat_editor_interface'),passthru_params,clone);
-}
-
-function spawn_survey_admin_wizard(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/survey/survey_wizard.xul';
- return spawn_interface(d,placement,place,chrome,getString('survey_admin_interface_label'),passthru_params,clone);
-}
-
-function spawn_z3950_import(d,placement,place,passthru_params,clone) {
- var chrome = 'chrome://evergreen/content/z39_50/z39_50.xul';
- return spawn_interface(d,placement,place,chrome,getString('z39_50_import_interface_label'),passthru_params,clone);
-}
-
-
+++ /dev/null
-sdump('D_TRACE','Loading util.js\n');
-
-var counter = {};
-var consider_Timeout_default = false;
-
-function a_get( obj, i ) { return obj[i]; } // for use in closures inside loops
-
-// This executes a series of functions, but tries to give other events/functions a chance to
-// execute between each one.
-function chain_exec() {
- sdump('D_UTIL',arg_dump(arguments));
- var args = [];
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (typeof(arg)=='function') args.push( arg );
- else for (var j = 0; j < arg.length; j++) {
- if (typeof(arg[j])=='function') args.push( arg[j] );
- }
- }
- if (args.length > 0) setTimeout(
- function() {
- args[0]();
- if (args.length > 1 ) chain_exec( args.slice(1) );
- }, 0
- );
-}
-
-function consider_Timeout( f, t, b) {
- sdump('D_TIMEOUT', arg_dump(arguments,{0:true,1:true,2:true}));
- if (b) {
- setTimeout(f,t);
- } else {
- if (consider_Timeout_default)
- setTimeout(f,t);
- else
- f();
- }
-}
-
-function parse_render_string( obj_string, render_string, regexp ) {
- sdump('D_UTIL', arg_dump(arguments,{0:true,1:true}));
- var cmd;
- try {
- if (!regexp) regexp = /\$\$/g;
- if (render_string.slice(0,1) == '.') {
- cmd = obj_string + render_string;
- } else {
- cmd = render_string.replace( regexp, obj_string );
- }
-
- } catch(E) {
-
- sdump('D_ERROR',E);
- }
- sdump('D_UTIL', 'cmd = ' + cmd + '\n');
- return cmd;
-}
-
-function getString( key ) {
- var s = '';
- var bundles = mw.document.getElementById('string_bundles');
- sdump('D_STRING','bundles = ' + bundles + ' bundles.childNodes.length = ' + bundles.childNodes.length + '\n');
- for (var i = 0; i < bundles.childNodes.length; i++) {
- var bundle = bundles.childNodes[i];
- sdump('D_STRING','\ttrying bundle = ' + bundle + '\n');
- try {
-
- var string = bundle.getString( key );
- if (string) {
- s = string;
- sdump('D_STRING','\tfound\n');
- } else {
- sdump('D_STRING','\tnot found\n');
- }
-
- } catch(E) {
- sdump('D_ERROR','string: ' + key + ' not found\n');
- s = key;
- }
- }
- sdump('D_STRING',key + '=' + s + '\n');
- return s;
-}
-
-function getFormattedString( key, strArray ) {
- var s = '';
- var bundles = mw.document.getElementById('string_bundles');
- for (var i = i; i < bundles.childNodes.length; i++) {
- var bundle = bundles[i];
- try {
-
- var string = bundle.getFormattedString( key, strArray );
- if (string)
- s = string;
-
- } catch(E) {
- sdump('D_ERROR','string: ' + key + ' not found\n');
- s = key;
- }
- }
- sdump('D_STRING',key + '(' + strArray + ')=' + s + '\n');
- return s;
-}
-
-function string_to_array(s) {
- var my_array = [];
- for (var i = 0; i < s.length; i++ ) {
- my_array.push( s.charAt(i) );
- }
- return my_array;
-}
-
-function yesno(value) {
- switch(value) {
- case true: case 'true': case '1': case 'on':
- return 'Yes';
- default:
- return 'No';
- }
-}
-
-function dollars_float_to_cents_integer( money ) {
- // careful to avoid fractions of pennies
- var money_s = money.toString();
- // FIXME: strip miscellaneous characters
- var marray = money_s.split(".");
- var dollars = marray[0];
- var cents = marray[1];
- try {
- if (cents.length < 2) {
- cents = cents + '0';
- }
- } catch(E) {
- // I'm not sure why these are getting thrown, especially with the code still working
- sdump('D_ERROR',"cents.length? " + E + "\n");
- }
- try {
- if (cents.length > 2) {
- sdump('D_ERROR',"We don't round money\n");
- cents = cents.substr(0,2);
- }
- } catch(E) {
- sdump('D_ERROR',"cents.length? " + E + "\n");
- }
- var total = 0;
- try {
- if (parseInt(cents)) total += parseInt(cents);
- } catch(E) {
- sdump('D_ERROR',"parseInt(cents)? " + E + "\n");
- }
- try {
- if (parseInt(dollars)) total += (parseInt(dollars) * 100);
- } catch(E) {
- sdump('D_ERROR',"parseInt(dollars)? " + E + "\n");
- }
- return total;
-}
-
-function cents_as_dollars( cents ) {
- cents = cents.toString();
- // FIXME: strip miscellaneous characters
- try {
- switch( cents.length ) {
- case 0: cents = '000'; break;
- case 1: cents = '00' + cents; break;
- }
- } catch(E) {
- sdump('D_ERROR',"cents_as_dollars: cents.length? " + E + "\n");
- }
- return cents.substr(0,cents.length-2) + '.' + cents.substr(cents.length - 2);
-}
-
-function debug() {
- var s = '';
- for (var i = 0; i < arguments.length; i++) {
- s = s + arguments[i];
- }
- //sdump('D_UTIL','debug:' + s + '\n');
- dump('debug:' + s + '\n');
-}
-
-function counter_init(id) {
- counter[id] = 0;
-}
-
-function counter_incr(id) {
- if (! counter[id]) { counter_init(id); }
- return ++counter[id];
-}
-
-function counter_peek(id) {
- if (! counter[id]) { return 0; }
- return counter[id];
-}
-
-function dump_ns_node( node ) {
- return (
- 'id=<' +
- node[fieldmap["Fieldmapper::biblio::record_node"].fields.id.position]
- + '> intra-id=<' +
- node[fieldmap["Fieldmapper::biblio::record_node"].fields.intra_doc_id.position]
- + '> name=<' +
- node[fieldmap["Fieldmapper::biblio::record_node"].fields.name.position]
- + '> node_type=<' +
- node[fieldmap["Fieldmapper::biblio::record_node"].fields.type.position]
- + '> parent_node=<' +
- node[fieldmap["Fieldmapper::biblio::record_node"].fields.parent_node.position]
- + '> '
- );
-}
-
-function nodeset2tree(ns) {
- for (var i in ns) {
- if (ns[i].parent_node) {
- ns_addChild(
- ns,
- ns[i].parent_node,
- ns[i].intra_doc_id
- );
- }
- }
- return ns;
-}
-
-function ns_addChild(ns,p,c) {
- if (! ns[p].children ) { ns[p].children = []; }
- ns[p].children.push(ns[c]);
-}
-
-function print_tabs(t) {
- var r = '';
- for (var j = 0; j < t; j++ ) { r = r + "\t"; }
- return r;
-}
-
-function pretty_print(s) {
- var r = ''; var t = 0;
- for (var i in s) {
- if (s[i] == '{') {
- r = r + "\n" + print_tabs(t) + s[i]; t++;
- r = r + "\n" + print_tabs(t);
- } else if (s[i] == '[') {
- r = r + "\n" + print_tabs(t) + s[i]; t++;
- r = r + "\n" + print_tabs(t);
- } else if (s[i] == '}') {
- t--; r = r + "\n" + print_tabs(t) + s[i];
- r = r + "\n" + print_tabs(t);
- } else if (s[i] == ']') {
- t--; r = r + "\n" + print_tabs(t) + s[i];
- r = r + "\n" + print_tabs(t);
- } else if (s[i] == ',') {
- r = r + s[i];
- r = r + "\n" + print_tabs(t);
- } else {
- r = r + s[i];
- }
- }
- return r;
-}
-
-function super_dump(o,t) {
- var s = "\n";
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "=-=-=\n";
- s = s + 'o.constructor == Array = ' + (o.constructor == Array) + '\n';
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "typeof = " + typeof(o) + "\n";
- try {
- var string = new XMLSerializer().serializeToString(o);
- return( string + "\n" );
- } catch( E ) {
- var i;
- var c = 0;
- for (i in o) {
- switch(typeof(i)) {
- case 'object':
- s = s + super_dump(i,t+1);
- break;
- default :
- var value = o[i];
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "\tMember#" + c++ + "\tType:" + typeof(value);
- if (typeof(value) == 'object') {
- value = super_dump(value,t+1);
- }
- s = s + "\ttoString:" + i.toString() + "\tvalue:" + value + "\n";
- break;
- }
- }
- return( s + "\n" );
- }
-}
-
-function super_dump_norecurse(o,t) {
- var s = "\n";
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "=-=-=\n";
- s = s + 'o.constructor == Array = ' + (o.constructor == Array) + '\n';
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "typeof = " + typeof(o) + "\n";
- try {
- var string = new XMLSerializer().serializeToString(o);
- return( string + "\n" );
- } catch( E ) {
- var i;
- var c = 0;
- for (i in o) {
- switch(typeof(i)) {
- default :
- var value = o[i];
- for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
- s = s + "\tMember#" + c++ + "\tType:" + typeof(value);
- s = s + "\ttoString:" + i.toString() + "\n";
- break;
- }
- }
- return( s + "\n" );
- }
-}
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="util"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<util id="util_js">
-
- <script>
- var IAMXUL = true;
- dump('Loading all the js in the util overlay...\n');
- </script>
-
- <script src="error.js" /> <!-- more like output handling -->
- <script src="util.js" /> <!-- miscellaneous scripts. want to make this empty -->
- <script src="file.js" /> <!-- file IO -->
- <script src="datetime.js" /> <!-- date & time related functions -->
- <script src="functional.js" /> <!-- neat use of first-class functions, and some predecessors -->
- <script src="fm_utils.js" /> <!-- some convenience functions for fieldmapper objects -->
- <script src="validate.js" /> <!-- some validation functions -->
- <script src="widgets.js" /> <!-- some convenience functions for XUL/HTML elements. want to eliminate overlap with webutils -->
- <script src="populate.js" /> <!-- populate widgets (like menus) with values -->
-
- <script src="chrome://evergreen/content/Open-ILS/util/utils.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/md5.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/JSON.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/fmall.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/fmgen.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/RemoteRequest.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/OrgTree.js" />
- <script src="chrome://evergreen/content/Open-ILS/util/org_utils.js" />
- <script>IAMXUL = true;</script>
-
- <script src="ses.js" /> <!-- my wrapper over the OpenSRF communication layer.. Jabber and XMLHttpRequest -->
- <script src="explode.js" /> <!-- original attempt at linking widgets to data. Want to use something more OO -->
- <script src="win.js" /> <!-- window and tab handling -->
- <script src="spawn_win.js" /> <!-- spawning various interfaces in tabs -->
- <script src="xpcom.js" /> <!-- misc xpcom -->
- <script src="print.js" /> <!-- some xpcom for printing -->
- <script src="sound.js" /> <!-- some xpcom for sound -->
-
- <script>
- dump('Finished all the js in the util overlay...\n');
- </script>
-</util>
-
-</overlay>
+++ /dev/null
-sdump('D_TRACE',"Loading validate.js\n");
-
-function valid_year_month_day(year,month,day) {
- var date = new Date(year,month-1,day);
- return (
- (date.getFullYear() == year) &&
- (date.getMonth()+1 == month) &&
- (date.getDate() == day)
- );
-}
-
-function textbox_checkdigit(ev) {
- if ( check_checkdigit( ev.target.value ) ) {
- sdump('D_VALIDATE', 'success\n');
- return true;
- } else {
- sdump('D_VALIDATE', 'failure\n');
- ev.preventDefault();
- ev.stopPropagation();
- return false;
- }
-}
-
-function check_checkdigit(barcode) {
-
- var stripped_barcode = barcode.slice(0,-1);
- var checkdigit = barcode.slice(-1);
-
- sdump('D_VALIDATE', '\n\n=-=***=-=\n\ncheck_checkdigit: barcode = ' + barcode + ' barcode stripped = ' + stripped_barcode + ' checkdigit = ' + checkdigit + '\n');
-
- var sum = 0; var mul = 2;
-
- var b_array = string_to_array( stripped_barcode ).reverse();
- sdump('D_VALIDATE', '\tb_array = ' + b_array + '\n');
-
- for (var i in b_array) {
- var digit = parseInt( b_array[i] );
- sdump('D_VALIDATE', '\t\tdigit = ' + digit + '\n');
-
- var product = digit * mul;
- if (mul == 2) { mul = 1; } else { mul = 2; }
-
- var p_array = string_to_array( product.toString() );
- sdump('D_VALIDATE', '\t\tp_array = ' + p_array + '\n');
-
- for (var j in p_array) {
- var n = parseInt( p_array[j] );
- sdump('D_VALIDATE', '\t\t\tn = ' + n + '\n');
- sum += n;
- }
- }
-
- sdump('D_VALIDATE', '\tsum = ' + sum + '\n');
-
- var s_array = string_to_array( sum.toString() );
- var calculated_checkdigit = s_array.pop();
- if (calculated_checkdigit > 0) calculated_checkdigit = 10 - calculated_checkdigit;
- sdump('D_VALIDATE', '\tcalculated checkdigit = ' + calculated_checkdigit + '\n\n=-=***=-=\n\n');
-
- return ( calculated_checkdigit == checkdigit );
-}
-
-
+++ /dev/null
-sdump('D_WIDGETS',"Loading widgets.js\n");
-
-// This was originally used in circ.js for checkin and checkout lists.
-// The first argument is the treechildren element for the tree.
-// Subsequent arguments are treated as textual values for treecells in that treeitem.
-var treeitem_id = 0;
-function append_treeitem() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var e;
- if (arguments.length == 1) {
- e = arguments[0];
- } else {
- d = arguments[0];
- e = arguments[1];
- if (typeof(e) != 'object') { e = d.getElementById(e); }
- }
- if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
- var treechildren = e;
-
- if (!treechildren) { sdump('D_WIDGETS','No ' + id + ' to append to\n'); return null; }
-
- var treeitem = elem('treeitem'); treechildren.appendChild(treeitem);
- var treerow = elem('treerow'); treeitem.appendChild(treerow);
- for (var i = 2; i < arguments.length ; i++ ) {
- var treecell = elem(
- 'treecell',
- { 'label': arguments[i], 'id' : 'treeitem_' + treeitem_id + '_' + i }
- );
- treerow.appendChild(treecell);
- //sdump('D_WIDGETS','treecell.label = ' + arguments[i] + '\n');
- }
- return treeitem_id++;
-}
-
-// This was used in browse_list.js as a more flexible alternative to swap_attribute.
-// The first argument is the element, the second argument is the pertinant attribute,
-// and the third argument is an array of values to cycle through for setting the
-// element's attribute. Ex: var toggle = cycle_attribute( target,'toggle',['1','2','3'] );
-function cycle_attribute() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var e; var a; var v;
- if (arguments.length == 3) {
- e = arguments[0];
- a = arguments[1];
- v = arguments[2];
- } else {
- d = arguments[0];
- e = arguments[1];
- a = arguments[2];
- v = arguments[3];
- if (typeof(e) != 'object') { e = d.getElementById(e); }
- }
- try {
- if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
- if (!a) { throw('!a : a = ' + a); }
- if (! e.getAttribute(a) ) { throw(' ! e.getAttribute(a) : a = ' + a); }
- if (typeof(v) != 'object') { throw('typeof v != object : typeof v = ' + typeof(v)); }
-
- var toggle = e.getAttribute(a);
- var next_one = false;
- sdump('D_WIDGETS','cycling ' + a + ' on ' + e.getAttribute('id') + ' to ');
- for (var i = 0; i < v.length; i++) {
- if (next_one) {
- e.setAttribute(a,v[i]);
- sdump('D_WIDGETS',v[i] + '\n');
- return v[i];
- }
- if (toggle == v[i]) {
- next_one = true;
- }
- }
- if (next_one) {
- e.setAttribute(a,v[0]);
- sdump('D_WIDGETS',v[0] + '\n');
- return v[0];
- } else {
- throw('current value not in list');
- }
- } catch(E) {
- sdump('D_WIDGETS','cycle_attribute error: ' + js2JSON(E) + '\n');
- sdump('D_WIDGETS','null\n');
- return null;
- }
-}
-
-// Treats each argument as an element to disable
-function disable_widgets() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var idx = 0;
- if (arguments[0].nodeName == '#document') {
- idx = 1; d = arguments[0];
- }
- for (var i = idx; i < arguments.length; i++) {
- if (typeof(arguments[i]) == 'object') {
- sdump('D_WIDGETS',arguments[i] + '.disabled = true;\n');
- arguments[i].disabled = true;
- } else {
- var w = d.getElementById( arguments[i] );
- if (w) {
- sdump('D_WIDGETS',w + '.disabled = true;\n');
- w.disabled = true;
- }
- }
- }
-}
-
-// removes listitems from listboxes
-function empty_listbox() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var e;
- if (arguments.length == 1) {
- e = arguments[0];
- } else {
- d = arguments[0];
- e = arguments[1];
- if (typeof(e) != 'object') { e = d.getElementById(e); }
- }
- if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_listbox\n'); return null; }
- var nl = e.getElementsByTagName('listitem');
- for (var i = 0; i < nl.length; i++) {
- e.removeChild(nl[i]);
- }
-}
-
-// removes all of an element's children
-function empty_widget() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var e;
- if (arguments.length == 1) {
- e = arguments[0];
- } else {
- d = arguments[0];
- e = arguments[1];
- if (typeof(e) != 'object') { e = d.getElementById(e); }
- }
- if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_widget\n'); return null; }
- while (e.lastChild) { e.removeChild(e.lastChild); }
-}
-
-
-// Treats each argument as an element to enable
-function enable_widgets() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var idx = 0;
- if (arguments[0].nodeName == '#document') {
- idx = 1; d = arguments[0];
- }
- for (var i = idx; i < arguments.length; i++) {
- if (typeof(arguments[i]) == 'object') {
- sdump('D_WIDGETS',arguments[i] + '.disabled = false;\n');
- arguments[i].disabled = false;
- } else {
- var w = d.getElementById( arguments[i] );
- if (w) {
- sdump('D_WIDGETS',w + '.disabled = false;\n');
- w.disabled = false;
- }
- }
- }
-}
-
-// Originally used in volume.js after intercepting Enter presses on the keyboard.
-// The first argument is the element to search for textboxes, and the second
-// argument is the current textbox. This function finds the next textbox and
-// gives it focus.
-function fake_tab_for_textboxes() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var w; var current;
- if (arguments.length == 2) {
- w = arguments[0];
- current = arguments[1];
- } else {
- d = arguments[0];
- w = arguments[1];
- current = arguments[2];
- if (typeof(w)!='object') { w = d.getElementById(w); }
- }
- var flag = false; var next_one;
- sdump('D_WIDGETS', 'fake_tab_for_textboxes: Current ' + current + '\n');
- var nl = w.getElementsByTagName('textbox');
- //var nl = d.getElementsByTagName('textbox');
- sdump('D_WIDGETS', 'fake_tab_for_textboxes: nl.length = ' + nl.length + '\n');
- for (var i = 0; i < nl.length; i++) {
- sdump('D_WIDGETS', 'fake_tab_for_textboxes: Considering ' + nl[i] + '...\n');
- if (flag && !next_one) {
- sdump('D_WIDGETS', 'fake_tab_for_textboxes: Setting next_one ' + nl[i] + '\n');
- next_one = nl[i];
- }
- if (nl[i] === current) {
- sdump('D_WIDGETS','fake_tab_for_textboxes: Found current\n');
- flag = true;
- }
- }
- if (!next_one) {
- sdump('D_WIDGETS','fake_tab_for_textboxes: Out of loop, Setting next_one ' + nl[0] + '\n');
- next_one = nl[0];
- }
- if (next_one) {
- next_one.focus(); next_one.select();
- } else {
- sdump('D_WIDGETS','fake_tab_for_textboxes: next_one not set\n');
- }
-}
-
-
-// Not actually used anywhere. I'm not sure what this is :D
-// Ah, looks like it could handle XUL trees and fieldmapper trees
-// Ex. find( org_tree, function(o){return o.children();}, function(o){return (o.id == 'the winner');})
-function find_tree_via_children() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d; var tree; var children_func; var find_func;
- if (arguments.length == 3) {
- tree = arguments[0];
- children_func = arguments[1];
- find_func = arguments[2];
- } else {
- d = arguments[0];
- tree = arguments[1];
- children_func = arguments[2];
- find_func = arguments[3];
- if (typeof(tree)!='object') tree = d.getElementById(tree);
- }
-
- var t = find_func(tree); if (t) return t;
-
- var c = children_func(tree);
-
- for (var i = 0; i < c.length; i++) {
- t = find_func( c[i] );
- if (t) return t;
- }
-}
-
-
-// Give this element focus
-function focus_widget() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var e;
- if (arguments.length == 1) {
- e = arguments[0];
- } else {
- d = arguments[0];
- e = arguments[1];
- }
- if (typeof(e) == 'object') {
- e.focus();
- } else {
- var w = d.getElementById(e);
- if (w) { w.focus(); }
- }
-}
-
-// Returns a list of selected treeitems from the specified tree
-function get_list_from_tree_selection() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var tree_w;
- if (arguments.length == 1) {
- tree_w = arguments[0];
- } else {
- d = arguments[0];
- tree_w = arguments[1];
- }
- var hitlist;
- if (typeof(tree_w) != 'object') {
- hitlist = d.getElementById(tree_w);
- } else {
- hitlist = tree_w;
- }
- var list = [];
- var start = new Object();
- var end = new Object();
- var numRanges = hitlist.view.selection.getRangeCount();
- for (var t=0; t<numRanges; t++){
- hitlist.view.selection.getRangeAt(t,start,end);
- for (var v=start.value; v<=end.value; v++){
- var i = hitlist.contentView.getItemAtIndex(v);
- //sdump('D_WIDGETS',i.tagName + '\n');
- list.push( i );
- }
- }
- return list;
-}
-
-// Make sure we a widget
-function get_widget() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var e;
- if (arguments.length == 1) {
- e = arguments[0];
- } else {
- d = arguments[0];
- e = arguments[1];
- }
- if (typeof(e) == 'object') {
- return e;
- } else {
- var w = d.getElementById(e);
- if (w) return w;
- }
- return null;
-}
-
-// Increment a XUL progressmeter
-function incr_progressmeter() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var meter; var increment;
- if (arguments.length == 2) {
- meter = arguments[0];
- increment = arguments[1];
- } else {
- d = arguments[0];
- meter = arguments[1];
- increment = arguments[2];
- }
- if (typeof(meter)!='object')
- meter = d.getElementById(meter);
- if (typeof(meter)!='object')
- return null;
-
- var real = meter.getAttribute('_real');
-
- if (!real)
- real = 0;
- real = parseFloat( real ) + parseFloat( increment );
-
- if (real > 100)
- real = 100;
- else if ( real < 0)
- real = 0;
-
- meter.setAttribute('_real',real);
- meter.value = Math.ceil( real );
-}
-
-// Populate a treeitem row
-function map_array_to_treecells_via_treeitem( cols, treeitem ) {
- sdump('D_WIDGETS',arg_dump(arguments),{0:true});
- var treerow = treeitem.firstChild;
- for (var i = 0; i < treerow.childNodes.length; i++) {
- var treecell = treerow.childNodes[i];
- treecell.setAttribute('label',cols[i]);
- sdump('D_WIDGETS','treeitem = ' + treeitem + ' treerow = ' + treerow + ' treecell = ' + treecell + ' cols[ ' + i + '] = ' + cols[i] + '\n');
- }
-}
-
-// Simulates radio buttons with checkboxes. Include this in command event listeners
-// for the pertinent textboxes. For any set of checkboxes that have the same 'group'
-// attribute, only one can be checked at a time.
-function radio_checkbox() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var ev;
- if (arguments.length == 1) {
- ev = arguments[0];
- } else {
- d = arguments[0];
- ev = arguments[1];
- }
- var target = ev.target;
- var group = target.getAttribute('group');
- if (group) {
- var nl = d.getElementsByTagName('checkbox');
- for (var i in nl) {
- if (typeof(nl[i])=='object') {
- var c = nl[i];
- var cgroup = c.getAttribute('group');
- if (cgroup == group) {
- c.checked = false;
- }
- }
- }
- target.checked = true;
- } else {
- sdump('D_WIDGETS','radio_checkbox: Checkbox must have a group attribute to find peers');
- }
-}
-
-// simpler version of set_decks
-function set_deck() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var deck; var idx;
- if (arguments.length == 2) {
- deck = arguments[0];
- idx = arguments[1];
- set_decks({ deck : idx });
- } else {
- d = arguments[0];
- deck = arguments[1];
- idx = arguments[2];
- set_decks(d,{ deck : idx });
- }
-}
-
-// Takes a hash with key:value => deck element id : page index
-// Sets each deck to the corresponding index
-function set_decks() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var params;
- if (arguments.length == 1) {
- params = arguments[0];
- } else {
- d = arguments[0];
- params = arguments[1];
- }
- for (var deck_id in params) {
- var deck = deck_id;
- if (typeof(deck) != 'object')
- deck = d.getElementById( deck_id )
- if (deck) {
- deck.setAttribute( 'selectedIndex', params[deck_id] );
- deck.selectedIndex = params[deck_id];
- }
- }
-}
-
-// For setting a widget's displayable text
-function set_widget_value_for_display(e,v) {
- sdump('D_WIDGETS',arg_dump(arguments,{1:true}));
- if (v == null || v == undefined) v = '.....';
- sdump('D_WIDGETS','e.tagName = ' + e.tagName + '\n');
- sdump('D_WIDGETS','e.nodeName = ' + e.nodeName + '\n');
- switch (e.tagName) {
- case 'textbox' : e.value = v; break;
- case 'label' : e.setAttribute('value',v); break;
- case 'image' : e.setAttribute('src',v); break;
- case 'menulist' : e.value = v;
- var menupopup = e.firstChild;
- var menuitem;
- for (var i = 0; i < menupopup.childNodes.length; i++) {
- if (menupopup.childNodes[i].getAttribute('value') == v ) menuitem = menupopup.childNodes[i];
- }
- if (menuitem) e.selectedItem = menuitem;
- break;
- default: try {e.setAttribute('value',v); e.value = v;} catch(E) {} break;
- }
-}
-
-// swaps the values of two attributes for an element
-function swap_attributes() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var e; var a1; var a2;
- if (arguments.length == 3) {
- e = arguments[0];
- a1 = arguments[1];
- a2 = arguments[2];
- } else {
- d = arguments[0];
- e = arguments[1];
- a1 = arguments[2];
- a2 = arguments[3];
- if (typeof(e) != 'object') { e = d.getElementById(e); }
- }
- if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on swap_attributes\n'); return null; }
- var a1_v = e.getAttribute(a1);
- var a2_v = e.getAttribute(a2);
- e.setAttribute(a1,a2_v);
- e.setAttribute(a2, a1_v);
- sdump('D_WIDGETS','before: a1 = ' + a1_v + ' a2 = ' + a2_v + ' and ');
- sdump('D_WIDGETS','after: a1 = ' + a2_v + ' a2 = ' + a1_v + '\n');
-}
-
-// Flips the hidden value for each row in a grid
-function toggle_hidden_grid_rows() {
- sdump('D_WIDGETS',arg_dump(arguments));
- if (arguments.length == 1) {
- grid = arguments[0];
- } else {
- d = arguments[0];
- grid = arguments[1];
- }
- if (typeof(grid) != 'object') {
- grid = d.getElementById(grid);
- }
- if (!grid) { return null; }
- var rows = grid.lastChild; if (!rows) { return null; }
- for (var r = 0; r < rows.childNodes.length; r++ ) {
- var row = rows.childNodes[r];
- if (typeof(row) == 'object') {
- //sdump('D_WIDGETS','toggle row = ' + row + '\n');
- var hidden = row.getAttribute('hidden');
- if (hidden == 'true') {
- row.setAttribute('hidden','false');
- } else {
- row.setAttribute('hidden','true');
- }
- }
- }
-}
-
-/* The first parameter is the id of the element to set, or an array of ids for elements to set in batch. The second parameter is an object containing the attribute/value pairs to assign to the element or elements */
-function xul_setAttributes() {
- sdump('D_WIDGETS',arg_dump(arguments));
- var d = document; var el; var attrs;
- if (arguments.length == 2) {
- el = arguments[0];
- attrs = arguments[1];
- } else {
- d = arguments[0];
- el = arguments[1];
- attrs = arguments[2];
- }
- if (typeof(el) == 'object') {
- for (var e in el) {
- var w = d.getElementById(e);
- for (var a in attrs) {
- w.setAttribute(a,attrs[a]);
- }
- }
- } else {
- var w = d.getElementById(el);
- for (var a in attrs) {
- w.setAttribute(a,attrs[a]);
- }
- }
-}
-
+++ /dev/null
-sdump('D_TRACE','Loading win.js\n');
-
-function s_alert(s) {
- sdump('D_WIN',arg_dump(arguments));
- // alert() replacement, intended to stop barcode scanners from "scanning through" the dialog
-
- // get a reference to the prompt service component.
- var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
- // set the buttons that will appear on the dialog. It should be
- // a set of constants multiplied by button position constants. In this case,
- // three buttons appear, Save, Cancel and a custom button.
- //var flags=promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0 +
- // promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1 +
- // promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2;
- var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0;
-
- // display the dialog box. The flags set above are passed
- // as the fourth argument. The next three arguments are custom labels used for
- // the buttons, which are used if BUTTON_TITLE_IS_STRING is assigned to a
- // particular button. The last two arguments are for an optional check box.
- var check = {};
- sdump('D_WIN','s_alert: ' + s);
- var rv = promptService.confirmEx(window,"ALERT",
- s,
- flags,
- "Enter", null, null,
- "Check this box to confirm this message",
- check
- );
- if (!check.value) {
- snd_bad();
- return s_alert(s);
- }
- return rv;
-}
-
-function yns_alert(s,title,b1,b2,b3,c) {
- sdump('D_WIN',arg_dump(arguments));
- // alert() replacement, intended to stop barcode scanners from "scanning through" the dialog
-
- // get a reference to the prompt service component.
- var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
- // set the buttons that will appear on the dialog. It should be
- // a set of constants multiplied by button position constants. In this case,
- // three buttons appear, Save, Cancel and a custom button.
- //var flags=promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0 +
- // promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1 +
- // promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2;
- var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0 +
- promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1 +
- promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2;
-
- // display the dialog box. The flags set above are passed
- // as the fourth argument. The next three arguments are custom labels used for
- // the buttons, which are used if BUTTON_TITLE_IS_STRING is assigned to a
- // particular button. The last two arguments are for an optional check box.
- var check = {};
- sdump('D_WIN','yns_alert: ' + s);
- var rv = promptService.confirmEx(window,title, s, flags, b1, b2, b3, c, check);
- if (c && !check.value) {
- snd_bad();
- return yns_alert(s,title,b1,b2,b3,c);
- }
- return rv;
-}
-
-function new_window(chrome,params) {
- sdump('D_WIN',arg_dump(arguments));
- var name = ++mw.G['window_name_increment'];
- var options = 'chrome,resizable=yes,scrollbars=yes,width=800,height=600,fullscreen=yes';
- try {
- if (params) {
- if (params['window_name']) { name = params.window_name; }
- if (params['window_options']) { options = params.window_options; }
- }
- } catch(E) {
- }
- //var w = window.open(
- var w = SafeWindowOpen(
- chrome,
- name,
- options
- );
- if (w) {
- if (w != self) {
- w.parentWindow = self;
- w.mw = mw;
- //register_window(w);
- }
- w.am_i_a_top_level_tab = false;
- if (params) {
- w.params = params;
- }
- }
- return w;
-}
-
-
-// From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
-// Message-ID: <ckjh7a$18q1@ripley.netscape.com>
-// Modified to return window handler, and do errors differently
-function SafeWindowOpen(url,title,features)
-{
- sdump('D_WIN',arg_dump(arguments));
- var w;
-
- netscape.security.PrivilegeManager
- .enablePrivilege("UniversalXPConnect");
- const CI = Components.interfaces;
- const PB =
- Components.classes["@mozilla.org/preferences-service;1"]
- .getService(CI.nsIPrefBranch);
-
- var blocked = false;
- try
- {
- // pref 'dom.disable_open_during_load' is the main popup
- // blocker preference
- blocked = PB.getBoolPref("dom.disable_open_during_load");
- if(blocked)
- PB.setBoolPref("dom.disable_open_during_load",false);
-
- w = window.open(url,title,features);
- }
- catch(e)
- {
- //alert("SafeWindowOpen error:\n\n" + e);
- handle_error(e);
- }
- if(blocked)
- PB.setBoolPref("dom.disable_open_during_load",true);
-
- return w;
-}
-
-function register_AppShell(w) {
- sdump('D_WIN',arg_dump(arguments,{0:true}));
- mw.G.appshell_list.push(w);
-}
-
-function unregister_AppShell(w) {
- sdump('D_WIN',arg_dump(arguments,{0:true}));
- mw.G.appshell_list = filter_list( mw.G.appshell_list, function(e){return(e!=w);} );
-}
-
-function register_window(w) {
- sdump('D_WIN',arg_dump(arguments,{0:false}));
- mw.G.win_list.push(w);
- mw.G.last_win = w;
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function unregister_window(w) {
- sdump('D_WIN',arg_dump(arguments,{0:true}));
- mw.G.win_list = filter_list( mw.G.win_list, function(e){return(e!=w);} );
- mw.G.last_win = mw.G.win_list[ mw.G.win_list.length - 1 ];
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function close_all_windows() {
- sdump('D_WIN',arg_dump(arguments));
- var w;
- for (var i in mw.G.appshell_list) {
- sdump('D_WIN','\tconsidering ' + i + '...');
- if (mw.G.appshell_list[i] != mw) {
- sdump('D_WIN','closing');
- var w = mw.G.appshell_list[i];
- try { w.close(); } catch (E) {}
- }
- sdump('D_WIN','\n');
- }
- sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function register_document(d) {
- sdump('D_WIN',arg_dump(arguments,{0:true}));
- mw.G.doc_list[d.toString()] = d;
- mw.G.last_doc = d;
-}
-
-function unregister_document(d) {
- sdump('D_WIN',arg_dump(arguments,{0:true}));
- try { delete mw.G.doc_list[d.toString()]; } catch(E) { mw.G.doc_list[d.toString()] = false; }
-}
-
-
+++ /dev/null
-sdump('TRACE','Loading xpcom.js\n');
-
-function xp_url_init(aURL) {
- var URLContractID = "@mozilla.org/network/standard-url;1";
- var URLIID = Components.classes[URLContractID].createInstance( );
- var URL = URLIID.QueryInterface(Components.interfaces.nsIURL);
- if (aURL) {
- URL.spec = aURL;
- }
- return URL;
-}
-
-function xp_WebNavigation_init(w) {
- if (!w) { w = this; }
- try {
- var webNavigation = w
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation);
- return webNavigation;
- } catch(E) {
- sdump('TRACE','WEB NAVIGATION EXCEPTION: ' + js2JSON(e) + '\n');
- }
-}
-
+++ /dev/null
-// From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html
-// Modified by Jason for Evergreen to push in the main (auth) window reference
-var old = '';
-var timeout = -1;
-var xwin = null;
-var newwin = false;
-
-function init()
-{
- if(xwin) // for some reason onload gets called when the browser refreshes???
- return;
-
- update();
- document.getElementById('ta').select();
-}
-
-function openwin()
-{
- toggleBrowser(false);
- xwin = window.open('about:blank', 'xulwin', 'chrome,all,resizable=yes,width=400,height=400');
- newwin = true;
- update();
-}
-
-function toggleBrowser(show)
-{
- document.getElementById("split").collapsed = !show;
- document.getElementById("content").collapsed = !show;
- document.getElementById("open").collapsed = !show;
-}
-
-function update()
-{
- var textarea = document.getElementById("ta");
-
- // either this is the first time, or
- // they closed the window
- if(xwin == null || (xwin instanceof Window && xwin.document == null)) {
- toggleBrowser(true);
- xwin = document.getElementById("content");
- newwin = true;
- }
-
- if (old != textarea.value || newwin) {
- old = textarea.value;
- newwin = false;
- var dataURI = "data:application/vnd.mozilla.xul+xml," + encodeURIComponent(old);
- if(xwin instanceof Window)
- xwin.document.location = dataURI;
- else
- xwin.setAttribute("src",dataURI);
- }
- try { xwin.contentWindow.mw = mw; } catch(E) {}
- try { xwin.mw = mw; } catch(E) {}
-
- timeout = window.setTimeout(update, 500);
-}
-
-function resetTimeout()
-{
- if(timeout != -1)
- window.clearTimeout(timeout);
-
- timeout = window.setTimeout(update, 500);
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!-- From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html -->
-<!-- Edited by Jason for Evergreen -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window id="xuledit" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Live XUL Editor"
-onload="params.w = window; params.app = 'Xuledit'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
-<script type="application/x-javascript" src="xuledit.js"/>
-<vbox flex="1">
-<textbox id="ta" multiline="true" wrap="true" flex="1" onkeydown="resetTimeout()"
-value='<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Put your XUL here!"/>
</window>'/>
-<splitter id="split"/>
-<iframe id="content" src="about:blank" flex="1"/>
-<hbox><button id="open" label="Open preview in new window" onclick="openwin()"/><spacer flex="1"/></hbox>
-</vbox>
-</window>
+++ /dev/null
-dump('Loading z39_50.js\n');
-
-function z39_50_init() {
- mw.sdump('D_Z39_50','**** TESTING: z39_50.js: z39_50_init(): ' + mw.G.main_test_variable + '\n');
- mw.focus_widget( 't1' );
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/z39_50.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-
-<page id="z39_50_win" orient="vertical" style="overflow: auto;" persist="width height"
- onload="z39_50_init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('z39_50_win\n');</script>
-
- <!-- Initial Overlays for this XUL file -->
- <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_bundle.xul"?>
-
- <!-- Layout to be filled in by overlays and javascript -->
- <vbox id="z39_50_vbox" class="test_class"/>
-
-</page>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-<overlay id="z39_50_bundle"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('z39_50_bundle\n');</script>
-
- <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_overlay.xul"?>
-
- <script src="z39_50.js" />
-
-</overlay>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-<overlay id="z39_50_overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script>dump('z39_50_overlay\n');</script>
-
- <vbox id="z39_50_vbox" flex="1">
- <description id="d1">
- This screen will likely evolve into a federated z39.50 search interface that will allow you to search a range of z39.50 servers using all of the search operators defined by the z39.50 spec. For now, however, you may enter an Ascession ID to pull an OCLC record into our MARC editor.
- </description>
- <hbox id="z39_50_hbox">
- <label id="l1" value="Ascession ID (or TCN): "/>
- <textbox id="t1" />
- <button id="b1" label="Retrieve" oncommand="
- mw.spawn_oclc_import(parent.document,'replace_tab','main_tabbox', { 'tcn' : document.getElementById('t1').value });
- "/>
- </hbox>
- </vbox>
-
-</overlay>
+++ /dev/null
-bills_interface_label=BILLS
-checkout_interface_label=CHECK OUT
-checkin_interface_label=CHECK IN
-hold_capture_interface_label=HOLD CAPTURE
-copies_editor_interface_label=COPIES EDIT
-copy_browser_interface_label=COPIES
-display_patron_interface_label=DISPLAY PATRON
-items_out_interface_label=ITEMS OUT
-marc_editor_interface_label=MARC
-opac_navigator_interface_label=CATALOG NAVIGATOR
-patron_barcode_entry_interface_label=PATRON
-patron_display_interface_label=PATRON
-patron_editor_interface_label=PATRON EDIT
-patron_search_interface_label=PATRON SEARCH
-patron_register_interface_label=NEW PATRON
-patron_interface_label=PATRON
-receipt_template_editor_interface_label=RECEIPTS
-survey_admin_interface_label=SURVEY ADMIN
-copy_stat_cat_editor_interface_label=COPY STAT-CATS
-patron_stat_cat_editor_interface_label=PATRON STAT-CATS
-z39_50_import_interface_label=Z39.50 IMPORT
-javascript_console_label=CONSOLE
-javascript_shell_label=JS SHELL
-xuleditor_label=XUL TEST
-filter_console_label=FCONSOLE
-fieldmapper_label=FIELDMAPPER
-
-retrieving.record=Retrieving...
-circ.context_cancel_hold=Cancel Hold
-circ.context_checkin=Check In
-circ.context_renew=Renew
-circ.context_opac=Show Title in OPAC
-circ.context_edit=Edit Copy
-circ.context_lost=Mark as Lost
-circ.context_missing=Mark as Missing
-patron.context_display=Retrieve Patron
-
-checkin_label_status=Status
-checkin_label_route_to=Route To
-checkin_label_text=Message
-
-au_label_active=Active
-au_label_id=Record ID
-au_label_prefix=Prefix
-au_label_family_name=Family Name
-au_label_first_given_name=First Name
-au_label_second_given_name=Middle Name
-au_label_suffix=Suffix
-
-acp_label_id=Copy ID
-acp_label_barcode=Barcode
-acp_label_call_number=Call Number
-acp_label_copy_number=Copy Number
-acp_label_status=Status
-acp_label_location=Location
-acp_label_loan_duration=Loan Duration
-acp_label_circ_lib=Circ Lib
-acp_label_fine_level=Fine Level
-acp_label_deposit=Deposit
-acp_label_deposit_amount=Deposit Amount
-acp_label_price=Price
-acp_label_circ_as_type=Circ As Type
-acp_label_circ_modifier=Circ Modifier
-circ_label_xact_start=Checkout Date
-circ_label_xact_finish=Checkin Date
-circ_label_renewal_remaining=Remaining Renewals
-circ_label_due_date=Due Date
-circ_label_id=Circ Id
-mvr_label_doc_id=Doc Id
-mvr_label_title=Title
-mvr_label_author=Author
-
-holds_status_waiting_for_copy=Waiting for available copy
-holds_status_waiting_for_capture=Copy found, waiting for capture
-holds_status_in_transit=In Transit
-holds_status_available=Available
-
-ahr_status_label=Status
-ahr_capture_time_label=Capture Time
-ahr_current_copy_label=Current Copy
-ahr_email_notify_label=Email Notify
-ahr_expire_time_label=Expire Time
-ahr_fulfillment_time_label=Fulfillment Time
-ahr_hold_type_label=Type
-ahr_holdable_formats_label=Holdable Formats
-ahr_id_label=Hold Id
-ahr_ischanged_label=Ischanged
-ahr_isdeleted_label=Isdeleted
-ahr_isnew_label=Isnew
-ahr_phone_notify_label=Phone Notify
-ahr_pickup_lib_label=Pickup Lib
-ahr_prev_check_time_label=Prev Check Time
-ahr_request_time_label=Request Time
-ahr_requestor_label=Requestor
-ahr_selection_depth_label=Selection Depth
-ahr_target_label=Target
-ahr_usr_label=Usr
-
-bills_wizard_label=Bill Patron
-bills_total_owed_label=Total Owed
-bills_current_payment_label=Current Payment
-
-bills_xact_dates_label=Record / Dates
-bills_money_label=Money
-
-mbts_balance_owed_label=Balance Owed
-mbts_id_label=Bill #
-mbts_total_owed_label=Total Billed
-mbts_total_paid_label=Total Paid
-mbts_xact_finish_label=Finish
-mbts_xact_start_label=Start
-bills_information=Information
-
-au_active_label=Active
-au_addresses_label=Addresses
-au_alert_message_label=Alert Message
-au_billing_address_label=Billing Address
-au_card_label=Card
-au_cards_label=Cards
-au_checkouts_label=Checkouts
-au_claims_returned_count_label=Claims Returned Count
-au_create_date_label=Create Date
-au_credit_forward_balance_label=Credit Forward Balance
-au_day_phone_label=Day Phone
-au_dob_label=Dob
-au_email_label=Email
-au_evening_phone_label=Evening Phone
-au_expire_date_label=Expire Date
-au_family_name_label=Family Name
-au_first_given_name_label=First Given Name
-au_hold_requests_label=Hold Requests
-au_home_ou_label=Home Ou
-au_id_label=User Id
-au_ident_type_label=Ident Type
-au_ident_type2_label=Ident Type2
-au_ident_value_label=Ident Value
-au_ident_value2_label=Ident Value2
-au_ischanged_label=Ischanged
-au_isdeleted_label=Isdeleted
-au_isnew_label=Isnew
-au_last_xact_id_label=Last Xact Id
-au_mailing_address_label=Mailing Address
-au_master_account_label=Master Account
-au_net_access_level_label=Net Access Level
-au_other_phone_label=Other Phone
-au_passwd_label=Passwd
-au_password_label=Password
-au_photo_url_label=Photo Url
-au_prefix_label=Prefix
-au_profile_label=Profile
-au_second_given_name_label=Second Given Name
-au_settings_label=Settings
-au_standing_label=Standing
-au_stat_cat_entries_label=Stat Cat Entries
-au_suffix_label=Suffix
-au_super_user_label=Super User
-au_survey_responses_label=Survey Responses
-au_usrgroup_label=Usrgroup
-au_usrname_label=Usrname
-
+++ /dev/null
-<!ENTITY main.menu.title "Evergreen Staff Client">
-
-<!-- The Main Menubar -->
-<!ENTITY main.menu.file.label "File"><!ENTITY main.menu.file.key "F">
-<!ENTITY main.menu.edit.label "Edit"><!ENTITY main.menu.edit.key "E">
-<!ENTITY main.menu.circ.label "Circulation"><!ENTITY main.menu.circ.key "C">
-<!ENTITY main.menu.cat.label "Cataloging"><!ENTITY main.menu.cat.key "a">
-<!ENTITY main.menu.serials.label "Serials"><!ENTITY main.menu.serials.key "l">
-<!ENTITY main.menu.acquisitions.label "Acquisitions"><!ENTITY main.menu.acquisitions.key "q">
-<!ENTITY main.menu.search.label "Search"><!ENTITY main.menu.search.key "r">
-<!ENTITY main.menu.reports.label "Reports"><!ENTITY main.menu.reports.key "">
-<!ENTITY main.menu.help.label "Help"><!ENTITY main.menu.help.key "H">
-<!ENTITY main.menu.admin.label "Admin"><!ENTITY main.menu.admin.key "i">
-
-<!-- The File menu on the Main Menubar -->
-<!ENTITY main.menu.file.new.label "New Window"><!ENTITY main.menu.file.new.key "N">
-<!ENTITY main.menu.file.new_tab.label "New Tab"><!ENTITY main.menu.file.new_tab.key "T">
-<!ENTITY main.menu.file.open.label "Open Session"><!ENTITY main.menu.file.open.key "O">
-<!ENTITY main.menu.file.save.label "Save Session"><!ENTITY main.menu.file.save.key "S">
-<!ENTITY main.menu.file.close_tab.label "Close Tab"><!ENTITY main.menu.file.close_tab.key "">
-<!ENTITY main.menu.file.close.label "Close Window"><!ENTITY main.menu.file.close.key "C">
-
-<!-- The Edit menu on the Main Menubar -->
-<!ENTITY main.menu.edit.undo.label "Undo"><!ENTITY main.menu.edit.undo.key "U">
-<!ENTITY main.menu.edit.redo.label "Redo"><!ENTITY main.menu.edit.redo.key "R">
-<!ENTITY main.menu.edit.cut.label "Cut"><!ENTITY main.menu.edit.cut.key "t">
-<!ENTITY main.menu.edit.copy.label "Copy"><!ENTITY main.menu.edit.copy.key "C">
-<!ENTITY main.menu.edit.paste.label "Paste"><!ENTITY main.menu.edit.paste.key "P">
-<!ENTITY main.menu.edit.delete.label "Delete"><!ENTITY main.menu.edit.delete.key "D">
-<!ENTITY main.menu.edit.select_all.label "Select All"><!ENTITY main.menu.edit.select_all.key "A">
-<!ENTITY main.menu.edit.find.label "Find"><!ENTITY main.menu.edit.find.key "F">
-<!ENTITY main.menu.edit.find_again.label "Find Again"><!ENTITY main.menu.edit.find_again.key "g">
-<!ENTITY main.menu.edit.buckets.label "Manage Buckets"><!ENTITY main.menu.edit.buckets.key "B">
-
-<!-- The Circulation menu on the Main Menubar -->
-<!ENTITY main.menu.circ.checkout.label "Check Out"><!ENTITY main.menu.circ.checkout.key "O">
-<!ENTITY main.menu.circ.checkin.label "Check In"><!ENTITY main.menu.circ.checkin.key "C">
-<!ENTITY main.menu.circ.hold_capture.label "Capture Holds"><!ENTITY main.menu.circ.hold_capture.key "H">
-<!ENTITY main.menu.circ.renew.label "Renew"><!ENTITY main.menu.circ.renew.key "n">
-<!ENTITY main.menu.circ.mark_used.label "Mark Used"><!ENTITY main.menu.circ.mark_used.key "U">
-<!ENTITY main.menu.circ.copy_status.label "Display Item"><!ENTITY main.menu.circ.copy_status.key "I">
-<!ENTITY main.menu.circ.patron_status.label "Display Patron"><!ENTITY main.menu.circ.patron_status.key "P">
-<!ENTITY main.menu.circ.patron_registration.label "Register Patron"><!ENTITY main.menu.circ.patron_registration.key "R">
-<!ENTITY main.menu.circ.place_hold.label "Place Hold"><!ENTITY main.menu.circ.place_hold.key "H">
-
-<!-- The Special Circulation submenu in the Circulation Menu -->
-<!ENTITY main.menu.circ.special.label "Special Circulation"><!ENTITY main.menu.circ.special.key "S">
-<!ENTITY main.menu.circ.lost.label "Mark Lost"><!ENTITY main.menu.circ.lost.key "L">
-<!ENTITY main.menu.circ.missing.label "Mark Missing"><!ENTITY main.menu.circ.missing.key "M">
-<!ENTITY main.menu.circ.found.label "Mark Found"><!ENTITY main.menu.circ.found.key "F">
-<!ENTITY main.menu.circ.quick_add.label "Quick Add"><!ENTITY main.menu.circ.quick_add.key "Q">
-<!ENTITY main.menu.circ.claimed_returned.label 'Mark as "Claimed Returned"'><!ENTITY main.menu.circ.claimed_returned.key "C">
-
-<!-- The Cataloging menu on the Main Menubar -->
-<!ENTITY main.menu.cat.add_copy.label "Add Item"><!ENTITY main.menu.cat.add_copy.key "I">
-<!ENTITY main.menu.cat.add_volume.label "Add Volume"><!ENTITY main.menu.cat.add_volume.key "V">
-<!ENTITY main.menu.cat.add_bib.label "Add Bib Record"><!ENTITY main.menu.cat.add_bib.key "B">
-<!ENTITY main.menu.cat.copy_status.label "Display Item"><!ENTITY main.menu.cat.copy_status.key "I">
-<!ENTITY main.menu.cat.volume_status.label "Display Volume"><!ENTITY main.menu.cat.volume_status.key "V">
-<!ENTITY main.menu.cat.bib_status.label "Display Bib Record"><!ENTITY main.menu.cat.bib_status.key "B">
-<!ENTITY main.menu.cat.bib_search.label "Search Catalog"><!ENTITY main.menu.cat.bib_search.key "S">
-<!ENTITY main.menu.cat.dedup.label "Merge/Transfer Interface"><!ENTITY main.menu.cat.dedup.key "M">
-
-<!-- The Entity Menubar -->
-<!ENTITY main.menu.entity.patron.label "Patrons"><!ENTITY main.menu.entity.patron.key "">
-<!ENTITY main.menu.entity.copy.label "Items"><!ENTITY main.menu.entity.copy.key "">
-<!ENTITY main.menu.entity.volume.label "Volumes"><!ENTITY main.menu.entity.volume.key "">
-<!ENTITY main.menu.entity.bib.label "Bib Records"><!ENTITY main.menu.entity.bib.key "">
-
-<!-- The Patron menu on the Entity Menubar -->
-<!-- Re-use main.menu.copy.patron_registration for menuitem label -->
-<!ENTITY main.menu.entity.patron.register.key "R">
-
+++ /dev/null
-<!ENTITY auth.title "Evergreen Staff Client ">
-<!ENTITY auth.version "Evergreen 0.1.0 2005072719">
-
-<!ENTITY auth.login_header "Login">
-<!ENTITY auth.name_prompt "Name:"><!ENTITY auth.name_prompt.key "N">
-<!ENTITY auth.password_prompt "Password:"><!ENTITY auth.password_prompt.key "P">
-<!ENTITY auth.submit_prompt "Submit"><!ENTITY auth.submit_prompt.key "S">
-<!ENTITY auth.logoff_prompt "Log Off"><!ENTITY auth.logoff_prompt.key "L">
-<!ENTITY auth.quit_prompt "Exit Evergreen"><!ENTITY auth.quit_prompt.key "x">
-
-<!ENTITY about.title "About">
-
+++ /dev/null
-<!ENTITY cat.title "TCN goes here">
-<!ENTITY copy.title "Barcode goes here">
-<!ENTITY record_list.win_title "Cataloging">
-<!ENTITY browse_list.win_title "Cataloging">
-
-<!ENTITY cat.popup.edit_record.window "Edit Record (Window)"> <!ENTITY cat.popup.edit.record.window.key "">
-<!ENTITY cat.popup.edit_record.tab "Edit Record (Tab)"> <!ENTITY cat.popup.edit.record.tab.key "">
-<!ENTITY cat.popup.browse_record.window "View Copies (Window)"> <!ENTITY cat.popup.browse.record.window.key "">
-<!ENTITY cat.popup.browse_record.tab "View Copies (Tab)"> <!ENTITY cat.popup.browse.record.tab.key "">
-<!ENTITY cat.popup.add_to_bucket "Add to Bucket"> <!ENTITY cat.popup.add_to_bucket.key "">
-
-
-
-<!ENTITY cat.test "Test"> <!ENTITY cat.test.key "E">
-<!ENTITY cat.search_submit "Search"> <!ENTITY cat.search_submit.key "S">
-<!ENTITY cat.search_advanced "Advanced"> <!ENTITY cat.search_advanced.key "V">
-<!ENTITY cat.search_type "Type"> <!ENTITY cat.search_type.key "T">
-<!ENTITY cat.search_location "Location"> <!ENTITY cat.search_location.key "L">
-<!ENTITY cat.search_format "Format"> <!ENTITY cat.search_format.key "F">
-<!ENTITY cat.search_order "Order"> <!ENTITY cat.search_order.key "O">
-<!ENTITY cat.search_term "Terms"> <!ENTITY cat.search_term.key "e">
-<!ENTITY cat.search_criteria "Search Criteria">
-<!ENTITY cat.search_count_copy "Location"> <!ENTITY cat.search_count_copy.key "L">
-<!ENTITY cat.search_count_copy_show "Show Only These Records">
-
-<!ENTITY cat.search_tcn "TCN">
-<!ENTITY cat.search_isbn "ISBN/ISSN">
-<!ENTITY cat.search_barcode "Item Barcode">
-<!ENTITY cat.search_title "Title">
-<!ENTITY cat.search_author "Author">
-<!ENTITY cat.search_subject "Subject">
-<!ENTITY cat.search_callnumber "Call Number">
-<!ENTITY cat.search_id "System ID">
-<!ENTITY cat.search_all "Keyword">
-
-<!ENTITY cat.search_pubyear "Pub Year">
-
-<!ENTITY cat.type_of_material "All">
-<!ENTITY cat.type_of_material.a "Language Material">
-<!ENTITY cat.type_of_material.c "Notated Music">
-<!ENTITY cat.type_of_material.d "Manuscript Notated Music">
-<!ENTITY cat.type_of_material.e "Cartographic Material">
-<!ENTITY cat.type_of_material.f "Manuscript Cartographic Material">
-<!ENTITY cat.type_of_material.g "Projected Medium">
-<!ENTITY cat.type_of_material.i "Nonmusical Sound Recording">
-<!ENTITY cat.type_of_material.j "Musical Sound Recording">
-<!ENTITY cat.type_of_material.k "Two-dimensional Nonprojectable Graphic">
-<!ENTITY cat.type_of_material.m "Computer File">
-<!ENTITY cat.type_of_material.o "Kit">
-<!ENTITY cat.type_of_material.p "Mixed Material">
-<!ENTITY cat.type_of_material.r "Three-dimensional Artifact or Naturally Occuring Object">
-<!ENTITY cat.type_of_material.t "Manuscript Language Material">
-
-<!ENTITY cat.fixed.BKS "BKS"> <!ENTITY cat.fixed.BKS.key "B">
-<!ENTITY cat.fixed.SER "SER"> <!ENTITY cat.fixed.SER.key "S">
-<!ENTITY cat.fixed.VIS "VIS"> <!ENTITY cat.fixed.VIS.key "V">
-<!ENTITY cat.fixed.MIX "MIX"> <!ENTITY cat.fixed.MIX.key "M">
-<!ENTITY cat.fixed.MAP "MAP"> <!ENTITY cat.fixed.MAP.key "P">
-<!ENTITY cat.fixed.SCO "SCO"> <!ENTITY cat.fixed.SCO.key "C">
-<!ENTITY cat.fixed.REC "REC"> <!ENTITY cat.fixed.REC.key "R">
-<!ENTITY cat.fixed.COM "COM"> <!ENTITY cat.fixed.COM.key "O">
-
-<!ENTITY record_list.tcn "TCN">
-<!ENTITY record_list.isbn "ISBN">
-<!ENTITY record_list.issn "ISSN">
-<!ENTITY record_list.title "Title">
-<!ENTITY record_list.author "Author">
-<!ENTITY record_list.publisher "Publisher">
-<!ENTITY record_list.pubyear "Pub Year">
-<!ENTITY record_list.copy_count "Copiesˤ">
-
-<!ENTITY browse_list.location "Location/Barcode">
-<!ENTITY browse_list.library "Owning Lib">
-<!ENTITY browse_list.callnumber "Call Number">
-<!ENTITY browse_list.barcode "Barcode">
-<!ENTITY browse_list.shelving_loc "Shelving Location">
-<!ENTITY browse_list.status "Status">
-
-<!ENTITY browse_list.circ_as_type "Circulate As">
-<!ENTITY browse_list.circ_lib "Circulating Lib">
-<!ENTITY browse_list.circ_modifier "Circ Modifier">
-<!ENTITY browse_list.circulate "Circulate">
-<!ENTITY browse_list.copy_number "Copy Number">
-<!ENTITY browse_list.create_date "Creation Date">
-<!ENTITY browse_list.creator "Creator">
-<!ENTITY browse_list.deposit "Deposit">
-<!ENTITY browse_list.deposit_amount "Deposit Amount">
-<!ENTITY browse_list.edit_date "Edit Date">
-<!ENTITY browse_list.editor "Editor">
-<!ENTITY browse_list.fine_level "Fine Level">
-<!ENTITY browse_list.loan_duration "Loan Duration">
-<!ENTITY browse_list.location2 "Location">
-<!ENTITY browse_list.opac_visible "OPAC">
-<!ENTITY browse_list.price "Price">
-<!ENTITY browse_list.ref "Reference">
-
-
-<!ENTITY marc.close.editor.key "W">
-
-
-<!ENTITY marc.groupbox.cover "Cover Art">
-<!ENTITY marc.groupbox.meta "Meta Data (NOT YET IMPLEMENTED)">
-<!ENTITY marc.groupbox.fixed "Fixed Fields">
-<!ENTITY marc.groupbox.data "Data Fields">
-<!ENTITY marc.groupbox.control "Control Fields">
-
-<!ENTITY marc.file "MARC"> <!ENTITY marc.file.key "M">
-<!ENTITY marc.file.reload "Reload"> <!ENTITY marc.file.reload.key "R">
-<!ENTITY marc.file.validate "Validate"> <!ENTITY marc.file.validate.key "V">
-<!ENTITY marc.file.export "Export"> <!ENTITY marc.file.export.key "E">
-<!ENTITY marc.file.publish "Save (to DB)"> <!ENTITY marc.file.publish.key "S">
-<!ENTITY marc.file.close "Close Editor"> <!ENTITY marc.file.close.key "C">
-
-<!ENTITY marc.display "Display"> <!ENTITY marc.display.key "D">
-<!ENTITY marc.display.explain "Explain Errors"> <!ENTITY marc.display.explain.key "X">
-<!ENTITY marc.display.legend "Legend"> <!ENTITY marc.display.legend.key "L">
-<!ENTITY marc.display.cover_art "Toggle Cover Art"> <!ENTITY marc.display.cover_art.key "A">
-<!ENTITY marc.display.meta_data "Toggle Meta Data"> <!ENTITY marc.display.meta_data.key "E">
-<!ENTITY marc.display.control_fields "Toggle Control/Data Fields"> <!ENTITY marc.display.control_fields.key "F">
-<!ENTITY marc.display.fixed.BKS "Fixed Fields as BKS"> <!ENTITY marc.display.fixed.BKS.key "B">
-<!ENTITY marc.display.fixed.SER "Fixed Fields as SER"> <!ENTITY marc.display.fixed.SER.key "S">
-<!ENTITY marc.display.fixed.VIS "Fixed Fields as VIS"> <!ENTITY marc.display.fixed.VIS.key "V">
-<!ENTITY marc.display.fixed.MIX "Fixed Fields as MIX"> <!ENTITY marc.display.fixed.MIX.key "M">
-<!ENTITY marc.display.fixed.MAP "Fixed Fields as MAP"> <!ENTITY marc.display.fixed.MAP.key "P">
-<!ENTITY marc.display.fixed.SCO "Fixed Fields as SCO"> <!ENTITY marc.display.fixed.SCO.key "C">
-<!ENTITY marc.display.fixed.REC "Fixed Fields as REC"> <!ENTITY marc.display.fixed.REC.key "R">
-<!ENTITY marc.display.fixed.COM "Fixed Fields as COM"> <!ENTITY marc.display.fixed.COM.key "O">
-
-<!ENTITY marc.editor.keys.help "Control+D = Delimiter Symbol ; Control+Enter = Insert Row ; Control+Delete = Delete Row;">
-
-
-<!ENTITY marc.008.entered.short "Entered">
-<!ENTITY marc.008.entered.desc "Date Entered">
-<!ENTITY marc.008.entered.field "008">
-<!ENTITY marc.008.entered.field_start_pos "0">
-<!ENTITY marc.008.entered.field_end_pos "5">
-<!ENTITY marc.008.entered.field_size "6">
-<!ENTITY marc.008.entered.help "http://www.oclc.org/bibformats/en/fixedfield/entered.shtm">
-
-<!ENTITY marc.008.dtst.short "DtSt">
-<!ENTITY marc.008.dtst.desc "Type of Date/Publication Status">
-<!ENTITY marc.008.dtst.field "008">
-<!ENTITY marc.008.dtst.field_start_pos "6">
-<!ENTITY marc.008.dtst.field_end_pos "6">
-<!ENTITY marc.008.dtst.field_size "1">
-<!ENTITY marc.008.dtst.help "http://www.oclc.org/bibformats/en/fixedfield/dtst.shtm">
-
-<!ENTITY marc.008.dates "Dates">
-<!ENTITY marc.008.dates.help "http://www.oclc.org/bibformats/en/fixedfield/dates.shtm">
-
-<!ENTITY marc.008.date1.short "Date 1">
-<!ENTITY marc.008.date1.desc "Date 1">
-<!ENTITY marc.008.date1.field "008">
-<!ENTITY marc.008.date1.field_start_pos "7">
-<!ENTITY marc.008.date1.field_end_pos "10">
-<!ENTITY marc.008.date1.field_size "4">
-
-<!ENTITY marc.008.date2.short "Date 2">
-<!ENTITY marc.008.date2.desc "Date 2">
-<!ENTITY marc.008.date2.field "008">
-<!ENTITY marc.008.date2.field_start_pos "11">
-<!ENTITY marc.008.date2.field_end_pos "14">
-<!ENTITY marc.008.date2.field_size "4">
-
-<!ENTITY marc.008.ctry.short "Ctry">
-<!ENTITY marc.008.ctry.desc "Country of Publication, etc.">
-<!ENTITY marc.008.ctry.field "008">
-<!ENTITY marc.008.ctry.field_start_pos "15">
-<!ENTITY marc.008.ctry.field_end_pos "17">
-<!ENTITY marc.008.ctry.field_size "3">
-<!ENTITY marc.008.ctry.help "http://www.oclc.org/bibformats/en/fixedfield/ctry.shtm">
-
-<!ENTITY marc.008.lang.short "Lang">
-<!ENTITY marc.008.lang.desc "Language Code">
-<!ENTITY marc.008.lang.field "008">
-<!ENTITY marc.008.lang.field_start_pos "35">
-<!ENTITY marc.008.lang.field_end_pos "37">
-<!ENTITY marc.008.lang.field_size "3">
-<!ENTITY marc.008.lang.help "http://www.oclc.org/bibformats/en/fixedfield/lang.shtm">
-
-<!ENTITY marc.008.mrec.short "MRec">
-<!ENTITY marc.008.mrec.desc "Modified Record">
-<!ENTITY marc.008.mrec.field "008">
-<!ENTITY marc.008.mrec.field_start_pos "38">
-<!ENTITY marc.008.mrec.field_end_pos "38">
-<!ENTITY marc.008.mrec.field_size "1">
-<!ENTITY marc.008.mrec.help "http://www.oclc.org/bibformats/en/fixedfield/mrec.shtm">
-
-<!ENTITY marc.008.srce.short "Srce">
-<!ENTITY marc.008.srce.desc "Cataloging Source">
-<!ENTITY marc.008.srce.field "008">
-<!ENTITY marc.008.srce.field_start_pos "39">
-<!ENTITY marc.008.srce.field_end_pos "39">
-<!ENTITY marc.008.srce.field_size "1">
-<!ENTITY marc.008.srce.help "http://www.oclc.org/bibformats/en/fixedfield/srce.shtm">
-
-<!ENTITY marc.LDR.rec_stat.short "Rec stat">
-<!ENTITY marc.LDR.rec_stat.desc "Record Status">
-<!ENTITY marc.LDR.rec_stat.field "LDR">
-<!ENTITY marc.LDR.rec_stat.field_start_pos "5">
-<!ENTITY marc.LDR.rec_stat.field_end_pos "5">
-<!ENTITY marc.LDR.rec_stat.field_size "1">
-<!ENTITY marc.LDR.rec_stat.help "http://www.oclc.org/bibformats/en/fixedfield/rec.shtm">
-
-<!ENTITY marc.LDR.type.short "Type">
-<!ENTITY marc.LDR.type.desc "Type of Record">
-<!ENTITY marc.LDR.type.field "LDR">
-<!ENTITY marc.LDR.type.field_start_pos "6">
-<!ENTITY marc.LDR.type.field_end_pos "6">
-<!ENTITY marc.LDR.type.field_size "1">
-<!ENTITY marc.LDR.type.help "http://www.oclc.org/bibformats/en/fixedfield/type.shtm">
-
-<!ENTITY marc.LDR.blvl.short "BLvl">
-<!ENTITY marc.LDR.blvl.desc "Bibliographic Level">
-<!ENTITY marc.LDR.blvl.field "LDR">
-<!ENTITY marc.LDR.blvl.field_start_pos "7">
-<!ENTITY marc.LDR.blvl.field_end_pos "7">
-<!ENTITY marc.LDR.blvl.field_size "1">
-<!ENTITY marc.LDR.blvl.help "http://www.oclc.org/bibformats/en/fixedfield/blvl.shtm">
-
-<!ENTITY marc.LDR.ctrl.short "Ctrl">
-<!ENTITY marc.LDR.ctrl.desc "Type of Control">
-<!ENTITY marc.LDR.ctrl.field "LDR">
-<!ENTITY marc.LDR.ctrl.field_start_pos "8">
-<!ENTITY marc.LDR.ctrl.field_end_pos "8">
-<!ENTITY marc.LDR.ctrl.field_size "1">
-<!ENTITY marc.LDR.ctrl.help "http://www.oclc.org/bibformats/en/fixedfield/ctrl.shtm">
-
-<!ENTITY marc.LDR.elvl.short "ELvl">
-<!ENTITY marc.LDR.elvl.desc "Encoding Level">
-<!ENTITY marc.LDR.elvl.field "LDR">
-<!ENTITY marc.LDR.elvl.field_start_pos "17">
-<!ENTITY marc.LDR.elvl.field_end_pos "17">
-<!ENTITY marc.LDR.elvl.field_size "1">
-<!ENTITY marc.LDR.elvl.help "http://www.oclc.org/bibformats/en/fixedfield/elvl.shtm">
-
-<!ENTITY marc.LDR.desc.short "Desc">
-<!ENTITY marc.LDR.desc.desc "Descriptive Cataloging Form">
-<!ENTITY marc.LDR.desc.field "LDR">
-<!ENTITY marc.LDR.desc.field_start_pos "18">
-<!ENTITY marc.LDR.desc.field_end_pos "18">
-<!ENTITY marc.LDR.desc.field_size "1">
-<!ENTITY marc.LDR.desc.help "http://www.oclc.org/bibformats/en/fixedfield/desc.shtm">
-
-<!ENTITY marc.008.BKS.ills.short "Ills">
-<!ENTITY marc.008.BKS.ills.desc "Illustrations">
-<!ENTITY marc.008.BKS.ills.field "008">
-<!ENTITY marc.008.BKS.ills.field_start_pos "18">
-<!ENTITY marc.008.BKS.ills.field_end_pos "21">
-<!ENTITY marc.008.BKS.ills.field_size "4">
-<!ENTITY marc.008.BKS.ills.help "http://www.oclc.org/bibformats/en/fixedfield/ills.shtm">
-
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.short "Audn">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.desc "Target Audience">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field "008">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_start_pos "22">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_end_pos "22">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_size "1">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.help "http://www.oclc.org/bibformats/en/fixedfield/audn.shtm">
-
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.short "Form">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.desc "Form of Item">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field "008">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_start_pos "23">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_end_pos "23">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_size "1">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.help "http://www.oclc.org/bibformats/en/fixedfield/form.shtm">
-
-<!ENTITY marc.008.MAP.VIS.form.short "Form">
-<!ENTITY marc.008.MAP.VIS.form.desc "Form of Item">
-<!ENTITY marc.008.MAP.VIS.form.field "008">
-<!ENTITY marc.008.MAP.VIS.form.field_start_pos "29">
-<!ENTITY marc.008.MAP.VIS.form.field_end_pos "29">
-<!ENTITY marc.008.MAP.VIS.form.field_size "1">
-<!ENTITY marc.008.MAP.VIS.form.help "http://www.oclc.org/bibformats/en/fixedfield/form.shtm">
-
-<!ENTITY marc.008.BKS.cont.short "Cont">
-<!ENTITY marc.008.BKS.cont.desc "Nature of Contents">
-<!ENTITY marc.008.BKS.cont.field "008">
-<!ENTITY marc.008.BKS.cont.field_start_pos "24">
-<!ENTITY marc.008.BKS.cont.field_end_pos "27">
-<!ENTITY marc.008.BKS.cont.field_size "4">
-<!ENTITY marc.008.BKS.cont.help "http://www.oclc.org/bibformats/en/fixedfield/cont.shtm">
-
-<!ENTITY marc.008.SER.cont.short "Cont">
-<!ENTITY marc.008.SER.cont.desc "Nature of Contents">
-<!ENTITY marc.008.SER.cont.field "008">
-<!ENTITY marc.008.SER.cont.field_start_pos "25">
-<!ENTITY marc.008.SER.cont.field_end_pos "27">
-<!ENTITY marc.008.SER.cont.field_size "3">
-<!ENTITY marc.008.SER.cont.help "http://www.oclc.org/bibformats/en/fixedfield/cont.shtm">
-
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.short "GPub">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.desc "Government Publication">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field "008">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos "28">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos "28">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size "1">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.help "http://www.oclc.org/bibformats/en/fixedfield/gpub.shtm">
-
-<!ENTITY marc.008.BKS.SER.conf.short "Conf">
-<!ENTITY marc.008.BKS.SER.conf.desc "Conference Publication">
-<!ENTITY marc.008.BKS.SER.conf.field "008">
-<!ENTITY marc.008.BKS.SER.conf.field_start_pos "29">
-<!ENTITY marc.008.BKS.SER.conf.field_end_pos "29">
-<!ENTITY marc.008.BKS.SER.conf.field_size "1">
-<!ENTITY marc.008.BKS.SER.conf.help "http://www.oclc.org/bibformats/en/fixedfield/conf.shtm">
-
-<!ENTITY marc.008.BKS.fest.short "Fest">
-<!ENTITY marc.008.BKS.fest.desc "Festschrift">
-<!ENTITY marc.008.BKS.fest.field "008">
-<!ENTITY marc.008.BKS.fest.field_start_pos "30">
-<!ENTITY marc.008.BKS.fest.field_end_pos "30">
-<!ENTITY marc.008.BKS.fest.field_size "1">
-<!ENTITY marc.008.BKS.fest.help "http://www.oclc.org/bibformats/en/fixedfield/fest.shtm">
-
-<!ENTITY marc.008.BKS.MAP.indx.short "Indx">
-<!ENTITY marc.008.BKS.MAP.indx.desc "Index">
-<!ENTITY marc.008.BKS.MAP.indx.field "008">
-<!ENTITY marc.008.BKS.MAP.indx.field_start_pos "31">
-<!ENTITY marc.008.BKS.MAP.indx.field_end_pos "31">
-<!ENTITY marc.008.BKS.MAP.indx.field_size "1">
-<!ENTITY marc.008.BKS.MAP.indx.help "http://www.oclc.org/bibformats/en/fixedfield/indx.shtm">
-
-<!ENTITY marc.008.BKS.litf.short "LitF">
-<!ENTITY marc.008.BKS.litf.desc "Literary Form">
-<!ENTITY marc.008.BKS.litf.field "008">
-<!ENTITY marc.008.BKS.litf.field_start_pos "33">
-<!ENTITY marc.008.BKS.litf.field_end_pos "33">
-<!ENTITY marc.008.BKS.litf.field_size "1">
-<!ENTITY marc.008.BKS.litf.help "http://www.oclc.org/bibformats/en/fixedfield/litf.shtm">
-
-<!ENTITY marc.008.BKS.biog.short "Biog">
-<!ENTITY marc.008.BKS.biog.desc "Biography">
-<!ENTITY marc.008.BKS.biog.field "008">
-<!ENTITY marc.008.BKS.biog.field_start_pos "34">
-<!ENTITY marc.008.BKS.biog.field_end_pos "34">
-<!ENTITY marc.008.BKS.biog.field_size "1">
-<!ENTITY marc.008.BKS.biog.help "http://www.oclc.org/bibformats/en/fixedfield/biog.shtm">
-
-<!ENTITY marc.008.SER.freq.short "Freq">
-<!ENTITY marc.008.SER.freq.desc "Frequency">
-<!ENTITY marc.008.SER.freq.field "008">
-<!ENTITY marc.008.SER.freq.field_start_pos "18">
-<!ENTITY marc.008.SER.freq.field_end_pos "18">
-<!ENTITY marc.008.SER.freq.field_size "1">
-<!ENTITY marc.008.SER.freq.help "http://www.oclc.org/bibformats/en/fixedfield/freq.shtm">
-
-<!ENTITY marc.008.SER.regl.short "Regl">
-<!ENTITY marc.008.SER.regl.desc "Regularity">
-<!ENTITY marc.008.SER.regl.field "008">
-<!ENTITY marc.008.SER.regl.field_start_pos "19">
-<!ENTITY marc.008.SER.regl.field_end_pos "19">
-<!ENTITY marc.008.SER.regl.field_size "1">
-<!ENTITY marc.008.SER.regl.help "http://www.oclc.org/bibformats/en/fixedfield/regl.shtm">
-
-<!ENTITY marc.008.SER.issn.short "ISSN">
-<!ENTITY marc.008.SER.issn.desc "ISSN Center">
-<!ENTITY marc.008.SER.issn.field "008">
-<!ENTITY marc.008.SER.issn.field_start_pos "20">
-<!ENTITY marc.008.SER.issn.field_end_pos "20">
-<!ENTITY marc.008.SER.issn.field_size "1">
-<!ENTITY marc.008.SER.issn.help "http://www.oclc.org/bibformats/en/fixedfield/issn.shtm">
-
-<!ENTITY marc.008.SER.srtp.short "SrTp">
-<!ENTITY marc.008.SER.srtp.desc "Type of Continuing Resource">
-<!ENTITY marc.008.SER.srtp.field "008">
-<!ENTITY marc.008.SER.srtp.field_start_pos "21">
-<!ENTITY marc.008.SER.srtp.field_end_pos "21">
-<!ENTITY marc.008.SER.srtp.field_size "1">
-<!ENTITY marc.008.SER.srtp.help "http://www.oclc.org/bibformats/en/fixedfield/srtp.shtm">
-
-<!ENTITY marc.008.SER.orig.short "Orig">
-<!ENTITY marc.008.SER.orig.desc "Form of Original Item">
-<!ENTITY marc.008.SER.orig.field "008">
-<!ENTITY marc.008.SER.orig.field_start_pos "22">
-<!ENTITY marc.008.SER.orig.field_end_pos "22">
-<!ENTITY marc.008.SER.orig.field_size "1">
-<!ENTITY marc.008.SER.orig.help "http://www.oclc.org/bibformats/en/fixedfield/orig.shtm">
-
-<!ENTITY marc.008.SER.entw.short "EntW">
-<!ENTITY marc.008.SER.entw.desc "Nature of Entire Work">
-<!ENTITY marc.008.SER.entw.field "008">
-<!ENTITY marc.008.SER.entw.field_start_pos "24">
-<!ENTITY marc.008.SER.entw.field_end_pos "24">
-<!ENTITY marc.008.SER.entw.field_size "1">
-<!ENTITY marc.008.SER.entw.help "http://www.oclc.org/bibformats/en/fixedfield/entw.shtm">
-
-<!ENTITY marc.008.SER.alph.short "Alph">
-<!ENTITY marc.008.SER.alph.desc "Original Alphabet or Script of Title">
-<!ENTITY marc.008.SER.alph.field "008">
-<!ENTITY marc.008.SER.alph.field_start_pos "33">
-<!ENTITY marc.008.SER.alph.field_end_pos "33">
-<!ENTITY marc.008.SER.alph.field_size "1">
-<!ENTITY marc.008.SER.alph.help "http://www.oclc.org/bibformats/en/fixedfield/alph.shtm">
-
-<!ENTITY marc.008.SER.succ.short "S/L">
-<!ENTITY marc.008.SER.succ.desc "Entry Convention">
-<!ENTITY marc.008.SER.succ.field "008">
-<!ENTITY marc.008.SER.succ.field_start_pos "34">
-<!ENTITY marc.008.SER.succ.field_end_pos "34">
-<!ENTITY marc.008.SER.succ.field_size "1">
-<!ENTITY marc.008.SER.succ.help "http://www.oclc.org/bibformats/en/fixedfield/succ.shtm">
-
-<!ENTITY volume.wizard.title "Batch Add Volumes/Copies Wizard">
-<!ENTITY copy.wizard.title "Batch Add Copies Wizard">
-<!ENTITY volume.wizard.page1 "Entering Volumes">
-<!ENTITY volume.wizard.page2 "Entering Copies">
-<!ENTITY volume.wizard.page3 "Entering Barcodes">
-<!ENTITY volume.wizard.page4 "Entering Copy-Level Attribute Defaults">
-
-
-<!ENTITY copy.pines.attr "PINES Attributes"> <!ENTITY copy.pines.attr.value "Value">
-<!ENTITY copy.local.attr "Local Attributes"> <!ENTITY copy.local.attr.value "Value">
-<!ENTITY copy.default.attr "Default Attributes"> <!ENTITY copy.default.attr.value "Value">
-
-<!ENTITY copy.close "Close Window"><!ENTITY copy.close.key "C">
-<!ENTITY copy.bucket "Add to Bucket"><!ENTITY copy.bucket.key "B">
-<!ENTITY copy.reload "Reload Copy"> <!ENTITY copy.reload.key "R">
-<!ENTITY copy.save "Save Copy"> <!ENTITY copy.save.key "S">
-<!ENTITY copy.delete "Delete Copy"> <!ENTITY copy.delete.key "">
-<!ENTITY copy.clone "Clone Copy"> <!ENTITY copy.clone.key "">
-<!ENTITY copy.transfer "Transfer Copy"> <!ENTITY copy.transfer.key "">
-
-<!ENTITY copy.notes "Note">
-<!ENTITY copy.notes.from "From">
-<!ENTITY copy.notes.date "Date">
-<!ENTITY copy.notes.opac "OPAC">
-<!ENTITY copy.notes.add "Add Note"> <!ENTITY copy.notes.add.key "A">
-<!ENTITY copy.notes.delete "Delete Note"> <!ENTITY copy.notes.delete.key "D">
-<!ENTITY copy.edit_entries "Edit Entries">
-<!ENTITY copy.edit_categories "Edit Categories">
-
-<!ENTITY volume.attr.owning_lib "Owning Library">
-<!ENTITY volume.attr.callnumber "Call Number">
-
-<!ENTITY copy.attr.stat.genre "Genre">
- <!ENTITY copy.attr.stat.genre.example1 "Adventure">
- <!ENTITY copy.attr.stat.genre.example2 "Fantasy">
- <!ENTITY copy.attr.stat.genre.example3 "Historical">
- <!ENTITY copy.attr.stat.genre.example4 "Holiday">
- <!ENTITY copy.attr.stat.genre.example5 "Horror">
- <!ENTITY copy.attr.stat.genre.example6 "Humor">
- <!ENTITY copy.attr.stat.genre.example7 "Mystery">
- <!ENTITY copy.attr.stat.genre.example8 "Romance">
- <!ENTITY copy.attr.stat.genre.example9 "Sci-fi">
- <!ENTITY copy.attr.stat.genre.example10 "Spy">
- <!ENTITY copy.attr.stat.genre.example11 "Thriller">
- <!ENTITY copy.attr.stat.genre.example12 "War">
- <!ENTITY copy.attr.stat.genre.example13 "Western">
- <!ENTITY copy.attr.stat.genre.example14 "Religious fiction">
- <!ENTITY copy.attr.stat.genre.example15 "Shortstory">
- <!ENTITY copy.attr.stat.genre.example16 "Biography">
- <!ENTITY copy.attr.stat.genre.example17 "Holiday">
- <!ENTITY copy.attr.stat.genre.example18 "Nonfiction">
-<!ENTITY copy.attr.stat.audience "Audience">
- <!ENTITY copy.attr.stat.audience.example1 "Adult">
- <!ENTITY copy.attr.stat.audience.example2 "Juvenile">
- <!ENTITY copy.attr.stat.audience.example3 "Preschool">
- <!ENTITY copy.attr.stat.audience.example4 "Primary">
- <!ENTITY copy.attr.stat.audience.example5 "Pre-adolescent">
- <!ENTITY copy.attr.stat.audience.example6 "Young adult">
- <!ENTITY copy.attr.stat.audience.example7 "General">
-<!ENTITY copy.attr.loan_duration "Loan Duration">
- <!ENTITY copy.attr.loan_duration.long "Long">
- <!ENTITY copy.attr.loan_duration.normal "Normal">
- <!ENTITY copy.attr.loan_duration.short "Short">
-<!ENTITY copy.attr.fine_level "Fine Level">
- <!ENTITY copy.attr.fine_level.high "High">
- <!ENTITY copy.attr.fine_level.normal "Normal">
- <!ENTITY copy.attr.fine_level.low "Low">
-<!ENTITY copy.attr.notes "Copy Notes">
- <!ENTITY copy.attr.notes_viewable "Copy Notes Patron Viewable?">
- <!ENTITY copy.attr.notes_viewable.example1 "Yes">
- <!ENTITY copy.attr.notes_viewable.example2 "No">
-<!ENTITY copy.attr.circulate "Circulate?">
- <!ENTITY copy.attr.circulate.yes "Yes">
- <!ENTITY copy.attr.circulate.no "No">
-<!ENTITY copy.attr.deposit "Deposit?">
- <!ENTITY copy.attr.deposit.yes "Yes">
- <!ENTITY copy.attr.deposit.no "No">
- <!ENTITY copy.attr.deposit_notes "Deposit Notes">
- <!ENTITY copy.attr.deposit_amount "Amount">
-<!ENTITY copy.attr.reference_material "Reference Material?">
- <!ENTITY copy.attr.reference_material.yes "Yes">
- <!ENTITY copy.attr.reference_material.no "No">
-<!ENTITY copy.attr.opac_visible "OPAC Visible?">
- <!ENTITY copy.attr.opac_visible.yes "Yes">
- <!ENTITY copy.attr.opac_visible.no "No">
-<!ENTITY copy.attr.copy_available "Copy Status: Available?">
-<!ENTITY copy.attr.copy_status "Copy Status">
-<!ENTITY copy.attr.circulating_lib "Circulating Library">
-<!ENTITY copy.attr.home_lib "Home Library">
-<!ENTITY copy.attr.shelving_location "Shelving Location">
- <!ENTITY copy.attr.shelving_location.example1 "Stacks">
- <!ENTITY copy.attr.shelving_location.example2 "Audio-Visual">
- <!ENTITY copy.attr.shelving_location.example3 "Children's Room">
- <!ENTITY copy.attr.shelving_location.example4 "Garden Room">
- <!ENTITY copy.attr.shelving_location.example5 "Reference">
- <!ENTITY copy.attr.shelving_location.example6 "Ready Reference">
- <!ENTITY copy.attr.shelving_location.example7 "Behind Circulation Desk">
- <!ENTITY copy.attr.shelving_location.example8 "Display">
- <!ENTITY copy.attr.shelving_location.example9 "Health">
- <!ENTITY copy.attr.shelving_location.example10 "Paperback">
-<!ENTITY copy.attr.holds_protection "Holds Protection">
- <!ENTITY copy.attr.holds_protection.example1 "3 months (facility)">
- <!ENTITY copy.attr.holds_protection.example2 "6 months (region)">
- <!ENTITY copy.attr.holds_protection.example3 "No hold protection">
- <!ENTITY copy.attr.holds_protection.example4 "Not holdable">
-<!ENTITY copy.attr.barcode "Barcode">
-<!ENTITY copy.attr.price "Price">
-
+++ /dev/null
-<!ENTITY circ.checkin.caption 'Check In'>
-<!ENTITY circ.checkin.scan_label 'Enter Barcode:'>
-<!ENTITY circ.checkin.scan_label.accesskey 'a'>
-<!ENTITY circ.checkin.submit_label 'Submit'>
-<!ENTITY circ.checkin.submit_label.accesskey 'S'>
-
-<!ENTITY checkin_patron.retrieve 'Retrieve Patron'>
-<!ENTITY checkin_patron.retrieve.accesskey 'R'>
-<!ENTITY checkin_patron.name.label 'Patron Name'>
-
-<!ENTITY checkin.print_receipt_label 'Print List'>
-<!ENTITY checkin.print_receipt_label.accesskey ''>
-<!ENTITY checkin.reprint_receipt_label 'Re-Print Last List'>
-<!ENTITY checkin.reprint_receipt_label.accesskey 'L'>
-<!ENTITY checkin.auto_print_label 'Auto-Print'>
-<!ENTITY checkin.auto_print_label.accesskey 'A'>
-<!ENTITY checkin.done_label 'Done'>
-<!ENTITY checkin.done_label.accesskey 'D'>
-
-
+++ /dev/null
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
- <!-- modified by Jason for Evergreen -->
-
- <RDF:Seq about="urn:mozilla:locale:root">
- <RDF:li resource="urn:mozilla:locale:en-US"/>
- </RDF:Seq>
-
- <RDF:Description about="urn:mozilla:locale:en-US"
- chrome:displayName="Evergreen"
- chrome:author="PINES"
- chrome:name="en-US">
- <chrome:packages>
- <RDF:Seq about="urn:mozilla:locale:en-US:packages">
- <RDF:li resource="urn:mozilla:locale:en-US:evergreen"/>
- </RDF:Seq>
- </chrome:packages>
- </RDF:Description>
-
-</RDF:RDF>
-
+++ /dev/null
-<!ENTITY circ.hold_capture.caption 'Capture Hold'>
-<!ENTITY circ.hold_capture.scan_label 'Enter Barcode:'>
-<!ENTITY circ.hold_capture.scan_label.accesskey 'a'>
-<!ENTITY circ.hold_capture.submit_label 'Submit'>
-<!ENTITY circ.hold_capture.submit_label.accesskey 'S'>
-
-<!ENTITY hold_capture_patron.retrieve 'Retrieve Patron'>
-<!ENTITY hold_capture_patron.retrieve.accesskey 'R'>
-<!ENTITY hold_capture_patron.name.label 'Patron Name'>
-
-<!ENTITY hold_capture.print_receipt_label 'Print List'>
-<!ENTITY hold_capture.print_receipt_label.accesskey ''>
-<!ENTITY hold_capture.reprint_receipt_label 'Re-Print Last List'>
-<!ENTITY hold_capture.reprint_receipt_label.accesskey 'L'>
-<!ENTITY hold_capture.auto_print_label 'Auto-Print'>
-<!ENTITY hold_capture.auto_print_label.accesskey 'A'>
-<!ENTITY hold_capture.done_label 'Done'>
-<!ENTITY hold_capture.done_label.accesskey 'D'>
-
-
+++ /dev/null
-<!ENTITY displaying.results 'Displaying results'>
-<!ENTITY displaying.of 'of'>
-<!ENTITY displaying.hits_per_page 'Results per page'>
-<!ENTITY previous.range 'Previous'>
- <!ENTITY previous.range.key 'P'>
-<!ENTITY next.range 'Next'>
- <!ENTITY next.range.key 'N'>
+++ /dev/null
-<!ENTITY patron_display.name.label 'Patron Name'>
-<!ENTITY patron_display.status.caption 'Status'>
-<!ENTITY patron_display.contact.caption 'Identity & Contact Info'>
-
-<!ENTITY patron_display.checkout.scan_label 'Enter Barcode:'>
-<!ENTITY patron_display.checkout.scan_label.accesskey 'a'>
-<!ENTITY patron_display.checkout.submit_label 'Submit'>
-<!ENTITY patron_display.checkout.submit_label.accesskey 'S'>
-<!ENTITY patron_display.checkout.print_receipt_label 'Print Receipt'>
-<!ENTITY patron_display.checkout.print_receipt_label.accesskey ''>
-<!ENTITY patron_display.checkout.reprint_receipt_label 'Re-Print Last Receipt'>
-<!ENTITY patron_display.checkout.reprint_receipt_label.accesskey 'L'>
-<!ENTITY patron_display.checkout.auto_print_label 'Auto-Print'>
-<!ENTITY patron_display.checkout.auto_print_label.accesskey 'A'>
-<!ENTITY patron_display.checkout.done_label 'Done'>
-<!ENTITY patron_display.checkout.done_label.accesskey 'D'>
-
-<!ENTITY patron_display.items.print_receipt_label 'Print Receipt'>
-<!ENTITY patron_display.items.print_receipt_label.accesskey 'P'>
-
-<!ENTITY patron_navbar.retrieve 'Retrieve Patron'>
-<!ENTITY patron_navbar.retrieve.accesskey 'R'>
-<!ENTITY patron_navbar.refresh 'Refresh'>
-<!ENTITY patron_navbar.refresh.accesskey 'R'>
-<!ENTITY patron_navbar.checkout 'Check Out'>
-<!ENTITY patron_navbar.checkout.accesskey 'C'>
-<!ENTITY patron_navbar.items 'Items Out'>
-<!ENTITY patron_navbar.items.accesskey 'I'>
-<!ENTITY patron_navbar.holds 'Holds'>
-<!ENTITY patron_navbar.holds.accesskey 'H'>
-<!ENTITY patron_navbar.bills 'Bills'>
-<!ENTITY patron_navbar.bills.accesskey 'B'>
-<!ENTITY patron_navbar.edit 'Edit'>
-<!ENTITY patron_navbar.edit.accesskey 'E'>
-<!ENTITY patron_navbar.info 'Info'>
-<!ENTITY patron_navbar.info.accesskey 'o'>
-
-<!ENTITY patron_display.family_name.label 'Last Name:'>
-<!ENTITY patron_display.first_given_name.label 'First Name:'>
-<!ENTITY patron_display.second_given_name.label 'Middle Name:'>
-
-<!ENTITY patron_display.email.label 'Email:'>
-
-<!ENTITY patron_display.library_card.label 'PINES Card:'>
-<!ENTITY patron_display.ident1.label 'ID 1:'>
-<!ENTITY patron_display.ident2.label 'ID 2:'>
-<!ENTITY patron_display.date_of_birth.label 'DOB:'>
-
-<!ENTITY patron_display.day_phone.label 'Day Phone:'>
-<!ENTITY patron_display.evening_phone.label 'Evening Phone:'>
-<!ENTITY patron_display.other_phone.label 'Other Phone:'>
-
-<!ENTITY patron_display.mailing_address 'Mailing Address'>
-<!ENTITY patron_display.mailing.street1.label 'Mailing Address 1:'>
-<!ENTITY patron_display.mailing.street2.label 'Mailing Address 2:'>
-<!ENTITY patron_display.mailing.city.label 'Mailing City:'>
-<!ENTITY patron_display.mailing.state.label 'Mailing State:'>
-<!ENTITY patron_display.mailing.post_code.label 'Mailing ZIP:'>
-
-<!ENTITY patron_display.physical_address 'Physical Address'>
-<!ENTITY patron_display.physical.street1.label 'Physical Address 1:'>
-<!ENTITY patron_display.physical.street2.label 'Physical Address 2:'>
-<!ENTITY patron_display.physical.city.label 'Physical City:'>
-<!ENTITY patron_display.physical.state.label 'Physical State:'>
-<!ENTITY patron_display.physical.post_code.label 'Physical ZIP:'>
-
-<!ENTITY patron_display.standing.label 'Standing:'>
-<!ENTITY patron_display.profile.label 'Profile:'>
-<!ENTITY patron_display.home_ou.label 'Home Library:'>
-<!ENTITY patron_display.checkouts.label 'Check Outs:'>
-<!ENTITY patron_display.checkouts_overdue.label 'Overdue:'>
-<!ENTITY patron_display.holds.label 'Holds:'>
-<!ENTITY patron_display.holds_available.label 'Available:'>
-<!ENTITY patron_display.bills.label 'Bills:'>
-<!ENTITY patron_display.credit.label 'Credit:'>
-<!ENTITY patron_display.items_claimed_returned.label 'Items Claimed Returned:'>
-
-
-
-
-
-
-
+++ /dev/null
-<!ENTITY patron_search_form.caption 'Search for Patron'>
-
-<!ENTITY patron_search_form.family_name.label 'Last Name:'>
- <!ENTITY patron_search_form.family_name.accesskey 'L'>
-<!ENTITY patron_search_form.first_given_name.label 'First Name:'>
- <!ENTITY patron_search_form.first_given_name.accesskey ''>
-<!ENTITY patron_search_form.second_given_name.label 'Middle Name:'>
- <!ENTITY patron_search_form.second_given_name.accesskey ''>
-<!ENTITY patron_search_form.email.label 'Email:'>
- <!ENTITY patron_search_form.email.accesskey ''>
-<!ENTITY patron_search_form.phone.label 'Phone:'>
- <!ENTITY patron_search_form.phone.accesskey 'P'>
-<!ENTITY patron_search_form.ident.label 'ID:'>
- <!ENTITY patron_search_form.ident.accesskey ''>
-<!ENTITY patron_search_form.street1.label 'Address 1:'>
- <!ENTITY patron_search_form.street1.accesskey 'd'>
-<!ENTITY patron_search_form.street2.label 'Address 2:'>
- <!ENTITY patron_search_form.street2.accesskey ''>
-<!ENTITY patron_search_form.city.label 'City:'>
- <!ENTITY patron_search_form.city.accesskey ''>
-<!ENTITY patron_search_form.state.label 'State:'>
- <!ENTITY patron_search_form.state.accesskey ''>
-<!ENTITY patron_search_form.post_code.label 'ZIP:'>
- <!ENTITY patron_search_form.post_code.accesskey ''>
-
-<!ENTITY patron_search_form.search.label 'Search'>
- <!ENTITY patron_search_form.search.accesskey 'S'>
-
-<!ENTITY patron_search_form.clear.label 'Clear Form'>
- <!ENTITY patron_search_form.clear.accesskey 'C'>
-
+++ /dev/null
-<!ENTITY survey.wizard.title "Add a Survey Wizard">
-<!ENTITY survey.wizard.page1 "Initial Settings">
-<!ENTITY survey.wizard.page2 "Add Questions for Survey:">
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-/* * { font-size: x-large; } */
-.test_class { }
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-/* * { font-size: x-large; } */
-.test_class { }
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
+++ /dev/null
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
- <!-- modified by Jason for Evergreen -->
-
- <RDF:Seq about="urn:mozilla:skin:root">
- <RDF:li resource="urn:mozilla:skin:evergreen/0.0.4"/>
- </RDF:Seq>
-
- <RDF:Description about="urn:mozilla:skin:evergreen/0.0.4"
- chrome:displayName="Evergreen"
- chrome:author="PINES"
- chrome:name="evergreen/1.0">
-
- <chrome:packages>
- <RDF:Seq about="urn:mozilla:skin:evergreen/0.0.4:packages">
- <RDF:li resource="urn:mozilla:skin:evergreen/0.0.4:evergreen"/>
- </RDF:Seq>
- </chrome:packages>
- </RDF:Description>
-
-</RDF:RDF>
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-tabpanel { border: 2px groove black; }
-caption { font-weight: bold; }
-
-.my_overflow { overflow: auto; }
-
-.text_left { text-align: left; }
-.text_right { text-align: right; }
-.text_center { text-align: center; }
-.text_justify { text-align: justify; }
-
-.tan { background-color: #D2B48C; }
-.sandy_brown { background-color: #F4A460; }
-.peach_puff { background-color: #FFDAB9; }
-.pale_violet_red { background-color: #D87093; }
-.cadet_blue { background-color: #5F9EA0; }
-.dark_salmon { background-color: #E9967A; }
-.coral { background-color: #FF7F50; }
-
-.deleted_address { background-color: red; }
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-/* * { font-size: x-large; } */
-grid { overflow: auto; }
-.field_row { border: solid thin #262; }
-.ctrl_grid { min-height: 1em; overflow: auto; }
-.ctrl_row { }
-.data_grid { overflow: auto; }
-.data_row { }
-.fixed_grid { }
-.fixed_grid label:hover { text-decoration: underline; }
-.fixed_columns column { border-right: dotted thin #262; }
-.fixed_rows { }
-.fixed_row { }
-.fixed_label { }
-.fixed_textbox { }
-rows { }
-row { }
-columns { }
-column { }
-textbox { }
-.marc_buttons_box description { font-weight: bold; }
-.marc {
- -moz-appearance: none;
- font-family: monospace;
- border: none;
- padding: 0px;
- margin: 0px;
-}
-.marc:hover { background-color: #DDDDDD; }
-.invalid { background-color: #FF8888; }
-.invalid:hover { background-color: #FF8888; }
-*|textarea:focus { background-color: #DDFFDD; }
-.marc_wrapper { min-height: 1.2em; vertical-align: middle; }
-.marc_tag_wrapper { }
-.marc_ind_wrapper { }
-.marc_ind1_wrapper { }
-.marc_ind2_wrapper { }
-.marc_data_wrapper { }
-.marc_tag { min-width: 2.4em; vertical-align: middle; }
-.marc_ind { min-width: 1.2em; vertical-align: middle; }
-.marc_ind1 { }
-.marc_ind2 { }
-.marc_data { min-width: 500px; }
-.resizable { }
-.test_class { }
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-.deleted_address { background-color: red; }
-.patronNameLarge { font-size: large; }
-.patronNameMedium { font-size: medium; }
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-/* * { font-size: x-large; } */
-.test_class { min-height: 100px; }
-
-label { text-align: right; }
-.barcode_row treerow treecell { border: solid black thin; }
-treecell { background-color: red; color: green; }
-
-.row0 { background-color: #99cccc; }
-.row1 { background-color: #99cc99; }
-
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/TR/REC-html40");
-
-/* * { font-size: x-large; } */
-.test_class { }
-
-.wizard_label { text-align: right; }
+++ /dev/null
-// Preferences that get set when the application is loaded
-
-// Modified by Jason for Evergreen
-
-// This one is required for XUL Runner
-pref("toolkit.defaultChromeURI", "chrome://evergreen/content/auth/auth.xul");
-
-// This one just makes things speedier. We use a lot of XMLHttpRequest
-pref("network.http.max-persistent-connections-per-server",8);
-
-// This stops the unresponsive script warning, but the code is still too slow for some reason.
-// However, it's better than POEM, which I wasted a day on :)
-pref("dom.max_script_run_time",60);
-
-pref("javascript.options.strict",false);
-pref("javascript.options.showInConsole",true);
-
-// This lets remote xul access link to local chrome
-pref("security.checkloaduri", false);
-pref("signed.applets.codebase_principal_support", true);
-
+++ /dev/null
-// XpiInstaller
-// By Pike (Heavily inspired by code from Henrik Gemal and Stephen Clavering)
-// Modified by Jason for Evergreen
-
-var XpiInstaller = {
-
- // --- Editable items begin ---
- extFullName: 'Evergreen Staff Client Demo', // The name displayed to the user (don't include the version)
- extShortName: 'evergreen', // The leafname of the JAR file (without the .jar part)
- extVersion: '0.0.4',
- extAuthor: 'GPLS',
- extLocaleNames: ['en-US'], //null, // e.g. ['en-US', 'en-GB']
- extSkinNames: null, // e.g. ['classic', 'modern'] I have this broken
- extPostInstallMessage: 'Success! Please restart your browser to finish the installation.', // Set to null for no post-install message
- // --- Editable items end ---
-
- profileInstall: true,
- silentInstall: true,
-
- install: function()
- {
- var jarName = this.extShortName + '.jar';
- var profileDir = Install.getFolder('Profile', 'chrome');
-
- // Parse HTTP arguments
- this.parseArguments();
-
- // Check if extension is already installed in profile
- if (File.exists(Install.getFolder(profileDir, jarName)))
- {
- if (!this.silentInstall)
- {
- Install.alert('Updating existing Profile install of ' + this.extFullName + ' to version ' + this.extVersion + '.');
- }
- this.profileInstall = true;
- }
- else if (!this.silentInstall)
- {
- // Ask user for install location, profile or browser dir?
- this.profileInstall = Install.confirm('Install ' + this.extFullName + ' ' + this.extVersion + ' to your Profile directory (OK) or your Browser directory (Cancel)?');
- }
-
- // Init install
- var dispName = this.extFullName + ' ' + this.extVersion;
- var regName = '/' + this.extAuthor + '/' + this.extShortName;
- Install.initInstall(dispName, regName, this.extVersion);
-
- // Find directory to install into
- var installPath;
- if (this.profileInstall) installPath = profileDir;
- else installPath = Install.getFolder('chrome');
-
- // Add JAR file
- Install.addFile(null, 'chrome/' + jarName, installPath, null);
-
- // Register chrome
- var jarPath = Install.getFolder(installPath, jarName);
- var installType = this.profileInstall ? Install.PROFILE_CHROME : Install.DELAYED_CHROME;
-
- // Register content
- Install.registerChrome(Install.CONTENT | installType, jarPath, 'content/' + this.extShortName + '/');
-
- // Register locales
- for (var locale in this.extLocaleNames)
- {
- var regPath = 'locale/' + this.extLocaleNames[locale] + '/' + this.extShortName + '/';
- Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
- }
-
- // Register skins
- var regPath = 'skin/' + this.extShortName + '/';
- Install.registerChrome(Install.SKIN | installType, jarPath, regPath);
-
- // Perform install
- var err = Install.performInstall();
- if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED)
- {
- if (!this.silentInstall && this.extPostInstallMessage)
- {
- Install.alert(this.extPostInstallMessage);
- }
- }
- else
- {
- this.handleError(err);
- return;
- }
- },
-
- parseArguments: function()
- {
- // Can't use string handling in install, so use if statement instead
- var args = Install.arguments;
- if (args == 'p=0')
- {
- this.profileInstall = false;
- this.silentInstall = true;
- }
- else if (args == 'p=1')
- {
- this.profileInstall = true;
- this.silentInstall = true;
- }
- },
-
- handleError: function(err)
- {
- if (!this.silentInstall)
- {
- Install.alert('Error: Could not install ' + this.extFullName + ' ' + this.extVersion + ' (Error code: ' + err + ')');
- }
- Install.cancelInstall(err);
- }
-};
-
-XpiInstaller.install();
-/*
-Install.alert('The install.js file for Evergreen is currently broken for Mozilla browsers. Any volunteers for fixing this? The problem I see is with registering the skin component. The install.rdf for Firefox should work');
-Install.cancelInstall(Install.INSTALL_CANCELLED);
-*/
+++ /dev/null
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <!-- modified by Jason for Evergreen -->
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>{c3dd711b-c9b4-4785-b8f8-6157149c8905}</em:id>
- <em:version>0.1.0</em:version>
- <em:type>2</em:type>
-
- <!-- Target Application this extension can install into,
- with minimum and maximum supported versions. -->
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>1.0</em:minVersion>
- <em:maxVersion>1.0+</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Packages, Skins and Locales that this extension registers -->
- <em:file>
- <Description about="urn:mozilla:extension:file:evergreen.jar">
- <em:package>content/evergreen/</em:package>
- <em:locale>locale/en-US/evergreen/</em:locale>
- <em:skin>skin/evergreen/</em:skin>
- </Description>
- </em:file>
-
- <!-- Front End MetaData -->
- <em:name>Evergreen</em:name>
- <em:description>Evergreen Staff Client </em:description>
-
- <em:homepageURL>http://open-ils.org/</em:homepageURL>
-
- </Description>
-</RDF>