From 6dfc68fb1dfabcce4a936a78462fc50ef48e1174 Mon Sep 17 00:00:00 2001 From: pines Date: Thu, 9 Mar 2006 19:42:46 +0000 Subject: [PATCH] still needs polish and version detection, but kados should be able to login now :) git-svn-id: svn://svn.open-ils.org/ILS/trunk@3299 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/auth/controller.js | 57 -------- .../staff_client/chrome/content/main/main.js | 50 ++----- .../staff_client/chrome/content/main/main.xul | 131 +++++++----------- .../staff_client/chrome/content/util/error.js | 2 +- 4 files changed, 63 insertions(+), 177 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js index 5d776e4129..11794859a1 100644 --- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js +++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js @@ -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'); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index 28de091954..10691eb555 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -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(); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.xul b/Open-ILS/xul/staff_client/chrome/content/main/main.xul index 5aea50350f..d254de94da 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.xul @@ -19,6 +19,7 @@ --> - @@ -74,91 +74,60 @@ - - + +