add basic monograph parts output to supercat holdings display
authorMike Rylander <mrylander@gmail.com>
Tue, 22 Feb 2011 13:20:06 +0000 (08:20 -0500)
committerMike Rylander <mrylander@gmail.com>
Tue, 22 Feb 2011 13:20:06 +0000 (08:20 -0500)
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm

index 965db28..9bae9f8 100644 (file)
@@ -4625,6 +4625,7 @@ SELECT  usr,
                        <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
@@ -4641,6 +4642,7 @@ SELECT  usr,
                        <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
                        <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
                        <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
+                       <link field="monograph_parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
index eed53b1..affe31f 100644 (file)
@@ -1705,7 +1705,7 @@ sub retrieve_copy {
                    { flesh             => 2,
                          flesh_fields  => {
                                                acn     => [qw/owning_lib record/],
-                                               acp     => [qw/call_number location status circ_lib stat_cat_entries notes/],
+                                               acp     => [qw/call_number location status circ_lib stat_cat_entries notes parts/],
                                }
                    })
             ->gather(1))
@@ -1749,7 +1749,7 @@ sub retrieve_callnumber {
                          flesh_fields  => {
                                                acn     => [qw/owning_lib record copies uri_maps/],
                                                auricnm => [qw/uri/],
-                                               acp     => [qw/location status circ_lib stat_cat_entries notes/],
+                                               acp     => [qw/location status circ_lib stat_cat_entries notes parts/],
                                }
                    })
             ->gather(1))
@@ -1797,7 +1797,7 @@ sub basic_record_holdings {
                  flesh_fields  => {
                                        bre     => [qw/call_numbers/],
                                        acn     => [qw/copies owning_lib/],
-                                       acp     => [qw/location status circ_lib/],
+                                       acp     => [qw/location status circ_lib parts/],
                                }
                }
        )->gather(1);
@@ -1950,7 +1950,7 @@ sub new_record_holdings {
                  flesh_fields  => {
                                        acn     => [qw/copies owning_lib uri_maps/],
                                        auricnm => [qw/uri/],
-                                       acp     => [qw/circ_lib location status stat_cat_entries notes/],
+                                       acp     => [qw/circ_lib location status stat_cat_entries notes parts/],
                                        asce    => [qw/stat_cat/],
                                },
           ( $limit > -1 ? ( limit  => $limit  ) : () ),
@@ -3357,7 +3357,16 @@ sub as_xml {
     $xml .= 'name="'.$self->escape( $self->obj->circ_lib->name ) .'" opac_visible="'.$self->obj->circ_lib->opac_visible.'"/>';
     $xml .= "\n";
 
-       $xml .= "        <copy_notes>\n";
+       $xml .= "        <monograph_parts>\n";
+       if (ref($self->obj->parts) && $self->obj->parts) {
+               for my $part ( @{$self->obj->parts} ) {
+                       next unless ( $note->pub eq 't' );
+                       $xml .= sprintf('        <monograph_part record="%s" sortkey="%s">%s</monograph_part>',$part->record, $self->escape($part->label_sortkey), $self->escape($part->label));
+                       $xml .= "\n";
+               }
+       }
+
+       $xml .= "        </monograph_parts>\n";
        if (ref($self->obj->notes) && $self->obj->notes) {
                for my $note ( @{$self->obj->notes} ) {
                        next unless ( $note->pub eq 't' );