aggregate hold notes in pull list fm_idl definition user/lew/lp-1964986-pull-list-notes
authorLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Wed, 23 Mar 2022 17:55:53 +0000 (13:55 -0400)
committerLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Wed, 23 Mar 2022 17:55:53 +0000 (13:55 -0400)
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2

index 674ace4..37abd55 100644 (file)
@@ -6672,6 +6672,7 @@ SELECT  usr,
                        au.prefix AS usr_prefix,
                        au.suffix AS usr_suffix,
                        au.alias AS usr_alias,
+                       ahrn.body AS notes,
                        CASE WHEN au.alias IS NOT NULL THEN
                                au.alias
                        ELSE
@@ -6729,7 +6730,8 @@ SELECT  usr,
                LEFT JOIN asset.copy_location_order acplo
                        ON (acp.location = acplo.location AND
                                acp.circ_lib = acplo.org)
-               WHERE
+               LEFT JOIN (SELECT hold,'[' || string_agg(body,', ' ORDER BY ID) || ']' as body FROM action.hold_request_note GROUP BY 1) ahrn on ahrn.hold = ahr.id
+        WHERE
                        ahr.capture_time IS NULL AND
                        ahr.cancel_time IS NULL AND
                        csp.id IS NULL AND
@@ -6775,7 +6777,7 @@ SELECT  usr,
                        <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
                        <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
                        <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
-                       <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
+                       <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
                        <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
                        <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
                        <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
@@ -6809,7 +6811,7 @@ SELECT  usr,
                        <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
                        <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
                        <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
-                       <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
+                       <!--<link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>-->
                        <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
                        <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
index eda5f05..efc9148 100644 (file)
     label="[% l('Item Status') %]"></eg-grid-field>
   <eg-grid-field name="copy_circ_lib_id" path="current_copy.circ_lib.id" 
     required hidden label="[% l('Item Circ Lib ID') %]"></eg-grid-field>
-  <eg-grid-field name="notes" path="notes.body" 
+  <eg-grid-field name="notes" path="notes 
     hidden required label="[% l('Hold Notes') %]"></eg-grid-field>
   <eg-grid-field name="patron_id" path="usr.id" hidden required></eg-grid-field>
   <eg-grid-field name="patron_barcode" path="usr.card.barcode"