LP#1955931 Staff catalog show more details - add due date
authorDan Briem <dbriem@wlsmail.org>
Thu, 30 Dec 2021 14:51:34 +0000 (09:51 -0500)
committerMichele Morgan <mmorgan@noblenet.org>
Wed, 2 Mar 2022 21:46:24 +0000 (16:46 -0500)
Adds a due date column to the show more details view in
the Angular staff catalog.

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm

index 868d6fe..7b070fe 100644 (file)
             <div class="row p-1 font-weight-bold border-top">
               <div class="col-lg-2" i18n>Library</div>
               <div class="col-lg-3" i18n>Shelving location</div>
-              <div class="col-lg-4" i18n>Call number</div>
-              <div class="col-lg-3" i18n>Status</div>
+              <div class="col-lg-3" i18n>Call number</div>
+              <div class="col-lg-2" i18n>Status</div>
+              <div class="col-lg-2" i18n>Due date</div>
             </div>
             <div class="row p-1 mt-1 mb-1 border-top" *ngFor="let copy of summary.copies">
               <div class="col-lg-2" i18n>{{copy.circ_lib_sn}}</div>
               <div class="col-lg-3" i18n>{{copy.copy_location}}</div>
-              <div class="col-lg-4" i18n>
+              <div class="col-lg-3" i18n>
                 {{copy.call_number_prefix_label}} 
                 {{copy.call_number_label}}
                 {{copy.call_number_suffix_label}}
               </div>
-              <div class="col-lg-3" i18n>{{copy.copy_status}}</div>
+              <div class="col-lg-2" i18n>{{copy.copy_status}}</div>
+              <div class="col-lg-2" *ngIf="copy.due_date">
+                {{copy.due_date | date:'shortDate'}}
+              </div>
             </div>
           </ng-container>
           <ng-container *ngIf="!summary.copies.length && !summary.eResourceUrls.length">
index 20cec4e..3af4a33 100644 (file)
@@ -3163,12 +3163,12 @@ sub get_representative_copies {
     return [] unless $org;
 
     my $func = 'unapi.biblio_record_entry_feed';
-    my $includes = '{holdings_xml,acp,acnp,acns}';
+    my $includes = '{holdings_xml,acp,acnp,acns,circ}';
     my $limits = "acn=>$limit,acp=>$limit";
 
     if ($is_meta) {
         $func = 'unapi.metabib_virtual_record_feed';
-        $includes = '{holdings_xml,acp,acnp,acns,mmr.unapi}';
+        $includes = '{holdings_xml,acp,acnp,acns,circ,mmr.unapi}';
         $limits .= ",bre=>$limit";
     }
 
@@ -3196,6 +3196,12 @@ sub get_representative_copies {
             my $status = $copy->getElementsByTagName('status')->[0]->textContent;
             my $location = $copy->getElementsByTagName('location')->[0]->textContent;
             my $circ_lib_sn = $copy->getElementsByTagName('circ_lib')->[0]->getAttribute('shortname');
+            my $due_date = '';
+
+            my $current_circ = $copy->findnodes('./*[local-name()="current_circulation"]')->[0];
+            if (my $circ = $current_circ->findnodes('./*[local-name()="circ"]')) {
+                $due_date = $circ->[0]->getAttribute('due_date');
+            }
 
             push(@$copies, {
                 call_number_label => $label,
@@ -3203,7 +3209,8 @@ sub get_representative_copies {
                 call_number_suffix_label => $suffix,
                 circ_lib_sn => $circ_lib_sn,
                 copy_status => $status,
-                copy_location => $location
+                copy_location => $location,
+                due_date => $due_date
             });
         }
     }