bookbag view now has a home
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Jan 2006 18:59:38 +0000 (18:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Jan 2006 18:59:38 +0000 (18:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2830 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/extras/bbags.js [new file with mode: 0644]
Open-ILS/web/opac/extras/bbags.xml [new file with mode: 0644]
Open-ILS/web/opac/skin/default/js/myopac.js

index b5f089a..b229392 100644 (file)
@@ -151,8 +151,8 @@ function buildImageLink(name, ssl) {
        return findBaseURL(ssl) + "../../../../images/" + name;
 }
 
-function buildContribLink(name, ssl) {
-       return findBaseURL(ssl) + "../../../../contrib/" + name;
+function buildExtrasLink(name, ssl) {
+       return findBaseURL(ssl) + "../../../../extras/" + name;
 }
 
 function  buildOPACLink(args, slim, ssl) {
diff --git a/Open-ILS/web/opac/extras/bbags.js b/Open-ILS/web/opac/extras/bbags.js
new file mode 100644 (file)
index 0000000..610fdb0
--- /dev/null
@@ -0,0 +1,47 @@
+
+/* XXX allow to pass in a 'local' var so the links back into the opac can be localized */
+/* maybe also a 'skin' var */
+
+function bbInit() {
+       var cgi = new CGI();
+       var bb  = cgi.param('bb');
+       if(!bb) { unHideMe($('not_found')); return; }
+       var req = new Request(FLESH_PUBLIC_CONTAINER, 'biblio', bb);
+       req.callback( bbShow );
+       req.send();
+}
+
+
+var template;
+function bbShow(r) {
+
+       var bb = r.getResultObject();
+       if(!bb || !bb.public()) { unHideMe($('not_found')); return; }
+       $('bb_name').appendChild(text(bb.name()));
+
+       var tbody = $('tbody');
+       if(!template) template = tbody.removeChild($('row_template'));
+
+       for( var i in bb.items() ) 
+               tbody.appendChild(bbShowItem( template, bb.items()[i] ));
+}
+
+function bbShowItem( template, item ) {
+       var row = template.cloneNode(true);
+
+       var req = new Request( FETCH_RMODS, item.target_biblio_record_entry() );
+       req.request.tlink = $n(row, 'title');
+       req.request.alink = $n(row, 'author');
+       req.request.blink = $n(row, 'by');
+
+       req.callback( function(r) { 
+               var rec = r.getResultObject();
+               buildTitleDetailLink(rec, r.tlink); 
+               r.tlink.setAttribute('href', '/opac/en-US/skin/default/xml/rdetail.xml?r='+rec.doc_id());
+               r.alink.appendChild(text(rec.author()));
+               unHideMe(r.blink);
+       });
+
+       req.send();
+       return row;
+}
diff --git a/Open-ILS/web/opac/extras/bbags.xml b/Open-ILS/web/opac/extras/bbags.xml
new file mode 100644 (file)
index 0000000..50091e9
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version='1.0'?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+       <head>
+               <title>Evergreen: Bookbag Viewer</title>
+               <script language='javascript' src='/opac/common/js/utils.js'> </script>
+               <script language='javascript' src='/opac/common/js//config.js'> </script> 
+               <script language='javascript' src='/opac/common/js/CGI.js'> </script>
+               <script language='javascript' src='/opac/common/js/Cookie.js'> </script>
+       
+               <script language='javascript' src='/opac/common/js/slimtree.js'> </script>
+               <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+               <script language='javascript' src='/opac/common/js/fmall.js'> </script>
+               <script language='javascript' src='/opac/common/js/fmgen.js'> </script>
+               <script language='javascript' src='/opac/common/js/opac_utils.js'> </script>
+               <script language='javascript' src='/opac/common/js/OrgTree.js'> </script>
+               <script language='javascript' src='/opac/common/js/org_utils.js'> </script>
+               <script language='javascript' src='/opac/common/js/init.js'> </script>
+               <script language='javascript' src='/opac/common/js/RemoteRequest.js'> </script>
+               <script language='javascript' src='bbags.js'> </script>
+
+               <style type='text/css'>
+                       .hide_me { visibility: hidden; display: none }
+                       .has_color { background: #E0F0E0; color: #000000; }
+                       .data_grid { font-weight: 500; border-collapse: collapse;}
+                       .data_grid thead tr { background: #E0F0E0; color: #000000; }
+                       .data_grid thead td { border: 1px solid #808080; padding-right: 5px; padding-left: 5px;}
+                       .data_grid tbody td { border: 1px solid #E0E0E0; padding: 10px; }
+                       .data_grid_center { text-align: center; }
+               </style>
+
+       </head>
+
+       <body onload='bbInit();'>
+               <center>
+                       <table class='data_grid data_grid_center' width='80%' style='margin-top: 30px;'>
+                               <thead>
+                                       <tr>
+                                               <td id='view_bookbags'>
+                                                       <span>Items in  Bookbag </span>
+                                                       <b><span id='bb_name'> </span></b>
+                                               </td>
+                                       </tr>
+                               </thead>
+                               <tbody id='tbody'>
+                                       <tr id='row_template'>
+                                               <td>
+                                                       <b><a href='javascript:void(0);' name='title'> </a></b>
+                                                       <span name='by' class='hide_me'> By </span><b><span name='author'> </span></b>
+                                               </td>
+                                       </tr>
+                               </tbody>
+                       </table>
+                       <span id='not_found' class='hide_me'><b>No Bookbag found!</b></span>
+               </center>
+       </body>
+
+
+</html>
+
index 7c23f0c..78f804c 100644 (file)
@@ -553,7 +553,7 @@ function myOPACShowBookbags(force) {
                if( cont.public() ) {
                        unHideMe($n(row, 'myopac_bb_published_yes'));
                        var link = $n(row, 'myopac_bb_published_view');
-                       link.setAttribute('href', buildContribLink( 'bbags.xml?bb='+cont.id(), false));  
+                       link.setAttribute('href', buildExtrasLink( 'bbags.xml?bb='+cont.id(), false));  
                        link.setAttribute('target', '_blank' );
                        unHideMe(link);