From 9425b63379aad4949dbbcb95a372b81bbd2d0c33 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 20 Nov 2005 17:25:57 +0000 Subject: [PATCH] adding some files 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 | 7 + Open-ILS/web/opac/skin/default/js/holds.js | 129 ++++++++++++++++++ .../web/opac/skin/default/js/result_common.js | 125 +---------------- Open-ILS/web/opac/skin/default/xml/holds.xml | 51 +++++++ .../opac/skin/default/xml/rdetail_extras.xml | 38 ++++++ .../opac/skin/default/xml/result_lowhits.xml | 52 +++++++ 6 files changed, 280 insertions(+), 122 deletions(-) create mode 100644 Open-ILS/web/opac/skin/default/js/holds.js create mode 100644 Open-ILS/web/opac/skin/default/xml/holds.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/rdetail_extras.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/result_lowhits.xml diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index adff0a4338..fecf4bbbf4 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -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 index 0000000000..5ff95d19b3 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/holds.js @@ -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(); +} + + diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index b5095cd1aa..b1fdccd48c 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -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 index 0000000000..14833f2ee1 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/holds.xml @@ -0,0 +1,51 @@ + + +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Place a hold on the following item
Title:
Author:
Format:
Contact Telephone Number:
Contact Email:
Pickup Location + +
+ + + +
+ +
Hold was successfully placed
+
Hold was not successfully placed
+ +
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 index 0000000000..16e5bee733 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/rdetail_extras.xml @@ -0,0 +1,38 @@ + + +
+ + + + + + + + + + +
+ +
+ + +
+
+
+
+
+
+ +
+
+
+ +
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 index 0000000000..35c30363a7 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/result_lowhits.xml @@ -0,0 +1,52 @@ + + +
+ +


+ +
+
Few hits were returned for your search.
+
Zero hits were returned for your search.
+
+ + +
+ Did you mean + + ? +
+ +
+ You will find more hits when searching all item formats: + Search again with all formats? +
+ +
+ You may also like to try these related searches: +
+ +
+
+ +
+ You may also wish to expand you search range to: + +
+ +
+ Would you like to try searching the same terms by + title + author + subject + series + keyword + ? +
+ +
+ -- 2.43.2