if(record == null) return;
+ if(!instanceOf(record, Fieldmapper)) {
+ debug(" * Received bogus record " + js2JSON(record));
+ return;
+ }
+
if(page_id == 0)
this.buildNextLinks();
}
- if(this.hitCount < 1)
+ if(this.hitCount < 1) {
if(this.progressBar) this.progressBar.stop();
+ }
/* in case we're hidden */
showMe(this.bigOlBox);
if(page_id == (parseInt(this.hitsPerPage) - 1) ) {
if(this.progressBar) this.progressBar.stop();
+ if(this.hitCount < 1)
+ this.noHits();
}
if( (page_id == ((parseInt(this.hitCount) - 1 ) - parseInt(this.searchOffset))) ||
+AbstractRecordResultPage.prototype.noHits = function() {
+ var hcell = getById("hit_count_cell");
+ hcell.appendChild(createAppElement("br"));
+ hcell.appendChild(createAppTextNode("0 hits were returned for you search"));
+}
+
+
AbstractRecordResultPage.prototype.buildNextLinks = function() {
if(this.builtLinks)
return;
this.builtLinks = true;
-
-
var obj = this;
var next;
var prev;
this.orgTree = tree;
}
-LocationTree.prototype.buildOrgTreeWidget = function(org_node) {
+LocationTree.prototype.buildOrgTreeWidget = function() {
+
+ this.widget = buildOrgTreeWidget();
+}
+
+
+function buildOrgTreeWidget(org_node) {
var item;
+ globalPage.treeWidgetElements = new Array();
+
if(org_node == null) {
- org_node = this.orgTree;
+ org_node = globalOrgTree;
item = new WebFXTree(org_node.name());
- this.widget = item;
item.setBehavior('classic');
} else {
item = new WebFXTreeItem(org_node.name());
}
+ /* make org tree re-submit search on click */
item.action =
"javascript:globalPage.updateSelectedLocation('" + org_node.id() + "');" +
- "globalPage.locationTree.hide();";
+ "globalPage.locationTree.hide();";
+
+ globalPage.treeWidgetElements[item.id] = org_node;
for( var index in org_node.children()) {
var childorg = org_node.children()[index];
item.add(tree_node);
}
}
+
+ return item;
}
debug("mr search params string " + string + " stype " + stype +
" location " + location + " depth " + depth );
- if(depth == null)
+ if(depth == null || depth == "undefined")
depth = globalSearchDepth;
if(depth == null)
depth = findOrgDepth(globalLocation.ou_type());
- if(location == null)
+ if(location == null || location == "undefined")
location = globalLocation.id();
if(!stype || !string) return;
else throw E;
}
- obj.buildNextLinks();
+ if(obj.hitCount > 0) obj.buildNextLinks();
+ else obj.noHits();
+
obj.doMRSearch();
debug("Kicking off the record id's request");
}
var obj = this;
var method = "open-ils.search.biblio.class";
- if( this.hitCount > 1000 )
+ if( this.hitCount > 5000 )
method = method + ".unordered";
debug("Search method is " + method);
*/
}
+OPACStartPage.prototype.doSearch = function() {
+}
}
menu.addItem("View MARC", func);
- xulEvtRecordResultDisplayed( menu, record );
+ if(isXUL())
+ xulEvtRecordResultDisplayed( menu, record );
}
debug( "Key Value Array \n" + js2JSON( paramObj ) );
this.page = parseInt(paramObj.__page);
+
+ if(this.page == null)
+ this.page = 0;
+
this.searchOffset = this.page * this.hitsPerPage;
else
this.session = globalSearchBarChunk.session;
+ debug("^^^^^^^^^^^^");
+ this.reset();
+
globalSearchBarChunk = this;
}
+
SearchBarChunk.prototype.reset = function() {
+ debug(" -- reset on SearchBarChunk");
+
if( this.session.connected ) {
debug(" ****** session is connected");
hideMe(this.login_div);
debug(" ****** session is not connected");
showMe(this.login_div);
hideMe(this.logout_div);
+ }
+ if(isXUL()) {
+ debug("Hiding search bar links since we're XUL");
+ hideMe(this.login_div);
+ hideMe(this.logout_div);
+ hideMe(this.my_opac_link_div);
+ hideMe(this.about_link_div);
}
}
+/*
+var XUL = new Object();
+
var xulEvtMRResultDisplayed = function( menu, record ) {
}
var xulEvtRecordResultDisplayed = function( menu, record ) {
}
+
+var xulEvtPageLoaded = function(window) {
+}
+*/
-UserSession.prototype.verifySession = function() {
+UserSession.prototype.verifySession = function(ses) {
debug("Verifying session...");
- this.session_id = this.cookie.fields[UserSession.SES];
+ if(ses)
+ debug("Session key passed in from XUL[" + ses + "], verifying...");
+
+ if(ses != null)
+ this.session_id = ses;
+ else
+ this.session_id = this.cookie.fields[UserSession.SES];
if(this.session_id) {
debug("Retrieveing user info for session " + this.session_id);
}
-function buildOrgTreeWidget(org_node) {
-
- var item;
-
- globalPage.treeWidgetElements = new Array();
-
- if(org_node == null) {
- org_node = globalOrgTree;
- item = new WebFXTree(org_node.name());
- item.setBehavior('classic');
- } else {
- item = new WebFXTreeItem(org_node.name());
- }
-
- item.action =
- "javascript:globalPage.updateSelectedLocation('" + org_node.id() + "');" +
- "globalPage.locationTree.hide();";
-
- /*
- item.action = function() {
- globalPage.updateSelectedLocation(org_node.id());
- globalPage.globalMenuManager.hideAll();
- }
- */
-
-
- globalPage.treeWidgetElements[item.id] = org_node;
-
- for( var index in org_node.children()) {
- var childorg = org_node.children()[index];
- if( childorg != null ) {
- var tree_node = buildOrgTreeWidget(childorg);
- if(tree_node != null)
- item.add(tree_node);
- }
- }
-
- return item;
-}
function getOrgById(id, node) {
if(node == null) node = globalOrgTree;
END;
- WRAPPER html/cell align='center';
- WRAPPER html/div class="text_link_div" id='adv_search_link_div';
- anchor( id='adv_search_link', href='?target=advanced_search', text = tm.advanced );
- END;
- END;
WRAPPER html/cell align='center';
END;
WRAPPER html/cell align='center';
+ WRAPPER html/div class="text_link_div" id='adv_search_link_div';
+ anchor( id='adv_search_link', href='?target=advanced_search', text = tm.advanced );
+ END;
+ END;
+
+
+ WRAPPER html/cell align='center';
WRAPPER html/div class='text_link_div' id='my_opac_link_div';
anchor( id='my_opac_link', href='?target=my_opac', text = tm.my_opac );
END;
END;
END;
+
WRAPPER html/cell valign='bottom' align='right';
WRAPPER html/div id='small_logo_div';
option(value='author', content=tm.author);
option(value='subject', content=tm.subject);
option(value='keyword', content=tm.keyword);
+ option(value='series', content="Series");
END;
space(1);
option(value='author', content='Author');
option(value='subject', content='Subject');
option(value='keyword', content='Keyword');
+ option(value='series', content='Series');
END;
END;