more web work
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Jul 2005 16:32:16 +0000 (16:32 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Jul 2005 16:32:16 +0000 (16:32 +0000)
added classes to web fieldmapper

updated method.pm to use the right param names (in case it's ever used again)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1312 dcc99617-32d9-48b4-a31d-7c20da2025e4

12 files changed:
Open-ILS/src/extras/fieldmapper.pl
Open-ILS/src/javascript/opac/AbstractRecordResultPage.js
Open-ILS/src/javascript/opac/HoldsWindow.js
Open-ILS/src/javascript/opac/MRResultPage.js
Open-ILS/src/javascript/opac/MyOPACSPage.js
Open-ILS/src/javascript/opac/Page.js
Open-ILS/src/javascript/opac/RecordResultPage.js
Open-ILS/src/javascript/opac/SearchBarFormChunk.js
Open-ILS/src/javascript/util/ils_utils.js
Open-ILS/src/perlmods/OpenILS/WWW/Method.pm
Open-ILS/src/templates/opac/pages/main.ttk
Open-ILS/src/templates/opac/pages/my_opac.ttk

index 72b55ae..f8dbca0 100755 (executable)
@@ -10,7 +10,7 @@ my $web = $ARGV[0];
 # List of classes needed by the opac
 my @web_hints = qw/ex mvr au aou aout asv asva asvr asvq 
                circ acp acpl acn ccs perm_ex ahn ahr aua ac 
-               actscecm crcd crmf crrf mus mbts/;
+               actscecm crcd crmf crrf mus mbts aoc aus/;
 
 print <<JS;
 
@@ -21,6 +21,8 @@ print <<JS;
 
 function Fieldmapper() {}
 
+var errorstr = "Attempt to build fieldmapper object with non-array";
+
 Fieldmapper.prototype.clone = function() {
        var obj = new this.constructor();
 
@@ -50,13 +52,11 @@ Fieldmapper.prototype.clone = function() {
        return obj;
 }
 
-
-
-function FieldmapperException(message) {
+function FMEX(message) {
        this.message = message;
 }
 
-FieldmapperException.toString = function() {
+FMEX.toString = function() {
        return "FieldmapperException: " + this.message + "\\n";
 
 }
@@ -83,11 +83,8 @@ function $short_name(a) {
        this.classname = "$short_name";
        this._isfieldmapper = true;
        if(a) { 
-               if( a.constructor == Array) 
-                       this.a = a;  
-               else
-                       throw new FieldmapperException(
-                               "Attempt to build fieldmapper object with non-array");
+               if( a.constructor == Array) this.a = a;  
+               else throw new FMEX(errorstr);
        } else this.a = [];
 }
 
@@ -99,7 +96,7 @@ for my $field (keys %{$map->{$object}->{fields}}) {
 my $position = $map->{$object}->{fields}->{$field}->{position};
 
 print <<JS;
-$short_name.prototype.$field = function(n) {if(arguments.length == 1) this.a[$position] = n; return this.a[$position]; }
+$short_name.prototype.$field=function(n){if(arguments.length == 1)this.a[$position]=n;return this.a[$position];}
 JS
 
 }
index 481d37a..1e99235 100644 (file)
@@ -432,6 +432,7 @@ AbstractRecordResultPage.prototype.mkAuthorLink = function(auth) {
                "&mr_search_depth=" + this.searchDepth +
                "&mr_search_location=" + this.searchLocation +
                "&location=" +  this.searchLocation +
+               "&format=" + this.format +
                "&depth=" +  this.searchDepth);
 
        href.appendChild(createAppTextNode(auth));
@@ -451,6 +452,7 @@ AbstractRecordResultPage.prototype.mkSeriesLink = function(series) {
                "&mr_search_depth=" + this.searchDepth +
                "&mr_search_location=" + this.searchLocation +
                "&location=" +  this.searchLocation +
+               "&format=" + this.format +
                "&depth=" +  this.searchDepth);
 
        href.appendChild(createAppTextNode(series));
@@ -467,6 +469,7 @@ AbstractRecordResultPage.prototype.mkSubjectLink = function(sub) {
                "&mr_search_depth=" + this.searchDepth +
                "&mr_search_location=" + this.searchLocation +
                "&location=" +  this.searchLocation +
+               "&format=" + this.format +
                "&depth=" +  this.searchDepth);
 
        href.appendChild(createAppTextNode(sub));
index 8d55cda..a813627 100644 (file)
@@ -64,8 +64,11 @@ HoldsWindow.prototype.sendHoldsRequest = function(formats, org, email, phone) {
                        alert("Please enter the user's barcode");
                }
                try {
-                       this.recipient = grabUserByBarcode(recip_barcode);
-               } catch(E) { alert(E.err_msg()); }
+                       var r = grabUserByBarcode(this.session, recip_barcode);
+                       debug("Done grabbing user");
+                       alert(js2JSON(r));
+                       this.recipient = r;
+               } catch(E) { if(E.err_msg) alert(E.err_msg()); else alert(E); }
        }
 
        var hold = new ahr();
@@ -99,11 +102,16 @@ HoldsWindow.prototype.buildWindow = function(node) {
        var id = this.record;
 
        var usr = this.recipient;
-       var barcodebox = null;
+       var barcodediv = null;
 
        if(isXUL()) {
                /* used by xul to enter the recipient barcode */
-               barcodebox = elem("input",{type:"text",id:"recipient_barcode"});
+               
+               var barcodediv = elem("div",{style:"margin-left: 10px"},null,"2. Enter User Barcode");
+               var barcodebox = elem("input",{style:"margin-left: 10px;", type:"text",id:"recipient_barcode"});
+               barcodediv.appendChild(barcodebox);
+               barcodediv.appendChild(elem("br"));
+
        } else {
 
                if(!usr) {
@@ -128,8 +136,10 @@ HoldsWindow.prototype.buildWindow = function(node) {
        if(this.type == "M")
                d.appendChild(this.buildResourceSelector());
 
-       if(barcodebox)
-               d.appendChild(barcodebox);
+       if(barcodediv) {
+               d.appendChild(elem("br"));
+               d.appendChild(barcodediv);
+       }
 
        d.appendChild(this.buildSubmit());
 
index e6260af..afbf309 100644 (file)
@@ -143,6 +143,7 @@ MRResultPage.prototype.mkLink = function(id, type, value, title) {
                                "?target=record_result&page=0&mrid=" + id + 
                                "&hits_per_page=" + this.hitsPerPage +
                                "&location=" + this.searchLocation +
+                               "&format=" + this.format + 
                                "&depth=" + this.searchDepth );
 
                        href.appendChild(createAppTextNode(value));
@@ -156,6 +157,7 @@ MRResultPage.prototype.mkLink = function(id, type, value, title) {
                                "?target=record_result&page=0&mrid=" + id +
                                "&hits_per_page=" + this.hitsPerPage +
                                "&location=" + this.searchLocation +
+                               "&format=" + this.format + 
                                "&depth=" + this.searchDepth );
 
                        href.title = "View titles for " + t + "";
@@ -167,7 +169,9 @@ MRResultPage.prototype.mkLink = function(id, type, value, title) {
                        add_css_class(href,"record_result_author_link");
                        href.setAttribute("href",
                                "?target=mr_result&mr_search_type=author&page=0&mr_search_query=" +
-                            encodeURIComponent(value));
+                            encodeURIComponent(value) + 
+                                       "&format=" + this.format );
+
                        href.appendChild(createAppTextNode(value));
                        href.title = "Author search for " + t + "";
                        break;
@@ -362,9 +366,9 @@ MRResultPage.prototype.checkSpelling = function() {
 
                var ref = elem("a", 
                        {
-                               href: "?target=mr_result&mr_search_type=" + 
-                                       this.stype + "&page=0&mr_search_query=" +
-                                       encodeURIComponent(response)
+                               href: "?target=mr_result&mr_search_type=" + this.stype + 
+                                       "&page=0&mr_search_query=" + encodeURIComponent(response) +
+                                       "&format=" + this.format
                        } 
                );
 
index 9e2badd..368cc41 100644 (file)
@@ -26,6 +26,7 @@ MyOPACSPage.prototype.draw = function(type) {
 
        this.infoPane = getById("my_opac_info_pane");
        this.infoTable = getById("my_opac_info_table");
+
        /*
        removeChildren(this.infoPane);
        removeChildren(this.infoTable);
@@ -98,18 +99,18 @@ MyOPACSPage.prototype.drawFines = function() {
        removeChildren(this.infoPane);
        this.infoPane.appendChild(this.infoTable);
        this.setLink(this.finesCell);
+       this._drawFines();
 }
 
 function _drawCheckedOut(obj, data) {
 
        if(data == null) return;
-       //obj.infoPane.appendChild(obj.infoTable);
        var circRow = obj.infoTable.insertRow(obj.infoTable.rows.length);
 
-       var tcell = circRow.insertCell(circRow.cells.length)
-       tcell.appendChild(mktext("Title"));
        var dcell = circRow.insertCell(circRow.cells.length);
        dcell.appendChild(mktext("Due Date"));
+       var tcell = circRow.insertCell(circRow.cells.length)
+       tcell.appendChild(mktext("Title"));
        var drcell = circRow.insertCell(circRow.cells.length);
        drcell.appendChild(mktext("Duration"));
        var bcell = circRow.insertCell(circRow.cells.length);
@@ -147,46 +148,14 @@ function _drawCheckedOut(obj, data) {
 
 
                var due = circ.due_date();
-               //due = due.substring(0,10) + "T" + due.substring(12,due.length);
                due = due.replace(/[0-9][0-9]:.*$/,"");
 
-               /*
-               var year = parseInt(due.substring(0,4)) - 1900; 
-               var month =  parseInt(due.substring(5,7)) - 1;
-               var day = parseInt(due.substring(8,10));
-
-               //alert(parseInt(due.substring(0,4)) + " " + parseInt(due.substring(5,7))  + " " + parseInt(due.substring(8,10)));
-
-               //alert(year + " " + month + " "  + day);
-
-               var date = new Date(year, month, day, 0, 0, 0);
-               due = date.toString();
-               //due = due.replace(/[0-9][0-9]:.*$/,"");
-               */
-
-               //alert(date);
-               /*
-               alert(due);
-               due = new Date(due);
-               alert(due);
-               */
-
-               /*
-               alert(circ.due_date());
-               alert(new Date(circ.due_date()));
-               */
-
                var title_href = createAppElement("a");
                var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath;
                title_href.setAttribute("href", prefix + "?sub_frame=1&target=record_detail&record=" + record.doc_id() );
                title_href.setAttribute("target","_top"); /* escape to the outermost frame */
                title_href.appendChild(mktext(record.title()));
 
-               /*
-               var renewbox = elem("input", 
-                       {type:"checkbox", id:"renew_checkbox_" + record.doc_id()});
-                       */
-
                var renewboxlink = mktext("N/A");
                if(parseInt(circ.renewal_remaining()) > 0)
                        renewboxlink = buildRenewBoxLink(circ);
@@ -196,8 +165,8 @@ function _drawCheckedOut(obj, data) {
                org = org.name();
 
                /* for each circulation, build a row of data */
-               var titleCell                   = circRow.insertCell(circRow.cells.length);
                var dueCell                             = circRow.insertCell(circRow.cells.length);
+               var titleCell                   = circRow.insertCell(circRow.cells.length);
                var durationCell                = circRow.insertCell(circRow.cells.length);
                var barcodeCell         = circRow.insertCell(circRow.cells.length);
                var circLibCell         = circRow.insertCell(circRow.cells.length);
@@ -247,9 +216,7 @@ function renewCheckout(circ) {
                globalmyopac.user.session_id, circ );
        req.send(true);
 
-       try{var ret = req.getResultObject();}catch(E){return;}
-
-       //alert(js2JSON(ret));
+       try{req.getResultObject();}catch(E){return;}
        alert("Renewal completed successfully");
        globalmyopac.draw("checked");
 }
@@ -710,6 +677,10 @@ MyOPACSPage.prototype._drawHolds = function() {
 
        var cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_info_table_header");
+       cell.appendChild(mktext("Request Date"));
+
+       cell = row.insertCell(row.cells.length);
+       add_css_class(cell, "my_opac_info_table_header");
        cell.appendChild(mktext("Title"));
 
        cell = row.insertCell(row.cells.length);
@@ -720,13 +691,18 @@ MyOPACSPage.prototype._drawHolds = function() {
        add_css_class(cell, "my_opac_info_table_header");
        cell.appendChild(mktext("Format(s)"));
 
+
        cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_info_table_header");
-       cell.appendChild(mktext("Pickup Location"));
+       cell.appendChild(mktext("Notify Email / Phone"));
 
        cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_info_table_header");
-       cell.appendChild(mktext("Notify Email / Phone"));
+       cell.appendChild(mktext("Status"));
+
+       cell = row.insertCell(row.cells.length);
+       add_css_class(cell, "my_opac_info_table_header");
+       cell.appendChild(mktext("Pickup Location"));
 
        cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_info_table_header");
@@ -734,18 +710,27 @@ MyOPACSPage.prototype._drawHolds = function() {
 
        /* ---------------------------------------- */
        row = table.insertRow(table.rows.length);
+       row.id = "holds_waiting";
        cell = row.insertCell(row.cells.length);
        cell.appendChild(mktext("Retrieving holds..."));
        /* ---------------------------------------- */
 
        var holds = this.grabHolds();
-       table.firstChild.removeChild(table.firstChild.childNodes[1]);
 
        for( var idx = 0; idx != holds.length; idx++ ) {
-               debug("Displaying hold " + holds[idx].id());
-               _doCallbackDance(table, holds[idx], this.user.session_id, this);
+               var hold = holds[idx];
+               var r = table.insertRow(table.rows.length);
+               r.id = "hold_display_row_" + hold.id();
+               debug("Displaying hold " + hold.id());
+               _doCallbackDance(table, hold, this.user.session_id, this);
+       }
+
+       if(!holds || holds.length == 0) {
+               var z = getById("holds_waiting");
+               z.firstChild.innerHTML = "No holds currently placed";
        }
 
+
 }
 
 function _doCallbackDance(table, hold, session_id, obj) {
@@ -767,9 +752,16 @@ function _drawHoldsRow(table, hold, record, session_id, obj) {
        if(record == null || record.length == 0) return;
        debug("In holds callback with hold " + hold );
 
-       var row = table.insertRow(table.rows.length);
+       //var row = table.insertRow(table.rows.length);
+       var row = getById("hold_display_row_" + hold.id());
+
        var cell = row.insertCell(row.cells.length);
+       add_css_class(cell, "my_opac_profile_cell");
+       var t = hold.request_time().replace(/[0-9][0-9]:.*$/,"");
+       cell.appendChild(mktext(t));
 
+
+       cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_profile_cell");
        cell.style.width = "35%";
 
@@ -778,7 +770,6 @@ function _drawHoldsRow(table, hold, record, session_id, obj) {
                        {href:prefix + "?sub_frame=1&target=record_detail&record="+encodeURIComponent(record.doc_id())},
                        null, record.title());
        tl.setAttribute("target","_top");
-       //cell.appendChild(mktext(record.title()));
        cell.appendChild(tl);
 
        cell = row.insertCell(row.cells.length);
@@ -790,7 +781,6 @@ function _drawHoldsRow(table, hold, record, session_id, obj) {
        al.setAttribute("target","_top");
        add_css_class(cell, "my_opac_profile_cell");
 
-       //cell.appendChild(mktext(record.author()));
        cell.appendChild(al);
 
        cell = row.insertCell(row.cells.length);
@@ -804,9 +794,6 @@ function _drawHoldsRow(table, hold, record, session_id, obj) {
        cell.noWrap = "nowrap";
        cell.setAttribute("nowrap", "nowrap");
 
-       cell = row.insertCell(row.cells.length);
-       add_css_class(cell, "my_opac_profile_cell");
-       cell.appendChild(mktext(findOrgUnit(hold.pickup_lib()).name()));
 
        cell = row.insertCell(row.cells.length);
        add_css_class(cell, "my_opac_profile_cell");
@@ -815,11 +802,37 @@ function _drawHoldsRow(table, hold, record, session_id, obj) {
        cell.appendChild(_buildChangePhoneNotify(hold));
 
        cell = row.insertCell(row.cells.length);
+       add_css_class(cell, "my_opac_profile_cell");
+       var stat = _fetchHoldStatus(hold);
+       cell.appendChild(mktext(stat));
+
+       cell = row.insertCell(row.cells.length);
+       add_css_class(cell, "my_opac_profile_cell");
+       cell.appendChild(mktext(findOrgUnit(hold.pickup_lib()).name()));
+       
+       cell = row.insertCell(row.cells.length);
        var a = elem("a",{href:"javascript:void(0);",
                        style:"text-decoration:underline"},null, "Cancel");
        a.onclick = function(){_cancelHoldRequest(hold, a, session_id, obj);};
        add_css_class(cell, "my_opac_profile_cell");
        cell.appendChild(a);
+
+       var z = getById("holds_waiting");
+       if(z) table.firstChild.removeChild(z);
+}
+
+function _fetchHoldStatus(hold) {
+       var req = new RemoteRequest(
+               "open-ils.circ",
+               "open-ils.circ.hold.status.retrieve",
+               globalmyopac.user.session_id, hold.id());
+       req.send(true);
+       var stat = req.getResultObject();
+       if(stat == "1") stat = "Waiting for available copy";
+       if(stat == "2") stat = "Copy found, waiting for capture";
+       if(stat == "3") stat = "In Transit";
+       if(stat == "4") stat = "Available";
+       return stat;
 }
 
 
@@ -1296,9 +1309,8 @@ MyOPACSPage.prototype._addCircs = function(data) {
 
                /* for each circulation, build a small table of data */
                var table = createAppElement("table");
-               this._mkCircRow(table, "Title",         title_href);
-               //this._mkCircRow(table, "Due Date",    mktext(due));
                this._mkCircRow(table, "Due Date",      mktext(due));
+               this._mkCircRow(table, "Title",         title_href);
                this._mkCircRow(table, "Duration",      mktext(circ.duration()));
                this._mkCircRow(table, "Barcode",       mktext(copy.barcode()));
                this._mkCircRow(table, "Circulating Library", mktext(org));
@@ -1332,4 +1344,189 @@ MyOPACSPage.prototype._getOrgUnit = function(org_id) {
 }
 
 
+var showTransactions = false;
+MyOPACSPage.prototype._drawFines = function() {
+       this.drawFinesSummary();
+       this.infoPane.appendChild(elem("hr"));
+       this.infoPane.appendChild(elem("br"));
+       if(showTransactions) this.drawTransactions();
+}
+
+
+MyOPACSPage.prototype.drawFinesSummary = function() {
+
+       var bigt = this.infoTable;
+       var table = elem("table");
+       bigt.insertRow(0).insertCell(0).appendChild(table);
+
+       var title = table.insertRow(table.rows.length);
+       var tcell = title.insertCell(0);
+       tcell.setAttribute("style", "font-weight: bolder");
+       tcell.appendChild(mktext("Fines Summary"));
+
+       var torow = table.insertRow(table.rows.length);
+       var tprow = table.insertRow(table.rows.length);
+       var borow = table.insertRow(table.rows.length);
+
+       var to = torow.insertCell(torow.cells.length);   
+       var tp = tprow.insertCell(tprow.cells.length);   
+       var bo = borow.insertCell(borow.cells.length);   
+
+       add_css_class(to, "my_opac_info_table_header");
+       add_css_class(tp, "my_opac_info_table_header");
+       add_css_class(bo, "my_opac_info_table_header");
+
+       to.appendChild(mktext("Total Amount Owed"));
+       tp.appendChild(mktext("Total Amoun Paid"));
+       bo.appendChild(mktext("* Balance Owed"));
+
+       to = torow.insertCell(torow.cells.length);       
+       tp = tprow.insertCell(tprow.cells.length);       
+       bo = borow.insertCell(borow.cells.length);       
+
+       add_css_class(to, "my_opac_profile_cell");
+       add_css_class(tp, "my_opac_profile_cell");
+       add_css_class(bo, "my_opac_profile_cell");
+       
+       var summary = grabUserFinesSummary(
+               globalmyopac.user.session_id, globalmyopac.user.userObject.id());
+
+       var owed; 
+       var paid; 
+       var bowed;
+
+       if(instanceOf(summary, mus)) {
+               showTransactions = true;
+               owed = _finesFormatNumber(summary.total_owed());
+               paid = _finesFormatNumber(summary.total_paid());
+               bowed = _finesFormatNumber(summary.balance_owed());
+
+       } else {
+               showTransactions = false;
+               owed = _finesFormatNumber("0.00");
+               paid = _finesFormatNumber("0.00");
+               bowed = _finesFormatNumber("0.00");
+       }
+
+       to.appendChild(mktext(owed));
+       tp.appendChild(mktext(paid));
+       bo.appendChild(mktext(bowed));
+
+}
+
+function _finesFormatNumber(num) {
+       if(num.length == "1" || !num.match(/\./)) num += ".00";
+       num = "$" + num;
+       return num;
+}
+
+
+MyOPACSPage.prototype.drawTransactions = function() {
+       var table = elem("table");
+       var d = elem("div", {style:"font-weight: bolder"}, null, "Summary of Charges");
+       this.infoPane.appendChild(d);
+       this.infoPane.appendChild(table);
+
+       var row = table.insertRow(table.rows.length);
+
+       var cella = row.insertCell(row.cells.length);
+       var cellb = row.insertCell(row.cells.length);
+       var cellc = row.insertCell(row.cells.length);
+       var celld = row.insertCell(row.cells.length);
+       var celle = row.insertCell(row.cells.length);
+       var cellf = row.insertCell(row.cells.length);
+       var cellg = row.insertCell(row.cells.length);
+
+       add_css_class(cella, "my_opac_info_table_header");
+       add_css_class(cellb, "my_opac_info_table_header");
+       add_css_class(cellc, "my_opac_info_table_header");
+       add_css_class(celld, "my_opac_info_table_header");
+       add_css_class(celle, "my_opac_info_table_header");
+       add_css_class(cellf, "my_opac_info_table_header");
+       add_css_class(cellg, "my_opac_info_table_header");
+
+       cella.appendChild(mktext("Transaction Start Time"));
+       cellb.appendChild(mktext("Last Billing Time"));
+       cellc.appendChild(mktext("Last Payment Time"));
+       celld.appendChild(mktext("Initial Amount Owed"));
+       celle.appendChild(mktext("Total Amount Paid"));
+       cellf.appendChild(mktext("* Balance Owed"));
+       cellg.appendChild(mktext("Type"));
+
+       var transactions = grabUserTransactions(
+                globalmyopac.user.session_id, globalmyopac.user.userObject.id());
+
+       for( var t in transactions ) _addTransactionRow(table, transactions[t]);
+
+}
+
+
+function _addTransactionRow(table, transaction) {
+
+       var trans = transaction.transaction;
+       var circ = transaction.circ;
+       var record = transaction.record;
+
+       var row = table.insertRow(table.rows.length);
+       var cella = row.insertCell(row.cells.length);
+       var cellb = row.insertCell(row.cells.length);
+       var cellc = row.insertCell(row.cells.length);
+       var celld = row.insertCell(row.cells.length);
+       var celle = row.insertCell(row.cells.length);
+       var cellf = row.insertCell(row.cells.length);
+       var cellg = row.insertCell(row.cells.length);
+
+       add_css_class(cella, "my_opac_profile_cell");
+       add_css_class(cellb, "my_opac_profile_cell");
+       add_css_class(cellc, "my_opac_profile_cell");
+       add_css_class(celld, "my_opac_profile_cell");
+       add_css_class(celle, "my_opac_profile_cell");
+       add_css_class(cellf, "my_opac_profile_cell");
+       add_css_class(cellg, "my_opac_profile_cell");
+
+       var owed = _finesFormatNumber(trans.total_owed());
+       var paid = _finesFormatNumber(trans.total_paid());
+       var bowed = _finesFormatNumber(trans.balance_owed());
+
+       var stime = _trimSeconds(trans.xact_start());
+       var last_bill = _trimSeconds(trans.last_billing_ts());
+       var last_payment = _trimSeconds(trans.last_payment_ts());
+
+       cella.appendChild(mktext(stime));
+       cellb.appendChild(mktext(last_bill));
+       cellc.appendChild(mktext(last_payment));
+       celld.appendChild(mktext(owed));
+       celle.appendChild(mktext(paid));
+       cellf.appendChild(mktext(bowed));
+       cellg.appendChild(mktext(trans.xact_type()));
+
+
+}
+
+function _trimSeconds(time) { if(!time) return ""; return time.replace(/\..*/,""); }
+
+function grabUserTransactions(session, usrid) {
+       var req = new RemoteRequest(
+               "open-ils.actor",
+               "open-ils.actor.user.transactions.have_charge.fleshed",
+               session, usrid );
+       req.send(true);
+       return req.getResultObject();
+}
+
+
+function grabUserFinesSummary(session, usrid) {
+       var req = new RemoteRequest(
+               "open-ils.actor",
+               "open-ils.actor.user.fines.summary",
+               session, usrid );
+       req.send(true);
+       return req.getResultObject();
+}
+
+
+
+
+
+
 
index 07eb0d8..3777138 100644 (file)
@@ -136,6 +136,7 @@ Page.prototype.resetRange = function() {
                                        "mr_search_query",              lastSearchString,
                                        "mr_search_location",   location,
                                        "mr_search_depth",              globalSearchDepth,      
+                                       "format",                                       paramObj.__format, 
                                        "page",                                         0
                                        ] );
                }
@@ -211,8 +212,10 @@ Page.prototype.buildNavBox = function(full) {
        arr.push(elem("a", {href: prefix + '?target=advanced_search'}, null, "Advanced Search"));
 
 
-       var mylink = elem("a", {href: "?target=my_opac"}, null, "My OPAC");
-       arr.push(mylink);
+       if(!isXUL()) {
+               var mylink = elem("a", {href: "?target=my_opac"}, null, "My OPAC");
+               arr.push(mylink);
+       }
 
        /* if user is not logged in, popup the login dialog when they
                select the myopac link */
index 33fa4d0..478156f 100644 (file)
@@ -210,7 +210,7 @@ RecordResultPage.prototype.doSearch = function() {
        if(recordResultRedirect) { 
                /* if the user is just hitting the 'back' button */
                recordResultRedirect = false;
-               history.back();
+               history.go(-1);
                return;
        }
 
@@ -355,13 +355,14 @@ RecordResultPage.prototype.mrSearch = function(mrid) {
                                                recordResultRedirect = true;
                                                debug("Redirecting to record detail page with record " + obj.recordIDs[0] );
                                        url_redirect( [
+                                                       "goto",         "-2",
                                                        "target", "record_detail",
                                                        "record", obj.recordIDs[0] ] );
                                                return;
                                        }
                                } else { 
                                        recordResultRedirect = false;
-                                       history.back();
+                                       history.go(-1);
                                }
 
                                obj.collectRecords();
index 82f9b27..6b2d752 100644 (file)
@@ -14,7 +14,6 @@ SearchBarFormChunk.prototype.init = function() {
        this.search_query                       = getById("mr_search_query");
        this.search_type                        = getById("mr_search_type");
        this.search_button              = getById("mr_search_button");
-       this.searchRange                        = getById("search_range_select");
        this.setFormat();
 }
 
@@ -37,7 +36,6 @@ SearchBarFormChunk.prototype.resetPage = function() {
        this.init();
 
        this.search_button.onclick              = mrSearchSubmitForm;
-
        this.search_query.onkeydown     = mrSearchSubmitOnEnter;
        this.search_type.onkeydown              = mrSearchSubmitOnEnter;
 
@@ -50,8 +48,6 @@ SearchBarFormChunk.prototype.resetPage = function() {
 
        try{ this.search_query.focus(); } catch(E) {}
 
-//     this.resetRange();
-
 }
 
 
@@ -62,11 +58,8 @@ function mrSearchSubmitForm() {
        var search_type         = getById("mr_search_type").value;
        var form                                        = getById("mr_search_format").value 
 
-       /*
-       var fsel                                        = getById("mr_search_format");
-       var form                                        = fsel.options[fsel.selectedIndex].value 
-       */
-
+       if(search_query == null || search_query == "")
+               return false;
 
        var depth = globalSearchDepth;
        var location = globalSelectedLocation;
index 0d0b6b6..478b081 100644 (file)
@@ -337,14 +337,15 @@ function cleanISBN(isbn) {
 }
 
 
-function grabUserByBarcode(barcode) {
+function grabUserByBarcode(login, barcode) {
        if(!barcode) return null;
        var req = new RemoteRequest(
                "open-ils.actor",
                "open-ils.actor.user.fleshed.retrieve_by_barcode",
-               barcode );
+               login, barcode );
 
-       return req.send(true).getResultObject();
+       req.send(true);
+       return req.getResultObject();
 }
 
 
index c870432..5d8678a 100644 (file)
@@ -56,8 +56,8 @@ sub handler {
 
        warn "here\n";
 
-       if(defined($cgi->param("__param"))) {
-               for my $param ( $cgi->param("__param")) {
+       if(defined($cgi->param("param"))) {
+               for my $param ( $cgi->param("param")) {
                        push( @param_array, JSON->JSON2perl( $param ));
                }
        } else {
index 1fe4a22..5ce1ad7 100644 (file)
@@ -15,7 +15,7 @@
                <frameset cols='100%'>
 
                        <frame
-                               style                   = "border:0px;" 
+                               style                   = "border:0px; overflow:auto
                                frameborder     = '0' 
                                scrolling       = 'yes'
                                name                    = 'appframe' 
index 13a1db3..5fecfbf 100644 (file)
@@ -21,7 +21,7 @@
 
                        WRAPPER html/iframe
                                frameborder     = '0' 
-                               style       = 'border:none;'
+                               style       = 'border:none; overflow:auto'
                                scrolling       = 'yes'
                width       = '100%'
                                #height         = '500'