tcn lookup
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Feb 2006 19:27:50 +0000 (19:27 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Feb 2006 19:27:50 +0000 (19:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3134 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/server/cat/tcn_query.xul [new file with mode: 0644]

index 3cc4e0d..517da93 100644 (file)
@@ -66,7 +66,6 @@ var urls = {
        'XUL_BROWSER' : 'chrome://open_ils_staff_client/content/util/browser.xul',
        'XUL_CHECKIN' : '/xul/server/circ/checkin.xul',
        'XUL_CHECKOUT' : '/xul/server/circ/checkout.xul',
-       'XUL_COPY_BARCODE_QUERY' : '/xul/server/cat/barcode_entry.xul',
        'XUL_COPY_EDITOR' : '/xul/server/cat/copy_editor.xul',
        'XUL_COPY_LOCATION_EDIT' : '/xul/server/admin/copy_locations.xml',
        'XUL_COPY_STATUS' : '/xul/server/circ/copy_status.xul',
@@ -102,6 +101,7 @@ var urls = {
        'XUL_REMOTE_BROWSER' : '/xul/server/util/rbrowser.xul',
        'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xml',
        'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
+       'XUL_TCN_QUERY' : '/xul/server/cat/tcn_query.xul',
        'XUL_VOLUME_COPY_CREATOR' : '/xul/server/cat/volume_copy_creator.xul',
        'XUL_VOLUME_EDITOR' : '/xul/server/cat/volume_editor.xul',
        'XUL_Z3950_IMPORT' : '/xul/server/cat/z3950.xul',
index f46f0c9..2588bc0 100644 (file)
@@ -75,32 +75,57 @@ main.menu.prototype = {
                        'cmd_search_tcn' : [
                                ['oncommand'],
                                function() {
-                               }
-                       ],
-                       'cmd_copy_status' : [
-                               ['oncommand'],
-                               function() {
-                                       obj.set_tab(obj.url_prefix(urls.XUL_COPY_STATUS)
-                                               + '?session='+window.escape(session),{},{});
-                                       /*
                                        JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
-                                       obj.data.cmd_copy_status_value = ''; obj.data.stash('cmd_copy_status_value');
+                                       obj.data.cmd_copy_status_value = ''; obj.data.stash('cmd_search_tcn_value');
 
                                        obj.window.open(
-                                               obj.url_prefix(urls.XUL_COPY_BARCODE_QUERY),
-                                               'cmd_copy_status_win' + obj.window.window_name_increment(),
+                                               obj.url_prefix(urls.XUL_TCN_QUERY),
+                                               'cmd_search_tcn_win' + obj.window.window_name_increment(),
                                                'chrome,resizable,modal,center'
                                        );
 
                                        obj.data.stash_retrieve();
-                                       var barcode = obj.data.cmd_copy_status_value;
+                                       var tcn = obj.data.cmd_search_tcn_value;
 
-                                       if (barcode) {
+                                       if (tcn) {
                                                JSAN.use('util.network');
                                                var network = new util.network();
-                                               var robj = network.simple_request('FM_ACP_RETRIEVE_VIA_BARCODE',[barcode]);
+                                               var robj = network.simple_request('FM_BRE_ID_SEARCH_VIA_TCN',[tcn]);
+                                               if (robj.count != robj.ids.length) throw('FIXME -- FM_BRE_ID_SEARCH_VIA_TCN = ' + js2JSON(robj));
+                                               if (robj.count == 0) {
+                                                       alert('TCN not found');
+                                               } else {
+                                                       for (var i = 0; i < robj.count; i++) {
+                                                               var id = robj.ids[i];
+                                                               var opac_url = obj.url_prefix( urls.opac_rdetail ) + '?r=' + id;
+                                                               var content_params = { 
+                                                                       'session' : session, 
+                                                                       'authtime' : authtime,
+                                                                       'opac_url' : opac_url,
+                                                               };
+                                                               if (i == 0) {
+                                                                       obj.set_tab(
+                                                                               obj.url_prefix(urls.XUL_OPAC_WRAPPER), 
+                                                                               {'tab_name':tcn}, 
+                                                                               content_params
+                                                                       );
+                                                               } else {
+                                                                       obj.new_tab(
+                                                                               obj.url_prefix(urls.XUL_OPAC_WRAPPER), 
+                                                                               {'tab_name':tcn}, 
+                                                                               content_params
+                                                                       );
+                                                               }
+                                                       }
+                                               }
                                        }
-                                       */
+                               }
+                       ],
+                       'cmd_copy_status' : [
+                               ['oncommand'],
+                               function() {
+                                       obj.set_tab(obj.url_prefix(urls.XUL_COPY_STATUS)
+                                               + '?session='+window.escape(session),{},{});
                                }
                        ],
 
diff --git a/Open-ILS/xul/staff_client/server/cat/tcn_query.xul b/Open-ILS/xul/staff_client/server/cat/tcn_query.xul
new file mode 100644 (file)
index 0000000..bcd9943
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Patron Display -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="tcn_query" title="Title Control Number Lookup"
+       orient="vertical" style="overflow: auto"
+       onload="try{info_init();}catch(E){alert(E);}"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+       <!-- BEHAVIOR -->
+        <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
+        <scripts id="openils_util_scripts"/>
+
+       <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+
+       <script>
+       <![CDATA[
+
+               function info_init() {
+                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                       if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                       JSAN.errorLevel = "die"; // none, warn, or die
+                       JSAN.addRepository('/xul/server/');
+                       JSAN.use('util.error'); g.error = new util.error();
+                       g.error.sdump('D_TRACE','my_init() for patron_display.xul');
+                       JSAN.use('OpenILS.data'); g.data = new OpenILS.data();
+                       g.data.init({'via':'stash'});
+
+                       document.getElementById('tcn').focus();
+                       document.getElementById('tcn').addEventListener(
+                               'keypress',
+                               function(ev) {
+                                       if (ev.keyCode && ev.keyCode == 13) {
+                                               setTimeout( /* workaround some segfaults */
+                                                       function() {
+                                                               info_finish();
+                                                               window.close();
+                                                       }, 0
+                                               );
+                                       }
+                               },
+                               false
+                       );
+               }
+
+               function info_finish() {
+                       /* FIXME -- need unique temp space name */
+                       g.data.cmd_search_tcn_value = document.getElementById('tcn').value;
+                       g.data.stash('cmd_search_tcn_value');
+               }
+
+       ]]>
+       </script>
+
+
+       <groupbox>
+               <caption label="Enter TCN / Accession ID"/>
+               <grid>
+                       <columns> <column flex="0" /> <column flex="0" /> </columns>
+                       <rows>
+                               <row>
+                                       <label value="ID"/>
+                                       <textbox id="tcn" />
+                               </row>
+                       </rows>
+               </grid>
+               <hbox>
+                       <spacer flex="1"/>
+                       <button label="Cancel" oncommand="window.close()" accesskey="C"/>
+                       <button label="Search" oncommand="info_finish(); window.close();" accesskey="S"/>
+               </hbox>
+       </groupbox>
+
+</window>
+
+