[open-ils-commits] [GIT] Evergreen ILS branch master updated. 3b828afbe3dab8f764a7378b65ade1e190be5d56

Evergreen Git git at git.evergreen-ils.org
Thu Jun 6 10:45:20 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  3b828afbe3dab8f764a7378b65ade1e190be5d56 (commit)
       via  dcf9cb39d3243ea3a59035c150d521cf5816b9c8 (commit)
      from  05bda47c168e25fcd0aed5444a8995b3c9895efb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b828afbe3dab8f764a7378b65ade1e190be5d56
Author: Dan Scott <dscott at laurentian.ca>
Date:   Thu Jun 6 09:40:59 2013 -0400

    Fedora RPM for bzip2 headers is bzip2-devel
    
    There was an attempt to add the right RPM for the bzip2 headers in
    Makefile.install, but that failed on Fedora 19. Swap in bzip2-devel
    instead to correct that.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install
index fc46d62..c5aacd6 100644
--- a/Open-ILS/src/extras/Makefile.install
+++ b/Open-ILS/src/extras/Makefile.install
@@ -122,6 +122,7 @@ EXTRA_DEBS_PRECISE = \
 FEDORA_RPMS = \
 	aspell \
 	aspell-en \
+	bzip2-devel \
 	libdbi \
 	libdbi-dbd-pgsql \
 	libdbi-devel \
@@ -160,8 +161,7 @@ FEDORA_RPMS = \
 	readline-devel \
 	tcp_wrappers-devel \
 	wget \
-	yaz \
-	libbz2-devel
+	yaz
 
 # Note: B:O:AuthorizeNet 3.21 fails with https://rt.cpan.org/Public/Bug/Display.html?id=55172
 # Should be fixed in 3.22

commit dcf9cb39d3243ea3a59035c150d521cf5816b9c8
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Mon Oct 22 18:02:23 2012 -0400

    TPAC: First part of locg param can be branch shortname
    
    Addresses LP #1020625.  You can use the locg param, which can set an
    an OU for search context (and which has other implications related to
    location/scope) by shortname now.
    
    As long as your shortnames are something that work in an HTTP query
    string, don't contain colons, and as long as you don't have numeric
    shortnames for any orgs that would mask orgs with the sames numbers
    as an ID (but that would be a lousy setup anyway), this should work.
    
    Now case insensitive per recommendation by Michael Peters.  In the
    event that you have org units with names that are the same except
    for case (probably a bad practice), the locg parameter will simply
    fail to set your context, rather than try to guess which org unit
    you meant.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Pasi Kallinen <pasi.kallinen at pttk.fi>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    
    Conflicts:
    	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 93cc3e1..fa6b473 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -347,6 +347,30 @@ sub get_records_and_facets {
     return ($facets, @data);
 }
 
+sub _resolve_org_id_or_shortname {
+    my ($self, $str) = @_;
+
+    if (length $str) {
+        # Match on shortname case insensitively, but only if there's exactly
+        # one match.  We wouldn't want the system to arbitrarily interpret
+        # 'foo' as either the org unit with shortname 'FOO' or 'Foo' and fail
+        # to make it clear to the user which one was chosen and why.
+        my $res = $self->editor->search_actor_org_unit({
+            shortname => {
+                '=' => {
+                    transform => 'evergreen.lowercase',
+                    value => lc($str)
+                }
+            }
+        });
+        return $res->[0]->id if $res and @$res == 1;
+    }
+
+    # Note that we don't validate IDs; we only try a shortname lookup and then
+    # assume anything else must be an ID.
+    return int($str); # Wrapping in int() prevents 500 on unmatched string.
+}
+
 sub _get_search_lib {
     my $self = shift;
     my $ctx = $self->ctx;
@@ -358,6 +382,14 @@ sub _get_search_lib {
     return $loc if $loc;
 
     # loc param takes precedence
+    # XXX ^-- over what exactly? We could use clarification here. To me it looks
+    # like locg takes precedence over loc which in turn takes precedence over
+    # request headers which take precedence over pref_lib (which can be
+    # specified a lot of different ways and eventually falls back to
+    # physical_loc) and it all finally defaults to top of the org tree.
+    # To say nothing of all the code that doesn't look to this function at all
+    # but rather accesses some subset of these inputs directly.
+
     $loc = $self->cgi->param('loc');
     return $loc if $loc;
 
@@ -445,7 +477,8 @@ sub extract_copy_location_group_info {
     my $ctx = $self->ctx;
     if (my $clump = $self->cgi->param('locg')) {
         my ($org, $grp) = split(/:/, $clump);
-        $ctx->{copy_location_group_org} = $org;
+        $ctx->{copy_location_group_org} =
+            $self->_resolve_org_id_or_shortname($org);
         $ctx->{copy_location_group} = $grp if $grp;
     }
 }
diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index a1dbb94..63d6b44 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -420,7 +420,8 @@
     # which is a superset of 'loc'.
     BLOCK get_library;
         loc_name = 'locg';
-        loc_value = CGI.param(loc_name) || CGI.param('loc') || ctx.search_ou;
+        loc_value = ctx.copy_location_group_org ||  # resolved locg
+            CGI.param(loc_name) || CGI.param('loc') || ctx.search_ou;
     END;
 
 %]

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/extras/Makefile.install               |    4 +-
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm   |   35 +++++++++++++++++++-
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |    3 +-
 3 files changed, 38 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list