minor cleanup; allow numeric OUs
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 15 Mar 2008 03:50:41 +0000 (03:50 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 15 Mar 2008 03:50:41 +0000 (03:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9034 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm

index bf3fe17..d485403 100644 (file)
@@ -964,7 +964,7 @@ sub opensearch_feed {
        $sortdir = $cgi->param('searchSortDir') if $cgi->param('searchSortDir');
        $sortdir ||= '';
 
-       $terms .= " " if ($terms);
+       $terms .= " " if ($terms && $cgi->param('searchTerms'));
        $terms .= $cgi->param('searchTerms') if $cgi->param('searchTerms');
 
        $class = $cgi->param('searchClass') if $cgi->param('searchClass');
@@ -1026,10 +1026,14 @@ sub opensearch_feed {
                $org_unit = $actor->request(
                        'open-ils.actor.org_unit_list.search' => parent_ou => undef
                )->gather(1);
-       } else {
+       } elsif ($org !~ /^\d+$/o) {
                $org_unit = $actor->request(
                        'open-ils.actor.org_unit_list.search' => shortname => uc($org)
                )->gather(1);
+       } else {
+               $org_unit = $actor->request(
+                       'open-ils.actor.org_unit_list.search' => id => $org
+               )->gather(1);
        }
 
     my $recs = $search->request(
@@ -1037,6 +1041,8 @@ sub opensearch_feed {
                        org_unit        => $org_unit->[0]->id,
                        offset          => $offset - 1,
                        limit           => $limit,
+                       sort            => $sort,
+                       sort_dir        => $sortdir,
                        ($lang ?    ( 'language' => $lang    ) : ()),
                } => $terms => 1
        )->gather(1);