[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_6 updated. 9ce8dfdd852417cca140a68b219a0e3f77f29aec

Evergreen Git git at git.evergreen-ils.org
Mon Nov 10 20:38:33 EST 2014


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_6 has been updated
       via  9ce8dfdd852417cca140a68b219a0e3f77f29aec (commit)
      from  94c952c55eec2f1b615811fa31fb7ab96abd3f0b (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 9ce8dfdd852417cca140a68b219a0e3f77f29aec
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Nov 3 17:55:00 2014 -0500

    LP#1203734 copy circ counts include anon. circs
    
    Circ counts displayed on "Show Last Few Circulations" (XUL) includes
    active, anonymized, and legacy circulations (via cstore)
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
index c82a695..4ed6bf0 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
@@ -742,17 +742,29 @@ __PACKAGE__->register_method(
     /);
 
 sub circ_count {
-    my( $self, $client, $copyid, $range ) = @_; 
+    my( $self, $client, $copyid ) = @_; 
+
+    my $count = new_editor()->json_query({
+        select => {
+            circbyyr => [{
+                column => 'count',
+                transform => 'sum',
+                aggregate => 1
+            }]
+        },
+        from => 'circbyyr',
+        where => {'+circbyyr' => {copy => $copyid}}
+    })->[0]->{count};
 
-    return $U->simplereq(
-        'open-ils.storage',
-        'open-ils.storage.asset.copy.circ_count',
-        $copyid, $range
-    );
+    return {
+        total => {
+            when => 'total',
+            count => $count
+        }
+    };
 }
 
 
-
 __PACKAGE__->register_method(
     method      => 'fetch_notes',
     authoritative   => 1,
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm
index 4dc3e47..435f104 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm
@@ -13,46 +13,6 @@ my $log = 'OpenSRF::Utils::Logger';
 use MARC::Record;
 use MARC::File::XML ( BinaryEncoding => 'UTF-8' );
 
-sub circ_count {
-    my $self = shift;
-    my $client = shift;
-    my $copy = shift;
-    my $granularity = shift;
-
-    my $c_table = action::circulation->table;
-
-    if (lc($granularity) eq 'year') {
-        $granularity = ", to_char(xact_start, 'YYYY') as when";
-    } elsif (lc($granularity) eq 'month') {
-        $granularity = ", to_char(xact_start, 'YYYY-MM') as when";
-    } elsif (lc($granularity) eq 'day') {
-        $granularity = ", to_char(xact_start, 'YYYY-MM-DD') as when";
-    } else {
-        $granularity = ", 'total' as when";
-    }
-
-    my $SQL = <<"    SQL";
-        SELECT  COUNT(*) as count $granularity
-          FROM  $c_table
-          WHERE target_copy = ?
-    SQL
-
-
-    if ($granularity !~ /total/o) {
-        $SQL .= ' GROUP BY 2 ORDER BY 2';
-    }
-
-    $log->debug("Circ count SQL [$SQL]", DEBUG);
-
-    return action::circulation->db_Main->selectall_hashref($SQL, 'when', {}, $copy);
-}
-__PACKAGE__->register_method(
-    method      => 'circ_count',
-    api_name    => 'open-ils.storage.asset.copy.circ_count',
-    argc        => 1,
-);
-
-
 #our $_default_subfield_map = {
 #        call_number     => $cn,
 #        barcode         => $bc,

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Application/Circ.pm   |   28 ++++++++++----
 .../OpenILS/Application/Storage/Publisher/asset.pm |   40 --------------------
 2 files changed, 20 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list