checked out display now shows the dummy title and author or pre-cataloged items when...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 17:57:58 +0000 (17:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 17:57:58 +0000 (17:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3005 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/skin/default/js/myopac.js

index c53b393..efd342f 100644 (file)
@@ -245,6 +245,7 @@ var CREATE_CONTAINER_ITEM           = 'open-ils.actor:open-ils.actor.container.item.creat
 var DELETE_CONTAINER_ITEM              = 'open-ils.actor:open-ils.actor.container.item.delete';
 var FLESH_CONTAINER                            = 'open-ils.actor:open-ils.actor.container.flesh';
 var FLESH_PUBLIC_CONTAINER             = 'open-ils.actor:open-ils.actor.container.public.flesh';
+var FETCH_COPY                                         = 'open-ils.search:open-ils.search.asset.copy.retrieve';
 /* ---------------------------------------------------------------------------- */
 
 
index 5fd1dc8..2c06a28 100644 (file)
@@ -158,21 +158,50 @@ function myOPACDrawCheckedOutSlim(r) {
 
                var req = new Request(FETCH_MODS_FROM_COPY, circ.target_copy() );
                req.request.circ = circ.id();
+               req.request.copy = circ.target_copy();
                req.callback(myOPACDrawCheckedTitle);
                req.send();
        }
 }
 
 function myOPACDrawCheckedTitle(r) {
+       var record = r.getResultObject();
        var circid = r.circ;
+
+       if(!record || checkILSEvent(record)) {
+               var req = new Request( FETCH_COPY, r.copy );
+               req.request.circ = circid
+               req.callback(myOPACDrawNonCatalogedItem);
+               req.send();
+               return;
+       }
+
        var row = $('myopac_checked_row_ ' + circid);
-       var record = r.getResultObject();
        var tlink = $n( row, "myopac_checked_title_link" );
        var alink = $n( row, "myopac_checked_author_link" );
        buildTitleDetailLink(record, tlink);
        buildSearchLink(STYPE_AUTHOR, record.author(), alink);
 }
 
+function myOPACDrawNonCatalogedItem(r) {
+       var copy = r.getResultObject();
+       var circid = r.circ;
+       var row = $('myopac_checked_row_ ' + circid);
+       var tlink = $n( row, "myopac_checked_title_link" );
+       var alink = $n( row, "myopac_checked_author_link" );
+       //tlink.appendChild(text(copy.dummy_title()));
+       //alink.appendChild(text(copy.dummy_author()));
+
+       tlink.parentNode.appendChild(text(copy.dummy_title()));
+       alink.parentNode.appendChild(text(copy.dummy_author()));
+
+       /*
+       tlink.setAttribute('href', null);
+       alink.setAttribute('href', null);
+       alert(alink.getAttribute('href'));
+       */
+}
+
 
 function myOPACRenewCirc(circid) {
        alert("Functionality currently under construction");