[open-ils-commits] r17747 - branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 16 16:31:31 EDT 2010
Author: dbs
Date: 2010-09-16 16:31:26 -0400 (Thu, 16 Sep 2010)
New Revision: 17747
Modified:
branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
Enable bookbags to have a target searchOrg that sets the appropriate search scope in opac mode
For example, http://example.com/opac/extras/feed/bookbag/opac/2378?skin=sparkly&searchOrg=BR1
would resolve to a scope of BR1 in the dynamic OPAC.
There is a more sophisticated version of this in 2.0/trunk; this is just a
stop-gap measure until then.
Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-09-16 18:34:49 UTC (rev 17746)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-09-16 20:31:26 UTC (rev 17747)
@@ -781,6 +781,7 @@
my $skin = $cgi->param('skin') || 'default';
my $locale = $cgi->param('locale') || 'en-US';
+ my $org_sn = $cgi->param('searchOrg') || '-';
$root =~ s{(?<!http:)//}{/}go;
$base =~ s{(?<!http:)//}{/}go;
@@ -797,7 +798,14 @@
my $bucket_tag = "tag:$host,$year:record_bucket/$id";
if ($type eq 'opac') {
- print "Location: $root/../../$locale/skin/$skin/xml/rresult.xml?rt=list&" .
+ my $scope = '';
+ if ($org_sn) {
+ my $ou = $actor->request("open-ils.actor.org_unit_list.search", "shortname", $org_sn)->gather(1);
+ if ($ou) {
+ $scope = '&l=' . $ou->[0]->id;
+ }
+ }
+ print "Location: $root/../../$locale/skin/$skin/xml/rresult.xml?rt=list$scope&" .
join('&', map { "rl=" . $_->target_biblio_record_entry } @{ $bucket->items }) .
"\n\n";
return 302;
More information about the open-ils-commits
mailing list