[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 76ddaa1ac6bf26d33c71aa7f2158a60b51ad8913

Evergreen Git git at git.evergreen-ils.org
Wed Jan 11 23:01:36 EST 2012


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, rel_2_1 has been updated
       via  76ddaa1ac6bf26d33c71aa7f2158a60b51ad8913 (commit)
      from  dc218c85eaa217bfb0e00cb145f6d6554e740f50 (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 76ddaa1ac6bf26d33c71aa7f2158a60b51ad8913
Author: James Fournie <jfournie at sitka.bclibraries.ca>
Date:   Thu Dec 8 17:00:14 2011 -0800

    P898427 Get holdings_xml.retrieve to flesh URIs properly
    
    Flesh URIs when requested with the -uris or -full feed type.
    This was broken when commit f2b822f8 fixed authority browsing.
    
    holdings_xml-full never appeared to retrieve URIs properly, so that has
    been added.
    
    This also makes holdings_xml-uris behave in the new manner of URIs as per
    git commit ba47ecc61, retrieving URIs for ancestors rather than descendants.
    
    Signed-off-by: James Fournie <jfournie at sitka.bclibraries.ca>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
index a0a634a..172310c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
@@ -1953,20 +1953,58 @@ sub new_record_holdings {
         }
     ]);
 
-    if ($flesh and $flesh eq 'uris') {
-        %subselect = (
-            owning_lib => \@ou_ids,
-            '-exists'  => {
-                from  => { auricnm => 'auri' },
-                where => {
-                    call_number => { '=' => {'+acn'=>'id'} },
-                    '+auri' => { active => 't' }
+    # we are dealing with -full or -uris, so we need to flesh things out
+    if ($flesh) {
+
+        # either way we're going to need uris
+        # get all the uris up the tree (see also ba47ecc6196)
+
+        my $uri_orgs = $_storage->request(
+            'open-ils.cstore.json_query.atomic',
+            { from => [ 'actor.org_unit_ancestors', $one_org->id ] }
+        )->gather(1);
+
+        my @uri_ou_ids = map { $_->{id} } @$uri_orgs;
+
+        # we have a -uris, just get the uris
+        if ($flesh == 2) {
+            %subselect = (
+                owning_lib => \@uri_ou_ids,
+                '-exists'  => {
+                    from  => { auricnm => 'auri' },
+                    where => {
+                        call_number => { '=' => {'+acn'=>'id'} },
+                        '+auri' => { active => 't' }
+                    }
                 }
-            }
-        );
+            );
+        # we have a -full, get all the things
+        } elsif ($flesh == 1) {
+            %subselect = ( '-or' => [
+                { owning_lib => \@ou_ids },
+                { '-exists'  =>
+                    { from  => 'acp',
+                      where => {
+                        call_number => { '=' => {'+acn'=>'id'} },
+                        deleted => 'f',
+                        circ_lib => \@ou_ids
+                      }
+                    }
+                },
+                { '-and' => [
+                    { owning_lib => \@uri_ou_ids },
+                    { '-exists'  => {
+                        from  => { auricnm => 'auri' },
+                        where => {
+                            call_number => { '=' => {'+acn'=>'id'} },
+                            '+auri' => { active => 't' }
+                        }
+                    }}
+                ]}
+            ]);
+        }
     }
 
-
 	my $cns = $_storage->request(
 		"open-ils.cstore.direct.asset.call_number.search.atomic",
 		{ record  => $bib,

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/SuperCat.pm   |   60 ++++++++++++++++----
 1 files changed, 49 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list