# List of classes needed by the opac
my @web_hints = qw/ex mvr au aou aout asv asva asvr asvq
circ acp acpl acn ccs perm_ex ahn ahr aua ac
- actscecm crcd crmf crrf/;
+ actscecm crcd crmf crrf mus mbts/;
print <<JS;
var resources = record.types_of_resource();
for( var i in resources ) {
- var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath;
- var res = modsFormatToMARC(resources[i]);
- var a = elem("a",
- {href: prefix + "?target=record_result&mrid=" +
- record.doc_id() + "&format=" + res +
- "&page=0&location=" + this.location +
- "&depth=" + this.depth} );
+
+ var a;
+ if(instanceOf(this,MRResultPage)) {
+ var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath;
+ var res = modsFormatToMARC(resources[i]);
+ var a = elem("a",
+ {href: prefix + "?target=record_result&mrid=" +
+ record.doc_id() + "&format=" + res +
+ "&page=0&location=" + this.searchLocation +
+ "&depth=" + this.searchDepth} );
+ }
this.buildResourcePic( c, resources[i], a);
}
this.page = parseInt(paramObj.__page);
var hitsper = paramObj.__hits_per_page;
this.format = paramObj.__format;
+ if(!this.format) this.format = "all";
if(hitsper)
this.hitsPerPage = parseInt(hitsper);
RecordResultPage.prototype.mrSearch = function(mrid) {
- var form = this.format;
- if(form == "all") form = null;
- var request = new RemoteRequest("open-ils.search",
- "open-ils.search.biblio.metarecord_to_records", mrid, form );
+ var request;
+ var method = "open-ils.search.biblio.metarecord_to_records";
+ if(this.format == "all")
+ request = new RemoteRequest("open-ils.search", method, mrid );
+ else
+ request = new RemoteRequest("open-ils.search", method, mrid, this.format );
debug("Gathering doc ids for metarecord " + mrid );
request.setCompleteCallback(
function(req) {
try{
- obj.gatherIDs(req.getResultObject());
+ var ids = req.getResultObject();
+ obj.gatherIDs(ids);
if(!recordResultRedirect) { /* if the user isn't just hitting the 'back' button */
if(parseInt(obj.hitCount) == 1) {
case "sound recording":
return "ij";
case "sound recording-nonmusical":
- return "ij";
+ return "i";
case "sound recording-musical":
- return "ij";
+ return "j";
case "software, multimedia":
return "m";
case "still images":
return "moving image";
case "i":
+ return "sound recording-nonmusical";
+
case "j":
- return "sound recording";
+ return "sound recording-musical";
case "m":
return "software, multimedia";
);
my $records = $request->gather(1);
+ if(!$records) {return { ids => [] }};
+
warn "Search request complete " . time() . "\n";
my @all_ids;
("search.biblio.metarecord_to_record_ids requires mr id")
unless defined( $mrid );
- warn "Searching for record for MR $mrid\n";
+ warn "Searching for record for MR $mrid and format $format\n";
my $mrmaps = OpenILS::Application::AppUtils->simple_scalar_request(
"open-ils.storage",
#warn "Recovered id's [@ids] for mr $mrid\n";
#my $size = @ids;
+ use Data::Dumper;
+ warn Dumper $mrmaps;
+
my $size = @$mrmaps;
return { count => $size, ids => $mrmaps };
option(value='all', selected='selected', content="All Formats");
option(value='at', content="Books");
option(value='at-d', content="Large Print Books");
- option(value='ij', content="Audiobooks");
+ option(value='i', content="Audiobooks");
option(value='g', content="Video Recording");
- option(value='cd', content="Music");
+ option(value='j', content="Music");
option(value='m', content="Electronic Resources");
END;
option(value='all', selected='selected', content="All Formats");
option(value='at', content="Books");
option(value='at-d', content="Large Print Books");
- option(value='ij', content="Audiobooks");
+ option(value='i', content="Audiobooks");
option(value='g', content="Video Recording");
- option(value='cd', content="Music");
+ option(value='j', content="Music");
option(value='m', content="Electronic Resources");
END;