[open-ils-commits] r9034 - trunk/Open-ILS/src/perlmods/OpenILS/WWW

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Mar 15 00:24:23 EDT 2008


Author: miker
Date: 2008-03-14 23:50:41 -0400 (Fri, 14 Mar 2008)
New Revision: 9034

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
minor cleanup; allow numeric OUs

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2008-03-15 03:33:56 UTC (rev 9033)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2008-03-15 03:50:41 UTC (rev 9034)
@@ -964,7 +964,7 @@
 	$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 @@
 	 	$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 @@
 			org_unit	=> $org_unit->[0]->id,
 			offset		=> $offset - 1,
 			limit		=> $limit,
+			sort		=> $sort,
+			sort_dir	=> $sortdir,
 			($lang ?    ( 'language' => $lang    ) : ()),
 		} => $terms => 1
 	)->gather(1);



More information about the open-ils-commits mailing list