to XML_HTTP_MAX_TRIES attempts */
if( E && E.classname == "EXCommunication" ) {
+ //try { dump('Communication Error: ' + E ); } catch(e){}
+ alert('Debug: Communication Error: ' + E );
+
if(object.sendCount >= XML_HTTP_MAX_TRIES ) {
if(isXUL()) throw object;
else alert("Arrrgghh, Matey! Error communicating:\n" + E + "\n" + object.param_string);
'application/x-www-form-urlencoded');
}
- this.xmlhttp.send( data );
+ try{ this.xmlhttp.send( data ); } catch(e){}
+
this.sendCount += 1;
return this;
}
/* returns the JSON->js result object */
RemoteRequest.prototype.getResultObject = function() {
if(this.cancelled) return null;
+ if(!this.xmlhttp) return null;
var text = this.xmlhttp.responseText;
var obj = JSON2js(text);
var FETCH_COPY_STATUSES = "open-ils.search:open-ils.search.config.copy_status.retrieve.all";
var FETCH_COPY_COUNTS_SUMMARY = "open-ils.search:open-ils.search.biblio.copy_counts.summary.retrieve";
var FETCH_MARC_HTML = "open-ils.search:open-ils.search.biblio.record.html";
+var FETCH_CHECKED_OUT = "open-ils.circ:open-ils.circ.actor.user.checked_out";
/* ---------------------------------------------------------------------------- */
createEvt("rdetail", "recordDrawn"); /* f() : the record has been drawn */
+createEvt("common", "loggedIn"); /* f() : user has just logged in */
+
var skinCookie = new cookieObject("skin", 1, "/", COOKIE_SKIN);
function checkUserSkin(new_skin) {
+ return; /* XXX do some debugging with this... */
+
var user_skin = getSkin();
var cur_skin = grabSkinFromURL();
if(new_skin) user_skin = new_skin;
- if(isNull(user_skin)) {
+ if(!user_skin) {
if(grabUser()) {
if(grabUserPrefs()) {
}
}
- if(isNull(user_skin)) return;
+ if(!user_skin) return;
if( cur_skin != user_skin ) {
var url = buildOPACLink();
var auth_request = new Request( LOGIN_COMPLETE,
uname, hex_md5(seed + hex_md5(passwd)), "opac");
+
auth_request.send(true);
var auth_result = auth_request.result();
- if(auth_result == '0' || auth_result == null || auth_result.length == 0) { return false; }
+ if(auth_result == '0' || auth_result == null || auth_result.length == 0) {
+ alert("Login failed");
+ return false;
+ }
var u = grabUser(auth_result, true);
- if(u) updateLoc(u.home_ou(), findOrgDepth(u.home_ou()));
+ if(u) runEvt( "common", "locationChanged", u.home_ou(), findOrgDepth(u.home_ou()) );
checkUserSkin();
G.user = null;
cookie.remove(COOKIE_SES);
+ skinCookie.remove(COOKIE_SKIN);
+ checkUserSkin("default");
+
+ var args = {};
+ args[PARAM_TERM] = "";
+ args[PARAM_LOCATION] = globalOrgTree.id();
+ args[PARAM_DEPTH] = findOrgDepth(globalOrgTree);
+ args.page = "home";
+ goTo(buildOPACLink(args));
+
+ /*
hideMe(G.ui.sidebar.logoutbox);
unHideMe(G.ui.sidebar.loginbox);
hideMe(G.ui.sidebar.logged_in_as);
- skinCookie.remove(COOKIE_SKIN);
-
- checkUserSkin("default");
+ */
}
+function msg( text ) {
+ try {
+ alert( text );
+ } catch(e) {}
+}
+
+
.encircled { border: 1px solid black; }
+.light_border { border: 1px solid #E0E0E0; }
+
#main_table { border-collapse: collapse; width: 100%; height: 100%; }
#main_left_cell { height: 100%; width: 20%; vertical-align: top;margin: 0px; padding: 0px;}
#main_right_cell { height: 100%; width: 80%; vertical-align: top; margin: 0px; padding:0px;}
.sidebar_extra_item { padding: 0px; margin-right: 8px;}
.side_bar_item { padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px; margin-right: 8px; }
+
.sidebar_item_active { background: #A7EA9D; margin-right: 0px; }
+
+/*
+.sidebar_item_active { background: #035E47; margin-right: 0px; }
+*/
.sidebar_chunk { width: 100%; }
/*
.dim2 { filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; text-decoration: none; }
.dim { filter:alpha(opacity=10); -moz-opacity:0.1; opacity: 0.1; text-decoration: none; }
+/* ---------------------------------------------------------------------- */
+
+.myopac_link { width: 25%; margin: 3px; padding: 3px; text-align: center; vertical-align: middle; }
+
+.myopac_table thead { padding: 2px; font-weight: 600;}
+.myopac_table td { padding: 3px; };
// mresultGetCount();
mresultCollectIds(FETCH_MRIDS_FULL);
} else {
- runEvt('result', 'hitCountReceived');
+ //runEvt('result', 'hitCountReceived');
mresultCollectIds(FETCH_MRIDS);
}
}
if( getOffset() != 0 &&
records[getOffset()] != null &&
records[resultFinalPageIndex()] != null) {
+ runEvt('result', 'hitCountReceived');
mresultCollectRecords();
} else {
var form = (getForm() == "all") ? null : getForm();
var req = new Request(method, getStype(), getTerm(),
- getLocation(), getDepth(), getDisplayCount() * 5, getOffset(), form );
+ getLocation(), getDepth(), 100, getOffset(), form );
req.callback(mresultHandleMRIds);
req.send();
}
var res = r.getResultObject();
if(res.count != null) {
- HITCOUNT = res.count;
+ if( getOffset() == 0 ) HITCOUNT = res.count;
runEvt('result', 'hitCountReceived');
}
runEvt('result', 'idsReceived', res.ids);
var i = 0;
for( var x = getOffset(); x!= getDisplayCount() + getOffset(); x++ ) {
if(isNull(records[x])) break;
+ if(isNaN(records[x])) continue;
var req = new Request(FETCH_MRMODS, records[x]);
req.request.userdata = i++;
req.callback(mresultHandleMods);
setSelector(G.ui.searchbar.depth_selector, depth);
newSearchDepth = depth;
}
- if(!isFrontPage)
+
+ if(!isFrontPage && (findCurrentPage() != MYOPAC))
searchBarSubmit();
+
+ alert(findCurrentPage());
+ /*
+ alert(MYOPAC);
+ alert(findCurrentPage() == MYOPAC);
+ */
+
}
/* sets up the login ui components */
var loginBoxVisible = false;
+
+/*
+function loginDance() {
+ if(doLogin()) {
+ showCanvas();
+ G.ui.sidebar.username_dest.appendChild(text(G.user.usrname()));
+ unHideMe(G.ui.sidebar.logoutbox);
+ unHideMe(G.ui.sidebar.logged_in_as);
+ hideMe(G.ui.sidebar.loginbox);
+ return true;
+ }
+ return false;
+}
+*/
+
function initLogin() {
var loginDance = function() {
unHideMe(G.ui.sidebar.logoutbox);
unHideMe(G.ui.sidebar.logged_in_as);
hideMe(G.ui.sidebar.loginbox);
+ runEvt("common", "loggedIn");
}
}
showCanvas();
} else {
swapCanvas(G.ui.login.box);
- G.ui.login.username.focus();
+ try{G.ui.login.username.focus();}catch(e){}
}
loginBoxVisible = !loginBoxVisible;
</head>
- <body onload='init();'>
+ <body onload='init();
+ getId("home_adv_search_link").setAttribute("href", buildOPACLink({page:ADVANCED}));
+ getId("home_myopac_link").setAttribute("href", buildOPACLink({page:MYOPAC}, false, true));'>
<table width='100%' style='border-collapse: collapse;'>
<tbody>
<tr>
<?xml version='1.0'?>
<!DOCTYPE x [ <!ENTITY % ent SYSTEM "../../../locale/en-US/lang.dtd"> %ent; ]>
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
<head>
<title>Evergreen: Title Groups</title>
<title>Evergreen: My OPAC</title>
<xi:include href="css_common.xml#xpointer(//link)"/>
<xi:include href="js_common.xml#xpointer(//script)"/>
+ <script language='javascript' src='../js/myopac.js'> </script>
+
+ <!-- overwrite the fieldmapper code with the extended fieldmapper code -->
+ <script language='javascript' src='../../../common/js/fmextcore.js'> </script>
+ <script language='javascript' src='../../../common/js/fmgen.js'> </script>
+
+ <script language='javascript'>
+ config.ids.myopac = {};
+ config.css.myopac = {};
+ config.names.myopac = {};
+ </script>
+
</head>
<body onload="init();">
<xi:include href="sidebar.xml"/>
</td>
<td style='padding-left: 6px;' valign='top' width='80%'>
+
<div id='canvas' class='canvas'>
- <xi:include href="searchbar.xml"/>
- <xi:include href="statusbar.xml"/>
- <xi:include href="altcanvas.xml"/>
- <div id='canvas_main'>My OPAC Goes Here</div>
- </div>
+ <xi:include href="searchbar.xml"/>
+ <xi:include href="statusbar.xml"/>
+ <xi:include href="altcanvas.xml"/>
+ <div id='canvas_main'>
+
+ <table style='width: 70%'>
+ <tbody>
+ <tr id='myopac_nav_row' style='border: 1px solid #E0E0E0;'>
+
+ <td class='myopac_link color_3' id='myopac_checked_td' >
+ <a href='javascript:void(0);'
+ onclick='myOPACChangePage("checked");'> Checked Out</a>
+ </td>
+
+ <td class='myopac_link' id='myopac_holds_td' >
+ <a href='javascript:void(0);'
+ onclick='myOPACChangePage("holds");'>Holds</a>
+ </td>
+
+ <td class='myopac_link' id='myopac_fines_td' >
+ <a href='javascript:void(0);'
+ onclick='myOPACChangePage("fines");'>Fines</a>
+ </td>
+
+ <td class='myopac_link' id='myopac_prefs_td' >
+ <a href='javascript:void(0);'
+ onclick='myOPACChangePage("prefs");'>Account Preferences</a>
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ <br/><br/>
+
+ <div id='myopac_main_div'>
+ <xi:include href="myopac_checked.xml"/>
+ <xi:include href="myopac_holds.xml"/>
+ <xi:include href="myopac_fines.xml"/>
+ <xi:include href="myopac_prefs.xml"/>
+ </div>
+
+ </div>
+
+ </div> <!-- canvas -->
</td>
</tr>
</tbody>
.color_2 { background: #64EA4F; color: #000000; }
.color_3 { background: #CCFFFF; color: #000000; }
+/*
+.color_1 { background: #4D8444; color: #000000; }
+.color_2 { background: #168405; color: #000000; }
+.color_3 { background: #035E47; color: #000000; }
+*/
+
/* ---------------------------------------------------------------------- */
.sidebar_chunk {}
.sidebar_extra_link { text-decoration: none; }