widening the search box; improving advanced search
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Jun 2006 14:37:11 +0000 (14:37 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Jun 2006 14:37:11 +0000 (14:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4651 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/web/opac/extras/os.css

index c017add..3631d4f 100644 (file)
@@ -644,21 +644,28 @@ sub opensearch_feed {
 
        my $cache_key = '';
        my $searches = {};
-       while ($term_copy =~ /(keyword|title|author|subject|series):(.+)/ogc) {
+       while ($term_copy =~ /(keyword|title|author|subject|series|site):([^:]+?)$/o) {
                my $c = $1;
                my $t = $2;
-               ($term_copy = $t) =~ s/(keyword|title|author|subject|series):(.+)//o;
-               $$searches{$c} = { term => $term_copy };
-               $cache_key .= $c . $term_copy;
-               warn "searching for $c -> [$term_copy] via OS $version, response type $type";
-               $term_copy = $t;
-               $complex_terms = 1;
+               $term_copy =~ s/(keyword|title|author|subject|series|site):([^:]+?)$//o;
+               if ($c eq 'site') {
+                       ($org = uc($t)) =~ s/\s+//go;
+                       warn "searching at site -> [$org] via OS $version, response type $type";
+                       next;
+               } else {
+                       $$searches{$c} = { term => $t };
+                       $complex_terms = 1;
+               }
+               $cache_key .= $c . $t;
+               warn "searching for $c -> [$t] via OS $version, response type $type";
        }
 
-       if (!keys(%$searches)) {
+       if ($term_copy) {
+               no warnings;
                $class = 'keyword' if ($class eq '-');
-               $$searches{$class} = { term => $terms };
-               $cache_key .= $class . $terms;
+               $$searches{$class}{term} .= " $term_copy";
+               warn "simple search for $class -> [$term_copy] via OS $version, response type $type";
+               $cache_key .= $class . $term_copy;
        }
 
        my $org_unit;
index 30a8627..50ce529 100644 (file)
@@ -13,7 +13,7 @@ h1 {
 
 input.searchbox {
        font-size: 0.9em;
-       max-width: 10em;
+       width: 20em;
 }
 
 div#searchdiv {