added holds cancellation to myopac
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Nov 2005 16:05:32 +0000 (16:05 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Nov 2005 16:05:32 +0000 (16:05 +0000)
set remote request to dev.gapines.org for XUL for now

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

Open-ILS/web/opac/common/js/RemoteRequest.js
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/opac/skin/default/js/myopac.js
Open-ILS/web/opac/skin/default/xml/myopac_holds.xml
Open-ILS/web/opac/skin/default/xml/rdetail_altcanvas.xml

index c01adcf..65b9cfd 100644 (file)
@@ -1,5 +1,5 @@
 var XML_HTTP_GATEWAY = "gateway";
-var XML_HTTP_SERVER = "gapines.org";
+var XML_HTTP_SERVER = "dev.gapines.org";
 var XML_HTTP_MAX_TRIES = 3;
 
 //var IAMXUL = false;
@@ -159,6 +159,12 @@ RemoteRequest.prototype.send = function(blocking) {
                url +=  "?" + this.param_string; 
        }
 
+
+       try {
+               dump( 'Remote Request URL: ' + url + '\n');
+       } catch(E){}
+
+
        if(blocking) {
                this.xmlhttp.open(this.type, url, false);
        } else {
@@ -172,6 +178,10 @@ RemoteRequest.prototype.send = function(blocking) {
                                'application/x-www-form-urlencoded');
        }
 
+       try {
+               dump( 'Remote Request URL: ' + url + '\n');
+       } catch(E){}
+
        try{ this.xmlhttp.send( data ); } catch(e){}
 
        this.sendCount += 1;
index 585d874..15d8b30 100644 (file)
@@ -195,6 +195,7 @@ var FETCH_FINES_SUMMARY                     = "open-ils.actor:open-ils.actor.user.fines.summary";
 var FETCH_TRANSACTIONS                 = "open-ils.actor:open-ils.actor.user.transactions.have_charge.fleshed";
 var FETCH_CROSSREF                             = "open-ils.search:open-ils.search.authority.crossref";
 var CREATE_HOLD                                        = "open-ils.circ:open-ils.circ.holds.create";
+var CANCEL_HOLD                                        = "open-ils.circ:open-ils.circ.hold.cancel";
 /* ---------------------------------------------------------------------------- */
 
 
index d38ad8b..2659dc1 100644 (file)
@@ -63,4 +63,4 @@
 <!ENTITY rdetail.loading "Loading copy infomation...">
 <!ENTITY rdetail.noneAvailable " * There are no copies in this location">
 <!ENTITY rdetail.detailMain.viewMarc "View MARC">
-<!ENTITY rdetail.detailMain.hideMarc "Return to title summary view">
+<!ENTITY rdetail.detailMain.hideMarc "Return to title details">
index 27bf445..30bceac 100644 (file)
@@ -118,11 +118,11 @@ function myOPACDrawCheckedOut(r) {
                var due = circ.due_date();
       due = due.replace(/[0-9][0-9]:.*$/,"");
 
-               var tlink = findNodeByName( row, "myopac_checked_title_link" );
-               var alink = findNodeByName( row, "myopac_checked_author_link" );
-               var dlink = findNodeByName( row, "myopac_checked_due" );
-               var rlink = findNodeByName( row, "myopac_checked_renewals" );
-               var rnlink = findNodeByName( row, "myopac_checked_renew_link" );
+               var tlink = $n( row, "myopac_checked_title_link" );
+               var alink = $n( row, "myopac_checked_author_link" );
+               var dlink = $n( row, "myopac_checked_due" );
+               var rlink = $n( row, "myopac_checked_renewals" );
+               var rnlink = $n( row, "myopac_checked_renew_link" );
 
                buildTitleDetailLink(record, tlink);
                buildSearchLink(STYPE_AUTHOR, record.author(), alink);
@@ -143,12 +143,19 @@ function myOPACShowHolds() {
        req.send();
 }
 
+var holdsTemplateRowOrig;
 var holdsTemplateRow;
 function myOPACDrawHolds(r) {
 
        var tbody = $("myopac_holds_tbody");
        if(holdsTemplateRow) return;
-       holdsTemplateRow = tbody.removeChild($("myopac_holds_row"));
+       if(holdsTemplateRowOrig) {
+               holdsTemplateRow = holdsTemplateRowOrig;
+               removeChildren(tbody);
+       } else {
+               holdsTemplateRow = tbody.removeChild($("myopac_holds_row"));
+               holdsTemplateRowOrig = holdsTemplateRow;
+       }
 
        hideMe($('myopac_holds_loading'));
 
@@ -162,23 +169,36 @@ function myOPACDrawHolds(r) {
                row.id = "myopac_holds_row_" + h.target();
 
                var formats = (h.holdable_formats()) ? h.holdable_formats() : null;
-               var form = findNodeByName(row, "myopac_holds_formats");
+               var form = $n(row, "myopac_holds_formats");
                form.id = "myopac_holds_form_" + h.target();
                if(formats) form.appendChild(text(formats));
 
-               findNodeByName(row, "myopac_holds_location").
+               $n(row, "myopac_holds_location").
                        appendChild(text(findOrgUnit(h.pickup_lib()).name()));
-               findNodeByName(row, "myopac_holds_email_link").
+               $n(row, "myopac_holds_email_link").
                        appendChild(text(h.email_notify()));
-               findNodeByName(row, "myopac_holds_phone_link").
+               $n(row, "myopac_holds_phone_link").
                        appendChild(text(h.phone_notify()));
                tbody.appendChild(row);
+
+               $n(row,'myopac_holds_cancel_link').setAttribute(
+                       'href','javascript:myOPACCancelHold("'+ h.id()+'");'); 
                unHideMe(row);
 
                myOPACDrawHoldTitle(h);
        }
 }
 
+function myOPACCancelHold(holdid) {
+       if( confirm($('myopac_holds_cancel_verify').innerHTML) ) {
+               holdsCancel(holdid);
+               holdsTemplateRow = null
+               myOPACShowHolds();
+       }
+}
+
+
+
 function myOPACDrawHoldTitle(hold) {
        var method;
        if(hold.hold_type() == "M") method = FETCH_MRMODS;
@@ -192,8 +212,8 @@ function myOPACFleshHoldTitle(r) {
 
        var record = r.getResultObject();
        var row = $("myopac_holds_row_" + record.doc_id());
-       var title_link = findNodeByName(row, "myopac_holds_title_link");
-       var author_link = findNodeByName(row, "myopac_holds_author_link");
+       var title_link = $n(row, "myopac_holds_title_link");
+       var author_link = $n(row, "myopac_holds_author_link");
 
        buildTitleDetailLink(record, title_link);
        buildSearchLink(STYPE_AUTHOR, record.author(), author_link);
@@ -269,24 +289,24 @@ function myOPACShowTransactions(r) {
                var record = transactions[idx].record;
                var row = transTemplate.cloneNode(transTemplate);
 
-               findNodeByName(row,'myopac_trans_start').
+               $n(row,'myopac_trans_start').
                        appendChild(text(_trimSeconds(trans.xact_start())));
-               findNodeByName(row,'myopac_trans_last_bill').
+               $n(row,'myopac_trans_last_bill').
                        appendChild(text(_trimSeconds(trans.last_billing_ts())));
-               findNodeByName(row,'myopac_trans_last_payment').
+               $n(row,'myopac_trans_last_payment').
                        appendChild(text(_trimSeconds(trans.last_payment_ts())));
-               findNodeByName(row,'myopac_trans_init_amount').
+               $n(row,'myopac_trans_init_amount').
                        appendChild(text(_finesFormatNumber(trans.total_owed())));
-               findNodeByName(row,'myopac_trans_total_paid').
+               $n(row,'myopac_trans_total_paid').
                        appendChild(text(_finesFormatNumber(trans.total_paid())));
-               findNodeByName(row,'myopac_trans_balance').
+               $n(row,'myopac_trans_balance').
                        appendChild(text(_finesFormatNumber(trans.balance_owed())));
 
                var extra = "";
                var type = trans.xact_type();
-               findNodeByName(row,'myopac_trans_type').appendChild(text(type));
+               $n(row,'myopac_trans_type').appendChild(text(type));
                if( type == "circulation" ) extra = record.title();
-               findNodeByName(row, 'myopac_trans_extra').appendChild(text(extra));
+               $n(row, 'myopac_trans_extra').appendChild(text(extra));
 
                tbody.appendChild(row);
        }
@@ -333,13 +353,13 @@ function _myOPACSummaryShowUer(r) {
 }
 
 function myOPACDrawAddr(row, addr) {
-       findNodeByName(row, 'myopac_addr_type').appendChild(text(addr.address_type()));
+       $n(row, 'myopac_addr_type').appendChild(text(addr.address_type()));
        var street = (addr.street2()) ? addr.street1() + ", " + addr.street2() : addr.street1();
-       findNodeByName(row, 'myopac_addr_street').appendChild(text(street));
-       findNodeByName(row, 'myopac_addr_city').appendChild(text(addr.city()));
-       findNodeByName(row, 'myopac_addr_county').appendChild(text(addr.county()));
-       findNodeByName(row, 'myopac_addr_state').appendChild(text(addr.state()));
-       findNodeByName(row, 'myopac_addr_zip').appendChild(text(addr.post_code()));
+       $n(row, 'myopac_addr_street').appendChild(text(street));
+       $n(row, 'myopac_addr_city').appendChild(text(addr.city()));
+       $n(row, 'myopac_addr_county').appendChild(text(addr.county()));
+       $n(row, 'myopac_addr_state').appendChild(text(addr.state()));
+       $n(row, 'myopac_addr_zip').appendChild(text(addr.post_code()));
 }
 
 
index b88ce1b..d028e35 100644 (file)
@@ -2,9 +2,7 @@
 
 <div id='myopac_holds_div' xmlns:xi="http://www.w3.org/2001/XInclude" >
 
-       <script language='javascript'>
-       </script>
-
+       <script language='javascript' src='../js/holds.js'> </script>
 
        <table width='100%' class='light_border myopac_table'>
 
@@ -55,6 +53,8 @@
                </tbody>
        </table>
 
+       <div class='hide_me' id='myopac_holds_cancel_verify'>Are you sure you wish to cancel the selected hold?</div>
+
 
 </div>
 
index c7b3784..38a4841 100644 (file)
 
        <div class='hide_me non_canvas' id='view_marc_div'> 
                <div>
-                       <table width='100%'><tbody><tr><td class='color_1' align='right' style='padding-right: 7px;'>
-                               <a href="javascript:void(0);" id='rdetail_hide_marc'>&rdetail.detailMain.hideMarc;</a>
-                       </td></tr></tbody></table>
+                       <table width='100%'><tbody><tr>
+                               <td class='color_1' align='left' style='padding-left: 7px;text-decoration: underline;'>
+                                       <a href="javascript:void(0);" id='rdetail_hide_marc'>&rdetail.detailMain.hideMarc;</a>
+                               </td>
+                       </tr></tbody></table>
                </div>
                <br/>
                <div id='rdetail_view_marc_box'> </div>