adding some files
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Nov 2005 17:25:57 +0000 (17:25 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Nov 2005 17:25:57 +0000 (17:25 +0000)
cleaning up some code
setting display count back to 10 on logout
showing authority data in IE for now

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

Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/js/holds.js [new file with mode: 0644]
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/xml/holds.xml [new file with mode: 0644]
Open-ILS/web/opac/skin/default/xml/rdetail_extras.xml [new file with mode: 0644]
Open-ILS/web/opac/skin/default/xml/result_lowhits.xml [new file with mode: 0644]

index adff0a4..fecf4bb 100644 (file)
@@ -128,6 +128,12 @@ function findBaseURL(ssl) {
        dump( 'ssl: ' + ssl + 'proto ' + proto );
 }
 
+/*
+function buildISBNSrc(isbn) {
+       return "http://" + location.host + "/jackets/" + isbn;
+}
+*/
+
 function buildImageLink(name, ssl) {
        return findBaseURL(ssl) + "../../../images/" + name;
 }
@@ -411,6 +417,7 @@ function doLogout() {
        cookie.remove(COOKIE_SES);
        skinCookie.remove(COOKIE_SKIN);
        checkUserSkin("default");
+       COUNT = 10;
 
        var args = {};
        args[PARAM_TERM] = "";
diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js
new file mode 100644 (file)
index 0000000..5ff95d1
--- /dev/null
@@ -0,0 +1,129 @@
+
+var currentHoldRecord;
+var currentHoldRecordObj;
+var holdsOrgSelectorBuilt = false;
+
+function holdsDrawWindow(recid, type) {
+
+       if(recid == null) {
+               recid = currentHoldRecord;
+               if(recid == null) return;
+       }
+       currentHoldRecord = recid;
+
+       if(!(G.user && G.user.session)) {
+
+               detachAllEvt('common','locationChanged');
+               attachEvt('common','loggedIn', holdsDrawWindow)
+               initLogin();
+               return;
+       }
+       swapCanvas($('holds_box'));
+
+       var rec = findRecord( recid, type );
+       currentHoldsRecordObj = rec;
+
+       if(!holdsOrgSelectorBuilt) {
+               holdsBuildOrgSelector(null,0);
+               holdsOrgSelectorBuilt = true;
+       }
+
+       removeChildren($('holds_title'));
+       removeChildren($('holds_author'));
+       removeChildren($('holds_format'));
+       removeChildren($('holds_email'));
+       removeChildren($('holds_email'));
+
+       $('holds_title').appendChild(text(rec.title()));
+       $('holds_author').appendChild(text(rec.author()));
+
+       for( var i in rec.types_of_resource() ) {
+               var res = rec.types_of_resource()[i];
+               var img = elem("img");
+               setResourcePic(img, res);
+               $('holds_format').appendChild(text(' '+res+' '));
+               $('holds_format').appendChild(img);
+               $('holds_format').appendChild(text(' '));
+       }
+
+       $('holds_phone').appendChild(text(G.user.day_phone()));
+       $('holds_email').appendChild(text(G.user.email()));
+       $('holds_cancel').onclick = showCanvas;
+       $('holds_submit').onclick = holdsPlaceHold; 
+}
+
+
+function holdsBuildOrgSelector(node, depth) {
+
+       if(!node) {
+               node = globalOrgTree;
+               depth = 0;
+       }
+
+       var selector = $('holds_org_selector');
+       var index = selector.options.length;
+
+       if(IE) {
+               var pre = elem("pre");
+               for(var x=2; x <= findOrgType(node.ou_type()).depth(); x++) {
+                       pre.appendChild(text("    "));
+               }
+               pre.appendChild(text(node.name()));
+               var select = new Option("", node.id());
+               selector.options[index] = select;
+               select.appendChild(pre);
+       
+       } else {
+               var pad = (findOrgType(node.ou_type()).depth() - 1) * 12;
+               if(pad < 0) pad = 0;
+               var select = new Option(node.name(), node.id());
+               select.setAttribute("style", "padding-left: "+pad+'px;');
+               selector.options[index] = select;
+       }       
+
+       if( node.id() == G.user.home_ou() ) {
+               selector.selectedIndex = index;
+               selector.options[index].selected = true;        
+       }
+
+       for( var i in node.children() ) {
+               var child = node.children()[i];
+               if(child) {
+                       holdsBuildOrgSelector(child, depth+1);
+               }
+       }
+}
+
+function holdsPlaceHold() {
+       //alert("placing hold for " + currentHoldRecord );
+
+       var org = $('holds_org_selector').options[$('holds_org_selector').selectedIndex].value;
+
+       var hold = new ahr();
+       hold.pickup_lib(org); 
+       hold.request_lib(org); 
+       hold.requestor(G.user.id());
+       hold.usr(G.user.id());
+       hold.hold_type('T');
+       hold.email_notify(G.user.email());
+       hold.phone_notify(G.user.day_phone());
+       hold.target(currentHoldRecord);
+       
+       var req = new Request( CREATE_HOLD, G.user.session, hold );
+       req.send(true);
+       var res = req.result();
+
+       /* XMLize me  XXX */
+       if( res == '1' ) alert($('holds_success').innerHTML);
+       else alert($('holds_failure').innerHTML);
+       
+       showCanvas();
+}
+
+function holdsCancel(holdid) {
+       var req = new Request(CANCEL_HOLD, G.user.session, holdid);
+       req.send(true);
+       return req.result();
+}
+
+
index b5095cd..b1fdccd 100644 (file)
@@ -321,127 +321,6 @@ function _resultFindRec(id) {
        return null;
 }
 
-/*
-var currentHoldRecord;
-var holdsOrgSelectorBuilt = false;
-function resultDrawHoldsWindow(recid) {
-
-       if(recid == null) {
-               recid = currentHoldRecord;
-               if(recid == null) return;
-       }
-       currentHoldRecord = recid;
-
-       detachEvt('common','locationUpdated', resultSBSubmit );
-       attachEvt( "common", "locationUpdated", resultSBSubmit );
-
-       if(!(G.user && G.user.session)) {
-
-               detachEvt('common','locationUpdated', resultSBSubmit );
-               attachEvt('common','loggedIn', resultDrawHoldsWindow)
-               //alert(G.evt['common']['locationUpdated']);
-               initLogin();
-               //attachEvt( "common", "locationUpdated", resultSBSubmit );
-               return;
-       }
-       swapCanvas($('holds_box'));
-
-       var rec = _resultFindRec(recid);
-
-       if(!holdsOrgSelectorBuilt) {
-               resultBuildHoldsSelector(null, 0);
-               holdsOrgSelectorBuilt = true;
-       }
-
-       removeChildren($('holds_title'));
-       removeChildren($('holds_author'));
-       removeChildren($('holds_format'));
-       removeChildren($('holds_email'));
-       removeChildren($('holds_email'));
-
-       $('holds_title').appendChild(text(rec.title()));
-       $('holds_author').appendChild(text(rec.author()));
-
-       for( var i in rec.types_of_resource() ) {
-               var res = rec.types_of_resource()[i];
-               var img = elem("img");
-               setResourcePic(img, res);
-               $('holds_format').appendChild(text(' '+res+' '));
-               $('holds_format').appendChild(img);
-               $('holds_format').appendChild(text(' '));
-       }
-
-       $('holds_phone').appendChild(text(G.user.day_phone()));
-       $('holds_email').appendChild(text(G.user.email()));
-       $('holds_cancel').onclick = showCanvas;
-       $('holds_submit').onclick = resultPlaceHold; 
-}
-
-
-function resultBuildHoldsSelector(node, depth) {
-
-       if(!node) {
-               node = globalOrgTree;
-               depth = 0;
-       }
-
-       var selector = $('holds_org_selector');
-       var index = selector.options.length;
-
-       if(IE) {
-               var pre = elem("pre");
-               for(var x=2; x <= findOrgType(node.ou_type()).depth(); x++) {
-                       pre.appendChild(text("    "));
-               }
-               pre.appendChild(text(node.name()));
-               var select = new Option("", node.id());
-               selector.options[index] = select;
-               select.appendChild(pre);
-       
-       } else {
-               var pad = (findOrgType(node.ou_type()).depth() - 1) * 12;
-               if(pad < 0) pad = 0;
-               var select = new Option(node.name(), node.id());
-               select.setAttribute("style", "padding-left: "+pad+'px;');
-               selector.options[index] = select;
-       }       
-
-       if( node.id() == getLocation() ) {
-               selector.selectedIndex = index;
-               selector.options[index].selected = true;        
-       }
-
-       for( var i in node.children() ) {
-               var child = node.children()[i];
-               if(child) {
-                       resultBuildHoldsSelector(child, depth+1);
-               }
-       }
-}
-
-function resultPlaceHold() {
-       var hold = new ahr();
-       hold.pickup_lib( 1 ); 
-       hold.requestor(G.user.id());
-       hold.usr(G.user.id());
-       hold.hold_type('T');
-       hold.email_notify(G.user.email());
-       hold.phone_notify(G.user.day_phone());
-       hold.target(currentHoldRecord);
-       
-       var req = new Request( CREATE_HOLD, G.user.session, hold );
-       req.send(true);
-       var res = req.result();
-
-       if( res == '1' ) {
-               alert('ok');
-       } else {
-               alert('hold failed');
-       }
-}
-*/
-
-
 
 function resultBuildFormatIcons( row, rec ) {
 
@@ -653,7 +532,9 @@ function resultDrawSidebarTrees( stype, treeName, items, wrapperNode, destNode )
                if(!IE)
                        setTimeout('resultFireXRefReq("'+treeName+'","'+stype+'","'+item+'");',200);
                        */
-               if(!IE) resultFireXRefReq(treeName, stype, items[i]);
+               //if(!IE) resultFireXRefReq(treeName, stype, items[i]);
+               //resultFireXRefReq(treeName, stype, items[i]);
+               setTimeout('resultFireXRefReq("'+treeName+'","'+stype+'","'+item+'");', 100);
        }
 
        if(found) {
diff --git a/Open-ILS/web/opac/skin/default/xml/holds.xml b/Open-ILS/web/opac/skin/default/xml/holds.xml
new file mode 100644 (file)
index 0000000..14833f2
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version='1.0'?>
+
+<div id='holds_box' class='hide_me non_canvas' style='margin-top: 6px;'>
+
+       <br/><br/>
+       <table width='75%'>
+               <tbody>
+                       <tr>
+                               <td class='holds_cell color_1' 
+                                       align='center' colspan='2'>Place a hold on the following item</td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Title:</td>
+                               <td class='holds_cell' id='holds_title'> </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Author:</td>
+                               <td class='holds_cell' id='holds_author'> </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Format:</td>
+                               <td class='holds_cell' id='holds_format'> </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Contact Telephone Number:</td>
+                               <td class='holds_cell' id='holds_phone'> </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Contact Email:</td>
+                               <td class='holds_cell' id='holds_email'> </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell'>Pickup Location</td>
+                               <td class='holds_cell'>
+                                       <select id='holds_org_selector'> </select>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td class='holds_cell' align='center' colspan='2'>
+                                       <button id='holds_submit'>Place Hold</button>
+                                       <span style='padding: 20px;'> </span>
+                                       <button id='holds_cancel'>Cancel</button>
+                               </td>
+                       </tr>
+               </tbody>
+       </table>
+
+       <div class='hide_me' id='holds_success'>Hold was successfully placed</div>
+       <div class='hide_me' id='holds_failure'>Hold was not successfully placed</div>
+
+</div>
diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail_extras.xml b/Open-ILS/web/opac/skin/default/xml/rdetail_extras.xml
new file mode 100644 (file)
index 0000000..16e5bee
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version='1.0'?>
+
+<div xmlns:xi="http://www.w3.org/2001/XInclude">
+
+       <table class='data_grid'>
+               <thead>
+                       <tr>
+                               <td id='rdetail_copy_info_link' style='padding-right: 16px; padding-left: 15px;'>
+                                       <a href='javascript:rdetailShowExtra("copyinfo");' class='classic_link'>Copy Information</a>
+                               </td>
+                               <td id='rdetail_reviews_link' class='hide_me' style='padding-right: 15px; padding-left: 15px;'>
+                                       <a href='javascript:rdetailShowExtra("reviews");' class='classic_link'>Reviews</a>
+                               </td>
+                               <td id='rdetail_toc_link' class='hide_me' style='padding-right: 15px; padding-left: 15px;'>
+                                       <a href='javascript:rdetailShowExtra("toc");' class='classic_link'>Table of Contents</a>
+                               </td>
+                               <td id='rdetail_annotation_link' class='hide_me' style='padding-right: 15px; padding-left: 15px;'>
+                                       <a href='javascript:rdetailShowExtra("annotation");' class='classic_link'>Annotation</a>
+                               </td>
+                       </tr>
+               </thead>
+       </table>
+
+       <div id='rdetail_extras_div'> 
+               <xi:include href="rdetail_copyinfo.xml"/>
+
+               <div id='rdetail_reviews_div' class='rdetail_extras_div hide_me'> 
+                       <div id='rdetail_review_template' style='width: 100%;'>
+                               <div name='review_header' style='width: 100%; padding: 15px; border: 1px solid #E0E0E0;'> </div>
+                               <div name='review_text' style='width: 100%; padding: 15px; border: 1px solid #E0E0E0;'> </div>
+                       </div>
+               </div>
+               
+               <div id='rdetail_toc_div' class='rdetail_extras_div hide_me'>
+               </div>
+       </div>
+
+</div>
diff --git a/Open-ILS/web/opac/skin/default/xml/result_lowhits.xml b/Open-ILS/web/opac/skin/default/xml/result_lowhits.xml
new file mode 100644 (file)
index 0000000..35c3036
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version='1.0'?>
+
+<div id='result_low_hits' class='hide_me'>
+
+       <br/><br/><br/>
+
+       <div style='text-align: center; padding-bottom: 8px;'>
+               <div id='result_low_hits_msg' class='hide_me'>Few hits were returned for your search.</div>
+               <div id='result_zero_hits_msg' class='hide_me'>Zero hits were returned for your search.</div>
+       </div>
+
+       <!-- spell checker -->
+       <div id='did_you_mean' class='lowhits_div hide_me'>
+               <span>Did you mean</span>
+               <a class='classic_link' id='spell_check_link'> </a>
+               <span>?</span>
+       </div>
+
+       <div id='low_hits_remove_format' class='lowhits_div hide_me'>
+               <span>You will find more hits when searching all item formats: </span>
+               <a id='low_hits_remove_format_link' class='classic_link'>Search again with all formats?</a>
+       </div>
+
+       <div id='low_hits_cross_ref' class='lowhits_div hide_me'>
+               <span>You may also like to try these related searches:</span>
+               <div style='padding: 5px;'>
+                       <a id='low_hits_xref_link' class='classic_link' style='padding-right: 5px;'> </a>
+               </div>
+       </div>
+
+       <div id='low_hits_expand_range' class='lowhits_div hide_me'>
+               <span>You may also wish to expand you search range to: </span>
+               <a id='low_hits_expand_link' class='classic_link' style='padding-right: 5px;'> </a>
+       </div>
+
+       <div id='low_hits_search_type' class='lowhits_div hide_me'>
+               <span>Would you like to try searching the same terms by</span>
+               <a id='low_hits_title_search' class='hide_me classic_link' 
+                       style='padding-right: 5px;'>title</a>
+               <a id='low_hits_author_search' class='hide_me classic_link' 
+                       style='padding-right: 5px;'>author</a>
+               <a id='low_hits_subject_search' class='hide_me classic_link' 
+                       style='padding-right: 5px;'>subject</a>
+               <a id='low_hits_series_search' class='hide_me classic_link' 
+                               style='padding-right: 5px;'>series</a>
+               <a id='low_hits_keyword_search' class='hide_me classic_link' 
+                       style='padding-right: 5px;'>keyword</a>
+               <span>?</span>
+       </div>
+
+</div>
+