</links>
<!-- Not available via PCRUD at this time -->
</class>
-
+ <class id="sasum" controller="open-ils.cstore" oils_obj:fieldmapper="serial::any_summary" oils_persist:tablename="serial.any_summary" reporter:label="All Issues' Summaries" oils_persist:readonly="true">
+ <fields>
+ <field name="summary_type" reporter:label="Summary Type" report:datatype="text" />
+ <field name="id" reporter:label="Native ID" report:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
+ <field name="distribution" reporter:label="Distribution" report:datatype="link" />
+ <field name="generated_coverage" reporter:label="Generated Coverage" report:datatype="text" />
+ <field name="show_generated" reporter:label="Show Generated?" report:datatype="bool" />
+ </fields>
+ <links>
+ <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
+ </links>
+ </class>
<class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
<fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
<field reporter:label="ID" name="id" reporter:datatype="id" />
}
);
+# XXX give a less confusing name, as this addresses what
+# scoped_bib_holdings_summary() does, only more correctly. Maybe use api_level
+# to offer the old and the new functionality side by side, if not replacing
+# the old function altogether
+
+sub scoped_holdings_tree_for_bib {
+ my ($self, $client, $bib, $opts) = @_;
+
+ # XXX trying to implement the first method defined in my notes (the pencil page)
+
+ # TODO $opts->{org_unit} ||= top_of_org_tree;
+ $opts->{depth} ||= 0;
+ $opts->{limit} ||= 10;
+ $opts->{offset} ||= 0;
+
+ my $e = new_editor;
+
+ my $rows = $e->json_query({
+ select => {
+ sasum => [qw/summary_type id generated_coverage/],
+ sdist => [qw/holding_lib/],
+ },
+ from => {
+ sasum => {
+ sdist => {
+ join => { ssub => { } }
+ }
+ }
+ },
+ where => {
+ "+sdist" => {
+ holding_lib => $U->get_org_descendants(
+ int($opts->{org_unit}), int($opts->{depth})
+ )
+ },
+ "+ssub" => {record_entry => int($bib)}
+ },
+ limit => int($opts->{limit}),
+ offset => int($opts->{offset})
+ }) or return $e->die_event;
+
+
+ $e->disconnect;
+
+}
##########################################################################
# unit methods