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

Evergreen Git git at git.evergreen-ils.org
Wed Jan 11 23:01:46 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, master has been updated
       via  fd03cfede3aa8ae62b7f24f9550ca70040ac6004 (commit)
      from  d18e97ff448c581c27605b6a2fe453e55191ce36 (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 fd03cfede3aa8ae62b7f24f9550ca70040ac6004
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 879ba77..d98bb3d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
@@ -2146,20 +2146,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