Making demo branch of 1854, 1858, 1859 set default search option
authorVictoria Lewis <vlewis@catalystitservices.com>
Tue, 8 Sep 2015 20:48:54 +0000 (13:48 -0700)
committerVictoria Lewis <vlewis@catalystitservices.com>
Tue, 8 Sep 2015 20:48:54 +0000 (13:48 -0700)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/templates/opac/parts/org_selector.tt2
Open-ILS/src/templates/staff/t_splash.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 19f3a25..ec9dfce 100644 (file)
@@ -141,7 +141,8 @@ sub _prepare_biblio_search {
     my $pref_ou = $ctx->{pref_ou};
     if (defined($pref_ou) and $pref_ou ne '' and $pref_ou != $org and ($pref_ou ne $ctx->{aou_tree}->()->id) and not $query =~ / pref_ou\(\S+\)/) {
         my $plib = $ctx->{get_aou}->($pref_ou)->shortname;
-        $query = "pref_ou($plib) $query";
+        my $pref_scrubber = "pref_ou($plib) $query";
+        push @naive_query_re, $pref_scrubber;
     }
 
     if (my $grp = $ctx->{copy_location_group}) {
@@ -174,7 +175,7 @@ sub _prepare_biblio_search {
         push @naive_query_re, $thing;
     }
 
-    # This gives templates a way to take site() and depth() back out of
+    # This gives templates a way to take site(), pref_ou(), and depth() back out of
     # query strings when they shouldn't be there (because they're controllable
     # with other widgets).
     $ctx->{naive_query_scrub} = sub {
index 433ac80..afadc32 100644 (file)
@@ -32,12 +32,12 @@ BLOCK build_org_selector;
             name='[% name %]'>
     [%- 
         WHILE node_stack.size > 0; 
-            node = node_stack.pop(); #node becomes the popped node stack
-            org_unit = node.org;     #org_unit becomes node's org
-            loc_grp = node.loc_grp;  #loc_grp(location) becomes the node_stack's array?
-            ou_id = org_unit.id;     #ou_id shorthand for org_unit.id
+            node = node_stack.pop();
+            org_unit = node.org;
+            loc_grp = node.loc_grp;
+            ou_id = org_unit.id;
             css_class = '';
-            disabled = '';           #clear css_class, disabled, and selected
+            disabled = '';
             selected = '';
             visible = org_unit.opac_visible == 't'; #enable visibility for org_unit's opac_visible option
 
index 2884ba6..970d098 100644 (file)
             <img src="/xul/server/skin/media/images/portal/bucket.png"/>
             <a target="_self" href="./cat/bucket/copy/">[% l('Copy Buckets') %]</a>
           </div>
+            <div>
+            <form action="/eg/opac/results" method="get">
+            <input type="search" alt="Catalog Search" maxlength="200"
+                size="20" name="query"
+                placeholder="Search catalog for..." />
+            <input id="search-submit-go" type="submit" value="Search" 
+                title="Search" class="opac-button" onclick="setTimeout
+                (function(){$(&quot;search-submit-spinner&quot;)
+                .className=&quot;&quot;; $(&quot;search-submit-go&quot;)
+                .className=&quot;hidden&quot;}, 2000)">
+            </form>
+            </div>
         </div>
       </div>
     </div>
index 4cd81d7..6593210 100644 (file)
@@ -261,8 +261,12 @@ function($scope , $routeParams , $location , $q , egCore , egHolds,
         // The URL is otherwise generated through user navigation.
         if ($scope.catalog_url) return; 
 
+        var default_search_library = egCore.hatch.getLocalItem('eg.search.lib.default');
         var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced');
 
+        if (default_search_library.id) {
+          url += '?locg=' + default_search_library.id;
+        }
         // A record ID in the path indicates a request for the record-
         // specific page.
         if ($routeParams.record_id) {