JBAS-2279 Record detail search navigation repairs
authorBill Erickson <berickxx@gmail.com>
Fri, 10 May 2019 19:37:04 +0000 (19:37 +0000)
committerBill Erickson <berickxx@gmail.com>
Fri, 10 May 2019 19:44:51 +0000 (19:44 +0000)
Teach the browser client catalog to:

1. pass query params from title links from the embedded catalog to the
   angjs wrapper opened in a new tab.

2. pass query params from the record detail page angjs container page
   down to the iframe so the query is propagated to the catalog.

3. add tpac template mods to KCLS record detail template so the wrapper
page can get search result counts.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/opac/parts/record/body.tt2
KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 84a463a..69d7081 100644 (file)
             </span>
         </span>
         [%#- INCLUDE "opac/parts/pref_lib_display.tt2" %] <!-- not used by KCLS -->
+
+        <!-- stash these in JS for the web staff client to find -->
+        <script>
+            window.search_result_hit_count = [% ctx.hit_count %];
+            window.search_result_index = [% ctx.search_result_index %];
+        </script>
+
         <div id="rdetail_result_nav">
             [%
                 IF ctx.prev_search_record;
index 3476cd5..b12472a 100644 (file)
@@ -92,7 +92,7 @@
                                                     title="[% attrs.title_extended | uri %]" 
                                                     [% IF ctx.is_browser_staff %]
                                                       target="_blank"
-                                                      href="/eg/staff/cat/catalog/record/[% rec.id %]"
+                                                      href="[% mkurl('/eg/staff/cat/catalog/record/' _ rec.id) | replace(';','&') %]"
                                                     [% ELSE %]
                                                       href = "[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
                                                     [% END %]
index fc6441e..365e4f5 100644 (file)
@@ -1919,9 +1919,15 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced');
 
         // A record ID in the path indicates a request for the record-
-        // specific page.
+        // specific page.  Pass along the query params if there are any.
         if ($routeParams.record_id) {
-            url = url.replace(/advanced/, '/record/' + $scope.record_id);
+            url = url.replace(/advanced/, 'record/' + $scope.record_id);
+            if (location.search) {
+                // KCLS propagate query params from title links
+                // that force-open new tabs.
+                url += location.search;
+                $scope.from_route = false;
+            }
         }
 
         // Jumping directly to the results page by passing a search