listbox and firefox bug, bill interface incomplete
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 17:41:29 +0000 (17:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 17:41:29 +0000 (17:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1279 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/Makefile
Evergreen/staff_client/application.ini
Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/util/error.js
Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.dtd

index bf05ed1..c9648ee 100644 (file)
@@ -1,7 +1,7 @@
 VERSION=0.0.9
 PACKAGE=Evergreen
 DESCRIPTION=Evergreen Staff Client Pre-Alpha
-BUILD=2005071519
+BUILD=2005071911
 
 ILS_DIR=${PWD}/../..
 
index a037ae6..e9744af 100644 (file)
@@ -14,7 +14,7 @@ Version=0.0.9
 ;
 ; This field specifies your application's build ID (timestamp).  This field is
 ; required.
-BuildID=2005071519
+BuildID=2005071911
 ;
 ; This field specifies a compact copyright notice for your application.  This
 ; field is optional.
index 9be3962..070ae86 100644 (file)
@@ -5,9 +5,11 @@ function patron_bills_init(p) {
        sdump('D_CONSTRUCTOR',arg_dump(arguments));
 
        p.patron_bills_cols = [
+       /*
                {
                        'id' : 'checkbox', 'label' : ' ', 'flex' : 0, 'render_xul' : 'checkbox'
                },
+       */
                {
                        'id' : 'id', 'label' : getString('mbts_id_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'fm_class' : 'mbts', 'fm_field_render' : '.id()'
@@ -37,43 +39,75 @@ function patron_bills_init(p) {
                }
        ];
 
-       p.grid_list = grid_list_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_bills_cols, 'debug' : p.app } );
+       p.list_box = list_box_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_bills_cols, 'debug' : p.app } );
+
+
        p.add_patron_bills = function (bills) {
                sdump('D_PATRON_BILLS','p.add_patron_bills(' + bills + ')\n');
                return patron_bills_add_patron_bills(p,bills);
        }
-       p.clear_patron_bills = p.grid_list.clear_grid;
-
-       p.register_bill_context_builder = function (f) {
-               sdump('D_PATRON_BILLS','p.register_context_builder(' + f + ')\n');
-               p.grid_list.register_context_builder( f );
-       }
+       p.clear_patron_bills = p.list_box.clear_rows;
 
        sdump('D_TRACE_EXIT',arg_dump(arguments));
        return p;
 }
 
-function cols() {
-       sdump('D_PATRON_BILLS',arg_dump(arguments,{1:true}));
-       for (var i = 0; i < p.mbts_cols.length; i++) {
-                var hash = p.mbts_cols[i];
-                var obj_string = 'mbts';
-                var cmd = parse_render_string( obj_string, hash.fm_field_render );
-                var col = '';
-                try {
-                        col = eval( cmd );
-                } catch(E) {
-                        sdump('D_ERROR',js2JSON(E) + '\n');
-                }
-               var label = p.w.document.createElement('label');
-               row.appendChild( label );
-               label.setAttribute('value',col);
-       }       
+function list_box_init( p ) {
+       var listbox = p.w.document.createElement('listbox');
+       p.node.appendChild( listbox );
+       listbox.setAttribute('flex','1');
+
+               var listhead = p.w.document.createElement('listhead');
+               listbox.appendChild( listhead );
+
+               var listcols = p.w.document.createElement('listcols');
+               listbox.appendChild( listcols );
+
+                       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) {
+
+               var listitem = p.w.document.createElement('listitem');
+               listbox.appendChild( listitem );
+               listitem.setAttribute('allowevents','true');
+               var idx = 0;
+               if (typeof(cols[0]) == 'string') {
+
+                       listitem.setAttribute('label',cols[0]);
+                       idx = 1;
+               }
+               for (var i = idx; i < cols.length; i++) {
+
+                       try {
+                               listitem.appendChild( cols[i] );
+                       } catch(E) {
+                               sdump('D_ERROR', cols[i] + '\n' + E + '\n');
+                       }
+               }
+       }
+
+       p.clear_rows = function () {
+               var nl = listbox.getElementsByTagName('listitem');
+               for (var i = 0; i < nl.length; i++) {
+                       listbox.removeChild(nl[i]);
+               }
+
+       }
+
+       return p;
 }
 
 function patron_bills_add_patron_bills(p, bills) {
        sdump('D_PATRON_BILLS',arg_dump(arguments,{1:true}));
-       // grid_columns: checkbox, line item, bill amount, payment
 
        var obj_string ='mbts';
 
@@ -81,13 +115,39 @@ function patron_bills_add_patron_bills(p, bills) {
 
                var mbts = bills[i];
 
-               var row = p.w.document.createElement('row');
-               p.grid_list.add_rows( [ row ] );
+               var cols = [];
 
-               for (var j = 0; j < p.patron_bills_cols.length; i++) {
+               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');
+                       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',js2JSON(E) + '\n');
+                               }
+                               listcell.setAttribute('label',col);
+                       }
+                       if (hash.render_xul) {
+                               var xul = p.w.document.createElement( hash.render_xul );
+                               listcell.appendChild( xul );
+                       }
+                       if ( (j == 0) && (window.navigator.userAgent.match( /Firefox/ )) ) {
+                               cols.push( col );
+                       } else {
+                               cols.push( listcell );
                        }
                }
+               p.list_box.add_row( cols );
        }
 }
index 760918f..efb1bee 100755 (executable)
@@ -18,7 +18,7 @@ function patron_display_init(p) {
        patron_display_patron_holds_init(p);
 
        // gives: p.patron_bills, p.redraw_patron_bills
-       //patron_display_patron_bills_init(p);
+       patron_display_patron_bills_init(p);
 
        p.set_patron = function (au) {
                return p._patron = au;
@@ -29,7 +29,7 @@ function patron_display_init(p) {
                p.redraw_patron_checkout_items();
                p.redraw_patron_items();
                p.redraw_patron_holds();
-               //p.redraw_patron_bills();
+               p.redraw_patron_bills();
                return render_fm(p.w.document, { 'au' : p._patron });
        }
 
index e81df12..55dbf6f 100755 (executable)
@@ -14,7 +14,7 @@
                        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('GridList_main');
+                       params.patron_bills_node = document.getElementById('PatronBills_main');
                        params.commandset_node = document.getElementById('universal_cmds');
                        mw.focus_widget( document, 'patron_checkout_barcode_entry_textbox' );
                        mw.OpenILS_init(params);
index 0a7669d..2c3a1e6 100755 (executable)
@@ -6,7 +6,6 @@
        <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/main/grid_list_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"?>
@@ -58,7 +57,7 @@
        </groupbox>
        <groupbox id="cssdgb4">
                <caption id="cssdgb4c" label="&patron_navbar.bills;"/>
-               <box id="GridList_main" />
+               <box id="PatronBills_main" />
        </groupbox>
        <box id="PatronEdit_main"><label value="edit" /></box>
        <box id="PatronInfo_main"><label value="info" /></box>
index 19588b2..b5c7b99 100644 (file)
@@ -21,6 +21,7 @@ var sdump_levels = {
        'D_CLAM' : false,
        'D_PAGED_TREE' : false,
        'D_GRID_LIST' : false,
+       'D_HTML_TABLE' : true,
        'D_TAB' : false,
 
        'D_AUTH' : false,
@@ -45,7 +46,7 @@ var sdump_levels = {
 
        'D_CAT' : false,
 
-       'D_PATRON_UTILS' : true,
+       'D_PATRON_UTILS' : false,
        'D_CIRC_UTILS' : false,
 
        'D_EXPLODE' : false,
index 85801fb..7402b97 100644 (file)
@@ -1,5 +1,5 @@
 <!ENTITY auth.title "Evergreen Staff Client Pre-Alpha">
-<!ENTITY auth.version "Evergreen 0.0.9 2005071519">
+<!ENTITY auth.version "Evergreen 0.0.9 2005071911">
 
 <!ENTITY auth.login_header "Login">
 <!ENTITY auth.name_prompt "Name:"><!ENTITY auth.name_prompt.key "N">