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

Evergreen Git git at git.evergreen-ils.org
Mon Sep 26 10:33:54 EDT 2011


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  be71f1911d4c1eea8d796f39cf15f94e164d246f (commit)
       via  46642d7ab8c8d5c0cb3caf26dbb67bc399f318fd (commit)
       via  a36f7b4c1015541f81c6e3c3ebf8e2e21dbcdbb8 (commit)
      from  ed2310ad88bebe1f8be9cf3764ec11503c25f74f (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 be71f1911d4c1eea8d796f39cf15f94e164d246f
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Sep 18 22:27:00 2011 -0400

    TPAC: Add some style to MFHD holdings summaries
    
    Simple grey background for the holdings summary header for each record;
    add a TBODY element to the holdings table for validity; offset the MFHD
    type by 1em to group entries under each holdings location.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/issues.tt2 b/Open-ILS/src/templates/opac/parts/record/issues.tt2
index 47f63f0..00a3eca 100644
--- a/Open-ILS/src/templates/opac/parts/record/issues.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/issues.tt2
@@ -25,7 +25,7 @@ FOREACH type IN ctx.holding_summaries.keys;
 [% END %]
 [% IF ctx.mfhd_summaries.size; %]
     <div class="rdetail-mfhd-holdings">
-        <table>
+        <table><tbody>
 [%
         mfhd = {
             basic_holdings = l('Volumes'),
@@ -40,6 +40,11 @@ FOREACH type IN ctx.holding_summaries.keys;
         };
 
         FOREACH serial IN ctx.mfhd_summaries;
+%]
+            <tr>
+                <td class="rdetail-mfhd-head" colspan="2">[% l('Holdings summary ([_1])', serial.location) %]</td>
+            </tr>
+[%
             FOREACH type IN mfhd.keys;
                 NEXT UNLESS serial.$type.size;
 %]
@@ -48,8 +53,11 @@ FOREACH type IN ctx.holding_summaries.keys;
                 <td class="rdetail-mfhd-contents">[% serial.$type.join(', ') %]</td>
             </tr>
         [% END %]
+            <tr>
+                <td class="rdetail-mfhd-foot" colspan="2"> </td>
+            </tr>
     [% END %]
-        </table>
+        </tbody></table>
     </div>
 [% END %]
 </div>
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index 226e4b9..7c1cd69 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -1028,6 +1028,20 @@ a.opac-button {
     padding: 0px;
 }
 
+.rdetail-mfhd-head {
+    margin-top: 5px;
+    padding-top: 5px;
+    background-color: #D8D8D8;
+}
+
+.rdetail-mfhd-type {
+    padding-left: 1em;
+}
+
+.rdetail-mfhd-bottom {
+    border-bottom: thin solid black;
+    width: 100%;
+}
 
 .bookbag-item-row td { vertical-align: top; }
 

commit 46642d7ab8c8d5c0cb3caf26dbb67bc399f318fd
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Sep 18 21:12:23 2011 -0400

    TPAC: Give MFHD summaries OU / depth awareness
    
    Rather than returning all results and filtering on the client-side, as
    we're currently doing in the JSPAC, teach the
    open-ils.search.serial.record.bib.retrieve method to accept optional OU
    & OU depth arguments and do the filtering in the query; cuts down on
    network traffic and should be generally more efficient.
    
    Note that in the absence of an explicit "depth" CGI param,
    EGCatLoader/Record currently defaults to a depth of "0"; we could
    teach it to look up & cache the depth of the "loc" param for the sake of
    convenience & arguably more accuracy.
    
    Also note that the sub/dist serial approach probably needs to be taught
    similar method-side filtering, but I hope more knowledgeable brains will
    work out what should happen with ssub.holding_lib / sdist.owning_lib.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
index 0617f5e..27c9206 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
@@ -107,14 +107,48 @@ Given a bib record ID, returns a hash of holdings statements
 #);
 
 sub bib_to_svr {
-	my ($self, $client, $bib) = @_;
+	my ($self, $client, $bib, $ou, $ou_depth) = @_;
 	
 	my $svrs = [];
 
 	my $e = OpenILS::Utils::CStoreEditor->new();
+
+    if (!$ou) {
+        # Get the root of the org_tree
+        my $aous = $e->search_actor_org_unit([{
+            "parent_ou" => undef
+        }]); 
+
+        $ou = $aous->[0]->id();
+    }
+
+    # ou_depth can be undef in get_org_descendants
+    my @orgs = $U->get_org_descendants($ou, $ou_depth);
+
     # TODO: 'deleted' ssub support
-    my $sdists = $e->search_serial_distribution([{ "+ssub" => {"record_entry" => $bib} }, { "flesh" => 1, "flesh_fields" => {'sdist' => [ "record_entry", "holding_lib", "basic_summary", "supplement_summary", "index_summary" ]}, "join" => {"ssub" => {}} }]);
-	my $sres = $e->search_serial_record_entry([{ record => $bib, deleted => 'f', "+sdist" => {"id" => undef} }, { "join" => {"sdist" => { 'type' => 'left' }} }]);
+    my $sdists = $e->search_serial_distribution([
+        {
+            "+ssub" => {"record_entry" => $bib}
+        },
+        {
+            "flesh" => 1,
+            "flesh_fields" => {
+                'sdist' => [ "record_entry", "holding_lib", "basic_summary", "supplement_summary", "index_summary" ]
+            },
+            "join" => {"ssub" => {}}
+        }
+    ]);
+	my $sres = $e->search_serial_record_entry([
+        {
+            record => $bib,
+            deleted => 'f',
+            "owning_lib" => { "in" => @orgs },
+            "+sdist" => {"id" => undef}
+        },
+        {
+            "join" => { "sdist" => { 'type' => 'left' } } 
+        }
+    ]);
 	if (!ref $sres and !ref $sdists) {
 		return undef;
 	}
@@ -189,7 +223,25 @@ __PACKAGE__->register_method(
 	method	=> "bib_to_svr",
 	api_name	=> "open-ils.search.serial.record.bib.retrieve",
 	argc		=> 1, 
-	note		=> "Given a bibliographic record ID, return holdings in svr form"
+    signature => {
+        desc   => 'Given a bibliographic record ID, return holdings in svr form',
+        params => [
+            {   name => 'bibid',
+                desc => 'ID of the bibliographic record to which serial holdings are attached',
+                type => 'number'
+            },
+            {
+                name => 'ou',
+                desc => 'ID of the org_unit on which the search is based',
+                type => 'number'
+            },
+            {
+                name => 'ou_depth',
+                desc => 'Depth of the org tree at which the search should occur', 
+                type => 'number'
+            }
+        ]
+    }
 );
 
 1;
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 2a42644..009372c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -219,12 +219,10 @@ sub get_holding_summaries {
 sub get_mfhd_summaries {
     my ($self, $rec_id, $org, $depth) = @_;
 
-    # XXX TODO Filter results on OU / depth before returning
-    # Perhaps in a modified form of the osrf method, rather than here
     my $serial = create OpenSRF::AppSession("open-ils.search");
     my $result = $serial->request(
         "open-ils.search.serial.record.bib.retrieve",
-        $rec_id
+        $rec_id, $org, $depth
     )->gather(1);
 
     $serial->kill_me;

commit a36f7b4c1015541f81c6e3c3ebf8e2e21dbcdbb8
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Sep 18 01:37:37 2011 -0400

    TPAC: tentative MFHD display steps
    
    Retrieve and display MFHD records in the TPAC, piggybacking on the
    "Issues" twisty section.
    
    TODO: Take org_unit & depth into account when deciding which MFHD
    records to display. Right now we're just showing all of them.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index bc60edc..2a42644 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -44,11 +44,11 @@ sub load_record {
     $ctx->{copy_offset} = $copy_offset;
 
     $ctx->{have_holdings_to_show} = 0;
+    $ctx->{have_mfhd_to_show} = 0;
     $self->get_hold_copy_summary($rec_id, $org);
 
     $cstore->kill_me;
 
-    # XXX TODO we'll also need conditional logic to show MFHD-based holdings
     if (
         $ctx->{get_org_setting}->
             ($org, "opac.fully_compressed_serial_holdings")
@@ -60,6 +60,14 @@ sub load_record {
             scalar(@{$ctx->{holding_summaries}->{basic}}) ||
             scalar(@{$ctx->{holding_summaries}->{index}}) ||
             scalar(@{$ctx->{holding_summaries}->{supplement}});
+    } else {
+        $ctx->{mfhd_summaries} =
+            $self->get_mfhd_summaries($rec_id, $org, $depth);
+
+        if ($ctx->{mfhd_summaries} && scalar(@{$ctx->{mfhd_summaries}})
+        ) {
+            $ctx->{have_mfhd_to_show} = 1;
+        };
     }
 
     my %expandies = (
@@ -208,6 +216,21 @@ sub get_holding_summaries {
     return $result;
 }
 
+sub get_mfhd_summaries {
+    my ($self, $rec_id, $org, $depth) = @_;
+
+    # XXX TODO Filter results on OU / depth before returning
+    # Perhaps in a modified form of the osrf method, rather than here
+    my $serial = create OpenSRF::AppSession("open-ils.search");
+    my $result = $serial->request(
+        "open-ils.search.serial.record.bib.retrieve",
+        $rec_id
+    )->gather(1);
+
+    $serial->kill_me;
+    return $result;
+}
+
 sub get_expanded_holdings {
     my ($self, $rec_id, $org, $depth) = @_;
 
diff --git a/Open-ILS/src/templates/opac/parts/record/extras.tt2 b/Open-ILS/src/templates/opac/parts/record/extras.tt2
index 7c7339d..5bf5716 100644
--- a/Open-ILS/src/templates/opac/parts/record/extras.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/extras.tt2
@@ -23,7 +23,7 @@
             {name => 'annotation', label => l('Annotation'), hide => 1}, 
             {name => 'awards',  label => l('Awards, Reviews, & Suggested Reads')}, 
             {name => 'excerpt',  label => l('Excerpt'), hide => 1},
-            {name => 'issues',   label => l('Issues Held'), hide => !ctx.have_holdings_to_show},
+            {name => 'issues',   label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
             {name => 'preview',  label => l('Preview'), hide => 1}, 
             {name => 'cnbrowse', label => l('Shelf Browser')},
             {name => 'marchtml', label => l('MARC Record')}
diff --git a/Open-ILS/src/templates/opac/parts/record/issues.tt2 b/Open-ILS/src/templates/opac/parts/record/issues.tt2
index e13efb2..47f63f0 100644
--- a/Open-ILS/src/templates/opac/parts/record/issues.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/issues.tt2
@@ -23,4 +23,33 @@ FOREACH type IN ctx.holding_summaries.keys;
         [% END %]
     </div>
 [% END %]
+[% IF ctx.mfhd_summaries.size; %]
+    <div class="rdetail-mfhd-holdings">
+        <table>
+[%
+        mfhd = {
+            basic_holdings = l('Volumes'),
+            basic_holdings_add = l('Additional Volume Information'),
+            supplement_holdings = l('Supplements'),
+            supplement_holdings_add = l('Additional Supplement Information'),
+            index_holdings = l('Indexes'),
+            index_holdings_add = l('Additional Index Information'),
+            online = l('Online'),
+            missing = l('Missing'),
+            incomplete = l('Incomplete'),
+        };
+
+        FOREACH serial IN ctx.mfhd_summaries;
+            FOREACH type IN mfhd.keys;
+                NEXT UNLESS serial.$type.size;
+%]
+            <tr>
+                <td class="rdetail-mfhd-type">[% mfhd.$type %]</td>
+                <td class="rdetail-mfhd-contents">[% serial.$type.join(', ') %]</td>
+            </tr>
+        [% END %]
+    [% END %]
+        </table>
+    </div>
+[% END %]
 </div>

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

Summary of changes:
 .../lib/OpenILS/Application/Search/Serial.pm       |   60 ++++++++++++++++++-
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |   23 +++++++-
 .../src/templates/opac/parts/record/extras.tt2     |    2 +-
 .../src/templates/opac/parts/record/issues.tt2     |   37 ++++++++++++
 Open-ILS/web/css/skin/default/opac/style.css       |   14 +++++
 5 files changed, 130 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list