small tweeks here and there... see diffs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 15 Jul 2005 15:41:03 +0000 (15:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 15 Jul 2005 15:41:03 +0000 (15:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1209 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/fieldmapper.pl
Open-ILS/src/javascript/opac/AbstractRecordResultPage.js
Open-ILS/src/javascript/opac/RecordResultPage.js
Open-ILS/src/javascript/util/ils_utils.js
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/templates/opac/pages/chunks/search_bar_form.ttk
Open-ILS/src/templates/opac/pages/opac_start.ttk

index dface9a..72b55ae 100755 (executable)
@@ -10,7 +10,7 @@ my $web = $ARGV[0];
 # 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;
 
index 54ddd07..481d37a 100644 (file)
@@ -214,13 +214,17 @@ AbstractRecordResultPage.prototype.displayRecord =
        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);
        }
 
index eccd0b5..33fa4d0 100644 (file)
@@ -219,6 +219,7 @@ RecordResultPage.prototype.doSearch = function() {
        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);
@@ -333,10 +334,12 @@ RecordResultPage.prototype.globalSearch = function(type, term) {
 
 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 );
 
@@ -344,7 +347,8 @@ RecordResultPage.prototype.mrSearch = function(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) {
index e26cf5d..0d0b6b6 100644 (file)
@@ -156,9 +156,9 @@ function modsFormatToMARC(format) {
                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":
@@ -186,8 +186,10 @@ function MARCFormatToMods(format) {
                        return "moving image";
 
                case "i":
+                       return "sound recording-nonmusical";
+
                case "j":
-                       return "sound recording";
+                       return "sound recording-musical";
 
                case "m":
                        return "software, multimedia";
index 35eafd7..30b5673 100644 (file)
@@ -692,6 +692,8 @@ sub biblio_search_class {
                );
 
        my $records = $request->gather(1);
+       if(!$records) {return { ids => [] }};
+
        warn "Search request complete " . time() . "\n";
 
        my @all_ids;
@@ -855,7 +857,7 @@ sub biblio_mrid_to_record_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", 
@@ -869,6 +871,9 @@ sub biblio_mrid_to_record_ids {
        #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 };
index a2683cd..b6ffbdb 100644 (file)
@@ -25,9 +25,9 @@
                        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;
 
index 1beeabc..259f966 100644 (file)
@@ -83,9 +83,9 @@
                        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;