still needs polish and version detection, but kados should be able to login now :)
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 19:42:46 +0000 (19:42 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 19:42:46 +0000 (19:42 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3299 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/auth/controller.js
Open-ILS/xul/staff_client/chrome/content/main/main.js
Open-ILS/xul/staff_client/chrome/content/main/main.xul
Open-ILS/xul/staff_client/chrome/content/util/error.js

index 5d776e4..1179485 100644 (file)
@@ -32,13 +32,6 @@ auth.controller.prototype = {
                                                        obj.override();
                                                }
                                        ],
-                                       'cmd_register' : [
-                                               ['command'],
-                                               function() {
-                                                       dump('cmd_register handler\n');
-                                                       obj.register();
-                                               }
-                                       ],
                                        'cmd_logoff' : [
                                                ['command'],
                                                function() {
@@ -64,19 +57,10 @@ auth.controller.prototype = {
                                                ['keypress'],
                                                handle_keypress
                                        ],
-                                       'wsid_prompt' : [
-                                               ['keypress'],
-                                               handle_keypress
-                                       ],
-
                                        'submit_button' : [
                                                ['render'],
                                                function(e) { return function() {} }
                                        ],
-                                       'register_button' : [
-                                               ['render'],
-                                               function(e) { return function() {} }
-                                       ],
                                        'progress_bar' : [
                                                ['render'],
                                                function(e) { return function() {} }
@@ -119,11 +103,6 @@ auth.controller.prototype = {
                                                        obj.controller.view.submit_button.focus(); 
                                                        obj.login();
                                                break;
-                                               case obj.controller.view.wsid_prompt:
-                                                       ev.preventDefault();
-                                                       obj.controller.view.register_button.focus();
-                                                       obj.register();
-                                               break;
                                                default: break;
                                        }
                                }
@@ -188,42 +167,6 @@ auth.controller.prototype = {
 
        },
 
-       'register' : function() { 
-               try {
-               dump('register code\n');
-               var obj = this;
-
-               var orgid = obj.controller.view.menu_spot.firstChild.value;
-               var wsname = obj.controller.view.wsid_prompt.value;
-
-               obj.error.sdump('D_AUTH','register workstation with ' + orgid + ' and ' + wsname + '\n'); 
-
-               obj.controller.view.menu_spot.firstChild.disabled = true;
-               obj.controller.view.wsid_prompt.disabled = true;
-
-               try {
-
-                       var server = obj.controller.view.server_prompt.value;
-
-                       if (typeof obj.on_register == 'function') {
-                               dump('calling on_register\n');
-                               obj.on_register(obj.session.key,server,orgid,wsname);
-                       }
-                       
-
-               } catch(E) {
-                       var error = '!! ' + E + '\n';
-                       this.error.sdump('D_ERROR',error); 
-                       alert(error);
-                       this.controller.view.menu_spot.firstChild.disabled = false;
-                       this.controller.view.wsid_prompt.disabled = false;
-               }
-               } catch(E) {
-                       alert(E);
-               }
-
-       },
-
        'logoff' : function() { 
        
                this.error.sdump('D_AUTH','logoff' + this.w + '\n'); 
index 28de091..10691eb 100644 (file)
@@ -54,10 +54,10 @@ function main_init() {
                        G.file.get('ws_info');
                        G.ws_info = G.file.get_object();
                        // { server_name : { 'id' : ..., 'name' : ..., 'owning_lib' : ... }, ... : ... }
-                       alert('retrieved ws_info from filesystem: ' + js2JSON(ws_info) );
+                       // alert('retrieved ws_info from filesystem: ' + js2JSON(G.ws_info) );
                } catch(E) {
                        G.ws_info = {};
-                       alert('could not retrieve ws_info from filesystem');
+                       //alert('could not retrieve ws_info from filesystem');
                }
                G.data.ws_info = G.ws_info; G.data.stash('ws_info');
 
@@ -70,51 +70,25 @@ function main_init() {
 
                        grant_perms(url);
 
+                       var xulG = {
+                               'auth' : G.auth,
+                               'url' : url,
+                               'window' : G.window,
+                       }
+
                        if (G.data.ws_info && G.data.ws_info[G.auth.controller.view.server_prompt.value]) {
                                var deck = document.getElementById('main_deck');
                                var iframe = document.createElement('iframe'); deck.appendChild(iframe);
                                iframe.setAttribute( 'src', url + '/xul/server/main/data.xul' );
-                               var xulG = {
-                                       'auth' : G.auth,
-                                       'url' : url,
-                                       'window' : G.window,
-                               }
                                iframe.contentWindow.xulG = xulG;
                        } else {
-                               G.auth.controller.view.ws_deck.selectedIndex = 1;
-                               JSAN.use('util.widgets');
-                               var spot = document.getElementById('menu_spot');
-                               util.widgets.remove_children(spot);
-                               var ml = util.widgets.make_menulist( [ ['PINES','1'], ['ARL-ATH','18'] ] );
-                               ml.setAttribute('id','menu');
-                               spot.appendChild(ml);
-                       }
-               }
-
-               G.auth.on_register = function(ses,server,orgid,wsname) {
-                       try {
-                               alert('register happens here: ses = ' + ses + ' server = ' + server + ' orgid = ' + orgid + ' wsname = ' + wsname );
-
-                               var deck = document.getElementById('main_deck');
+                               xulG.file = G.file;
+                               var deck = G.auth.controller.view.ws_deck;
                                var iframe = document.createElement('iframe'); deck.appendChild(iframe);
-                               iframe.setAttribute( 'src', G.data.server + '/xul/server/main/register.xul');
-                               var xulG = {
-                                       'auth' : G.auth,
-                                       'url' : G.data.server,
-                                       'window' : G.window,
-                                       'ses' : ses,
-                                       'ws_server' : server,
-                                       'ws_orgid' : orgid,
-                                       'ws_name' : wsname,
-                                       'file' : G.file,
-                               }
+                               iframe.setAttribute( 'src', url + '/xul/server/main/ws_info.xul' );
                                iframe.contentWindow.xulG = xulG;
-
-                       } catch(E) {
-                               G.error.sdump('D_ERROR',E);
-                               alert(E);
+                               deck.selectedIndex = deck.childNodes.length - 1;
                        }
-
                }
 
                G.auth.init();
index 5aea503..d254de9 100644 (file)
@@ -19,6 +19,7 @@
 -->
 
 <window id="main_win" 
+       width="400" height="550"
        onload="try { main_init(); } catch(E) { alert(E); }"
        onunload="try { G.auth.logoff(); } catch(E) { alert(E); }"
        title="&staff.auth.title;"
@@ -62,7 +63,6 @@
                <command id="cmd_login" />
                <command id="cmd_logoff"/>
                <command id="cmd_override" />
-               <command id="cmd_register" />
                <command id="cmd_close_window"/>
        </commandset>
 
 
        <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
        <!-- CONTENT -->
-       <deck id="main_deck">
-       <groupbox id="main_groupbox" flex="1">
+       <deck id="main_deck" flex="1">
+       <groupbox id="main_groupbox" flex="1" style="overflow: auto;">
                <caption id="main_caption" label="Startup"/>
                <label value="&staff.auth.version;"/>
                <label value="Development Version 123"/>
                <label value=" "/>
-               <grid>
-               <columns><column/><column/></columns>
-               <rows>
-               <row>
-                       <groupbox>
-                               <caption label="Server"/>
-                               <grid>
-                                       <columns><column /><column /></columns>
-                                       <rows>
-                                               <row>
-                                                       <label value="Hostname" control="server_prompt" accesskey="H"/>
-                                                       <textbox id="server_prompt" value="dev.gapines.org"/>
-                                               </row>
-                                               <row>
-                                                       <label value="Status"/>
-                                                       <label id="status" value="Online" style="color: green; text-color: green;"/>
-                                               </row>
-                                       </rows>
-                               </grid>
-                       </groupbox>
-                       <groupbox>
-                               <caption label="Workstation"/>
-                               <deck id="ws_deck">
-                                       <description>
-                                               Not yet configured.
-                                       </description>
-                                       <grid>
-                                               <columns><column /><column /></columns>
-                                               <rows>
-                                                       <row>
-                                                               <label value="Library" control="menu_spot"/>
-                                                               <hbox id="menu_spot" />
-                                                       </row>
-                                                       <row>
-                                                               <label value="ID" control="wsid_prompt" />
-                                                               <textbox id="wsid_prompt" />
-                                                       </row>
-                                               </rows>
-                                       </grid>
-                               </deck>
-                       </groupbox>
-               </row>
-               <row>
-                       <groupbox>
-                               <caption label="Authentication"/>
-                               <grid>
-                                       <columns> <column /> <column /> </columns>
-                                       <rows>
-                                               <row>
-                                                       <label value="Username" control="name_prompt" accesskey="U"/>
-                                                       <textbox id="name_prompt" value=""/>
-                                               </row>
-                                               <row>
-                                                       <label value="Password" control="password_prompt" accesskey="P"/>
-                                                       <textbox id="password_prompt" value="" type="password"/>
-                                               </row>
-                                       </rows>
-                               </grid>
-                       </groupbox>
-                       <groupbox>
-                               <caption label="Actions"/>
-                               <grid>
-                                       <columns><column flex="1"/><column /></columns>
-                                       <rows>
-                                               <row>
-                                                       <button id="submit_button" label="Login" accesskey="L" command="cmd_login" />
-                                                       <button id="register_button" label="Register" accesskey="R" command="cmd_register" />
-                                               </row>
-                                               <row>
-                                                       <button label="&staff.auth.logoff_prompt;" accesskey="f" command="cmd_logoff" />
-                                                       <button label="&staff.auth.quit_prompt;" accesskey="&staff.auth.quit_prompt.key;" command="cmd_close_window"/>
-                                               </row>
-                                       </rows>
-                               </grid>
-                       </groupbox>
-               </row>
-               </rows>
-               </grid>
+
+               <groupbox flex="1">
+                       <caption label="Server"/>
+                       <grid>
+                               <columns><column /><column /></columns>
+                               <rows>
+                                       <row>
+                                               <label value="Hostname" control="server_prompt" accesskey="H"/>
+                                               <textbox id="server_prompt" value="dev.gapines.org"/>
+                                       </row>
+                                       <row>
+                                               <label value="Status"/>
+                                               <label id="status" value="Online" style="color: green; text-color: green;"/>
+                                       </row>
+                               </rows>
+                       </grid>
+               </groupbox>
+
+               <groupbox flex="1">
+                       <caption label="Authentication"/>
+                       <grid>
+                               <columns> <column /> <column /> </columns>
+                               <rows>
+                                       <row>
+                                               <label value="Username" control="name_prompt" accesskey="U"/>
+                                               <textbox id="name_prompt" value=""/>
+                                       </row>
+                                       <row>
+                                               <label value="Password" control="password_prompt" accesskey="P"/>
+                                               <textbox id="password_prompt" value="" type="password"/>
+                                       </row>
+                                       <row>
+                                               <button id="submit_button" label="Login" accesskey="L" command="cmd_login" />
+                                               <button label="&staff.auth.logoff_prompt;" accesskey="f" command="cmd_logoff" />
+                                       </row>
+                               </rows>
+                       </grid>
+               </groupbox>
+
+               <groupbox flex="1">
+                       <caption label="Workstation"/>
+                       <deck id="ws_deck">
+                       </deck>
+               </groupbox>
+
+               <button label="&staff.auth.quit_prompt;" accesskey="&staff.auth.quit_prompt.key;" command="cmd_close_window"/>
                <progressmeter id="progress_bar" mode="normal" value="0"/>
+
        </groupbox>
        </deck>
 
index eeae120..23b1213 100644 (file)
@@ -56,7 +56,7 @@ util.error.prototype = {
 
                'D_PATRON_UTILS' : false, 'D_CIRC_UTILS' : false,
 
-               'D_FILE' : false, 'D_EXPLODE' : false, 'D_FM_UTILS' : false, 'D_PRINT' : false, 'D_SES' : true,
+               'D_FILE' : true, 'D_EXPLODE' : false, 'D_FM_UTILS' : false, 'D_PRINT' : false, '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
        },