Move this from chrome to remote, where it belongs
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Dec 2008 21:41:37 +0000 (21:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Dec 2008 21:41:37 +0000 (21:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11675 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/Makefile.am
Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js [deleted file]
Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul [deleted file]
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/main/verify_credentials.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/main/verify_credentials.xul [new file with mode: 0644]

index e5d1e51..ea489c3 100644 (file)
@@ -34,7 +34,6 @@ build_dir:
 
 # Convert chrome to remote for server localization
 chrome2remote:
-       @sed -i 's/chrome:\/\/open_ils_staff_client\/locale\//\/xul\/server\/locale\/<\!--#echo var=locale-->\//' build/server/auth/verify_credentials.xul
        @sed -i 's/chrome:\/\/open_ils_staff_client\/locale\//\/xul\/server\/locale\/<\!--#echo var=locale-->\//' build/server/main/simple_auth.xul
        @for loc in $(CHROME_LOCALES); do \
                cp -fr chrome/locale/$$loc build/server/locale/. ; \
diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.js
deleted file mode 100644 (file)
index cca0178..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-function verify_init() {
-    try {
-        offlineStrings = document.getElementById('offlineStrings');
-
-        if (typeof JSAN == 'undefined') {
-            throw(
-                offlineStrings.getString('common.jsan.missing')
-            );
-        }
-
-        JSAN.errorLevel = "die"; // none, warn, or die
-        JSAN.addRepository('..');
-
-               JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
-        XML_HTTP_SERVER = data.server_unadorned;
-
-        JSAN.use('util.network'); var net = new util.network();
-        document.getElementById('cmd_verify').addEventListener(
-            'command',
-            function() {
-                try {
-                    var barcode = document.getElementById('barcode_prompt').value;
-                    var name = document.getElementById('name_prompt').value;
-                    var password = document.getElementById('password_prompt').value; 
-                    var req = net.simple_request(
-                        'AUTH_VERIFY_CREDENTIALS',
-                        [ 
-                            ses(), 
-                            barcode,
-                            name,
-                            hex_md5( password )
-                        ]
-                    );
-
-                    if (typeof req.ilsevent != 'undefined') { throw(req); }
-
-                    var msg_area = document.getElementById('messages');
-                    var hbox = document.createElement('hbox'); msg_area.insertBefore(hbox, msg_area.firstChild);
-                    var success_msg = document.createElement('description'); hbox.appendChild(success_msg);
-                    success_msg.setAttribute('class', String(req) == '1' ? 'success_text' : 'failure_text');
-                    success_msg.appendChild(
-                        document.createTextNode( 
-                            String(req) == '1' ? 
-                                offlineStrings.getString('menu.cmd_verify_credentials.correct_credentials') : 
-                                offlineStrings.getString('menu.cmd_verify_credentials.incorrect_credentials') 
-                        )
-                    );
-                    var name_msg = document.createElement('description'); hbox.appendChild(name_msg);
-                    name_msg.appendChild(
-                        document.createTextNode(
-                            offlineStrings.getFormattedString('menu.cmd_verify_credentials.name_feedback',[name]) 
-                        )
-                    );
-                    var barcode_msg = document.createElement('description'); hbox.appendChild(barcode_msg);
-                    barcode_msg.appendChild(
-                        document.createTextNode(
-                            offlineStrings.getFormattedString('menu.cmd_verify_credentials.barcode_feedback',[barcode]) 
-                        )
-                    );
-                    var date_msg = document.createElement('description'); hbox.appendChild(date_msg);
-                    date_msg.appendChild(
-                        document.createTextNode(
-                            new Date()
-                        )
-                    );
-
-
-                } catch(E) {
-                    alert(E);
-                }
-                document.getElementById('name_prompt').focus();
-            },
-            false
-        );
-        document.getElementById('cmd_retrieve').addEventListener(
-            'command',
-            function() {
-                var barcode = document.getElementById('barcode_prompt').value;
-                var name = document.getElementById('name_prompt').value;
-                var req = net.simple_request(
-                    'FM_AU_ID_RETRIEVE_VIA_BARCODE_OR_USERNAME',
-                    [
-                        ses(),
-                        barcode,
-                        name
-                    ]
-                );
-                if (typeof req.ilsevent != 'undefined') { 
-                    alert (req.desc);
-                    document.getElementById('name_prompt').focus();
-                } else {
-                    var url = xulG.url_prefix( urls.XUL_PATRON_DISPLAY ); 
-                    xulG.set_tab( url, {}, { 'id' : req } );
-                }
-            },
-            false
-        );
-
-        document.getElementById('name_prompt').focus();
-
-    } catch(E) {
-        alert(E);
-    }
-}
diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul b/Open-ILS/xul/staff_client/chrome/content/auth/verify_credentials.xul
deleted file mode 100644 (file)
index d17818f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Verify Credentials -->
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- PRESENTATION -->
-<?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="chrome://open_ils_staff_client/skin/auth.css" type="text/css"?>
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- LOCALIZATION -->
-<!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- OVERLAYS -->
-
-<window id="verify_win" onload="try { verify_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="../main/constants.js" />
-               <script type="text/javascript" src="../OpenILS/util/utils.js" />
-               <script type="text/javascript" src="../OpenILS/util/CGI.js" />
-               <script type="text/javascript" src="../OpenILS/util/md5.js" />
-               <script type="text/javascript" src="../OpenILS/util/JSON_v1.js" />
-               <script type="text/javascript" src="../OpenILS/util/RemoteRequest.js" />
-               <script type="text/javascript" src="../OpenILS/util/org_utils.js" />   
-               <script type="text/javascript" src="../OpenILS/global_util.js" />   
-       </scripts>
-
-       <script type="text/javascript" src="chrome://open_ils_staff_client/content/main/JSAN.js"/>
-       <script type="text/javascript" src="chrome://open_ils_staff_client/content/auth/verify_credentials.js"/>
-
-       <messagecatalog id="authStrings" src="chrome://open_ils_staff_client/locale/auth.properties"/>
-       <messagecatalog id="offlineStrings" src="chrome://open_ils_staff_client/locale/offline.properties"/>
-
-       <commandset id="verify_cmds">
-               <command id="cmd_verify" />
-               <command id="cmd_retrieve" />
-       </commandset>
-
-       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-       <!-- CONTENT -->
-       <groupbox id="verify_groupbox" flex="1" style="overflow: auto;">
-               <caption id="verify_caption" label="&staff.auth.verify.caption;"/>
-        <grid>
-            <columns> <column /> <column /> </columns>
-            <rows>
-                <row>
-                    <label value="&common.username;" control="name_prompt" accesskey="&common.username.accesskey;"/>
-                    <textbox id="name_prompt" value=""/>
-                </row>
-                <row>
-                    <label value="&common.barcode;" control="barcode_prompt" accesskey="&common.barcode.accesskey;"/>
-                    <textbox id="barcode_prompt" value=""/>
-                </row>
-                <row>
-                    <label value="&common.password;" control="password_prompt" accesskey="&common.password.accesskey;"/>
-                    <textbox id="password_prompt" value="" type="password"/>
-                </row>
-                <row>
-                    <spacer />
-                    <hbox>
-                        <button id="submit_button" command="cmd_verify" label="&staff.auth.verify.submit.label;" accesskey="&staff.auth.verify.submit.accesskey;" />
-                        <button id="retrieve_button" command="cmd_retrieve" label="&staff.auth.verify.retrieve.label;" accesskey="&staff.auth.verify.retrieve.accesskey;" />
-                    </hbox>
-                </row>
-            </rows>
-        </grid>
-        <vbox id="messages" flex="1" class="my_overflow">
-            <label id="footer"/>
-        </vbox>
-       </groupbox>
-
-</window>
-
index 8a2179e..85fda94 100644 (file)
@@ -309,7 +309,7 @@ const urls = {
        'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xhtml',
        'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
        'XUL_USER_BUCKETS' : '/xul/server/patron/user_buckets.xul',
-       'XUL_VERIFY_CREDENTIALS' : 'chrome://open_ils_staff_client/content/auth/verify_credentials.xul',
+       'XUL_VERIFY_CREDENTIALS' : '/xul/server/main/verify_credentials.xul',
        'XUL_VOLUME_BUCKETS' : '/xul/server/cat/volume_buckets.xul',
        'XUL_VOLUME_COPY_CREATOR' : '/xul/server/cat/volume_copy_creator.xul',
        'XUL_VOLUME_EDITOR' : '/xul/server/cat/volume_editor.xul',
index 9c85e1b..6094502 100644 (file)
@@ -131,12 +131,8 @@ menu.cmd_public_opac.tab=OPAC
 menu.cmd_extension_manager.tab=Extension Manager
 menu.cmd_theme_manager.tab=Theme Manager
 menu.cmd_shutdown.prompt=Exit Evergreen completely?
-menu.cmd_verify_credentials.tabname=Verify Credentials
-menu.cmd_verify_credentials.correct_credentials=Success testing credentials!
-menu.cmd_verify_credentials.incorrect_credentials=Failure testing credentials!
-menu.cmd_verify_credentials.name_feedback=Username: <%1$s>
-menu.cmd_verify_credentials.barcode_feedback=Barcode: <%1$s>
 menu.spawn_search.msg=Editor would like to search for: %1$s
+menu.cmd_verify_credentials.tabname=Verify Credentials
 menu.close_all_tabs.error=Error closing all tabs
 menu.new_tab.tab=Tab
 main.session_cookie.error=Error setting session cookie: %1$s
index d873ccd..c7d4e33 100644 (file)
@@ -249,5 +249,9 @@ staff.patron.user_buckets.tab_name=User Buckets
 staff.patron.user_edit.save_user.depth_required=Depth is required on the %1$s permission.
 staff.patron.user_edit.save_user.user_modified_successfully=User %1$s [%2$s] successfully modified.\n%3$s permissions and %4$s work locations updated.
 staff.patron.user_edit.display_perm.select_one=-- Select One --
+staff.patron.cmd_verify_credentials.correct_credentials=Success testing credentials!
+staff.patron.cmd_verify_credentials.incorrect_credentials=Failure testing credentials!
+staff.patron.cmd_verify_credentials.name_feedback=Username: <%1$s>
+staff.patron.cmd_verify_credentials.barcode_feedback=Barcode: <%1$s>
 web.staff.patron.ue.session_no_defined=User session is not defined
 web.staff.patron.ue.uedit_show_search.search_would_be=Search would be:\n%1$s
diff --git a/Open-ILS/xul/staff_client/server/main/verify_credentials.js b/Open-ILS/xul/staff_client/server/main/verify_credentials.js
new file mode 100644 (file)
index 0000000..fd04fca
--- /dev/null
@@ -0,0 +1,105 @@
+function verify_init() {
+    try {
+        commonStrings = document.getElementById('commonStrings');
+        patronStrings = document.getElementById('patronStrings');
+
+        if (typeof JSAN == 'undefined') {
+            throw(
+                commonStrings.getString('common.jsan.missing')
+            );
+        }
+
+        JSAN.errorLevel = "die"; // none, warn, or die
+        JSAN.addRepository('..');
+
+               JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
+        XML_HTTP_SERVER = data.server_unadorned;
+
+        JSAN.use('util.network'); var net = new util.network();
+        document.getElementById('cmd_verify').addEventListener(
+            'command',
+            function() {
+                try {
+                    var barcode = document.getElementById('barcode_prompt').value;
+                    var name = document.getElementById('name_prompt').value;
+                    var password = document.getElementById('password_prompt').value; 
+                    var req = net.simple_request(
+                        'AUTH_VERIFY_CREDENTIALS',
+                        [ 
+                            ses(), 
+                            barcode,
+                            name,
+                            hex_md5( password )
+                        ]
+                    );
+
+                    if (typeof req.ilsevent != 'undefined') { throw(req); }
+
+                    var msg_area = document.getElementById('messages');
+                    var hbox = document.createElement('hbox'); msg_area.insertBefore(hbox, msg_area.firstChild);
+                    var success_msg = document.createElement('description'); hbox.appendChild(success_msg);
+                    success_msg.setAttribute('class', String(req) == '1' ? 'success_text' : 'failure_text');
+                    success_msg.appendChild(
+                        document.createTextNode( 
+                            String(req) == '1' ? 
+                                patronStrings.getString('staff.patron.cmd_verify_credentials.correct_credentials') : 
+                                patronStrings.getString('staff.patron.cmd_verify_credentials.incorrect_credentials') 
+                        )
+                    );
+                    var name_msg = document.createElement('description'); hbox.appendChild(name_msg);
+                    name_msg.appendChild(
+                        document.createTextNode(
+                            patronStrings.getFormattedString('staff.patron.cmd_verify_credentials.name_feedback',[name]) 
+                        )
+                    );
+                    var barcode_msg = document.createElement('description'); hbox.appendChild(barcode_msg);
+                    barcode_msg.appendChild(
+                        document.createTextNode(
+                            patronStrings.getFormattedString('staff.patron.cmd_verify_credentials.barcode_feedback',[barcode]) 
+                        )
+                    );
+                    var date_msg = document.createElement('description'); hbox.appendChild(date_msg);
+                    date_msg.appendChild(
+                        document.createTextNode(
+                            new Date()
+                        )
+                    );
+
+
+                } catch(E) {
+                    alert(E);
+                }
+                document.getElementById('name_prompt').focus();
+            },
+            false
+        );
+        document.getElementById('cmd_retrieve').addEventListener(
+            'command',
+            function() {
+                var barcode = document.getElementById('barcode_prompt').value;
+                var name = document.getElementById('name_prompt').value;
+                var req = net.simple_request(
+                    'FM_AU_ID_RETRIEVE_VIA_BARCODE_OR_USERNAME',
+                    [
+                        ses(),
+                        barcode,
+                        name
+                    ]
+                );
+                if (typeof req.ilsevent != 'undefined') { 
+                    alert (req.desc);
+                    document.getElementById('name_prompt').focus();
+                } else {
+                    var url = xulG.url_prefix( urls.XUL_PATRON_DISPLAY ); 
+                    xulG.set_tab( url, {}, { 'id' : req } );
+                }
+            },
+            false
+        );
+
+        document.getElementById('name_prompt').focus();
+
+    } catch(E) {
+        alert(E);
+    }
+}
diff --git a/Open-ILS/xul/staff_client/server/main/verify_credentials.xul b/Open-ILS/xul/staff_client/server/main/verify_credentials.xul
new file mode 100644 (file)
index 0000000..2d18e90
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Verify Credentials -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- PRESENTATION -->
+<?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"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window PUBLIC "" ""[
+       <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="verify_win" onload="try { verify_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 type="text/javascript" src="verify_credentials.js"/>
+
+       <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
+       <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties" />
+
+       <commandset id="verify_cmds">
+               <command id="cmd_verify" />
+               <command id="cmd_retrieve" />
+       </commandset>
+
+       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+       <!-- CONTENT -->
+       <groupbox id="verify_groupbox" flex="1" style="overflow: auto;">
+               <caption id="verify_caption" label="&staff.auth.verify.caption;"/>
+        <grid>
+            <columns> <column /> <column /> </columns>
+            <rows>
+                <row>
+                    <label value="&common.username;" control="name_prompt" accesskey="&common.username.accesskey;"/>
+                    <textbox id="name_prompt" value=""/>
+                </row>
+                <row>
+                    <label value="&common.barcode;" control="barcode_prompt" accesskey="&common.barcode.accesskey;"/>
+                    <textbox id="barcode_prompt" value=""/>
+                </row>
+                <row>
+                    <label value="&common.password;" control="password_prompt" accesskey="&common.password.accesskey;"/>
+                    <textbox id="password_prompt" value="" type="password"/>
+                </row>
+                <row>
+                    <spacer />
+                    <hbox>
+                        <button id="submit_button" command="cmd_verify" label="&staff.auth.verify.submit.label;" accesskey="&staff.auth.verify.submit.accesskey;" />
+                        <button id="retrieve_button" command="cmd_retrieve" label="&staff.auth.verify.retrieve.label;" accesskey="&staff.auth.verify.retrieve.accesskey;" />
+                    </hbox>
+                </row>
+            </rows>
+        </grid>
+        <vbox id="messages" flex="1" class="my_overflow">
+            <label id="footer"/>
+        </vbox>
+       </groupbox>
+
+</window>
+