LP#1642000 - Add CN Prefix, Suffix and Parts to opac checked out item display
authorJosh Stompro <stompro@stompro.org>
Fri, 16 Jul 2021 20:01:53 +0000 (15:01 -0500)
committerJosh Stompro <stompro@stompro.org>
Fri, 16 Jul 2021 20:45:05 +0000 (15:45 -0500)
Add Call Number Prefix, Call Number Suffix and Part to the call number column of
checked out items display.  Also sort based on the label_sortkey value of those fields.

Testing Notes:

Check out an asortment of copies to your patron account.  Pick a mix of items with
Call number prefix and suffix, and some with parts.

View the list of checked out items in the myopac interface.

Notices that no call number suffix or prefix are showing, and no parts info is showing.

Apply the patch and see that the extra info is showing.  Also try sorting on call number column.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/circs.tt2

index f77c1e0..859ea0f 100644 (file)
@@ -2048,8 +2048,8 @@ sub fetch_user_circs {
         flesh => 3,
         flesh_fields => {
             circ => ['target_copy'],
-            acp => ['call_number'],
-            acn => ['record','owning_lib']
+            acp => ['call_number','parts'],
+            acn => ['record','owning_lib','prefix','suffix']
         }
     };
 
index 1c068be..1d3695a 100644 (file)
                           circ.SORTING = circ.circ.target_copy.barcode;
 
                        CASE "callnum";
-                          circ.SORTING = circ.circ.target_copy.call_number.label;
+                          sortlist = [];
+
+                          FOREACH element IN [circ.circ.target_copy.call_number.prefix.label_sortkey
+                                              circ.circ.target_copy.call_number.label_sortkey
+                                              circ.circ.target_copy.call_number.suffix.label_sortkey
+                                              circ.circ.target_copy.parts.0.label_sortkey];
+                              IF (element);
+                                  sortlist.push(element);
+                              END;
+                          END;
+                          circ.SORTING = sortlist.join("");
+
                        CASE "lib";
                           circ.SORTING = circ.circ.target_copy.call_number.owning_lib.name;
                        
                             [% circ.circ.target_copy.barcode | html %]
                         </td>
                         <td name="call_number">
-                            [% circ.circ.target_copy.call_number.label | html %]
+                            [%-
+                                 cnlist = [];
+                                 FOREACH element IN [circ.circ.target_copy.call_number.prefix.label
+                                              circ.circ.target_copy.call_number.label
+                                              circ.circ.target_copy.call_number.suffix.label];
+                                     IF (element);
+                                       cnlist.push(element);
+                                     END;
+                                 END;
+                                 cn = cnlist.join(' ');
+                            %]
+                            [% cn | html %]
+                            [%- IF circ.circ.target_copy.parts.0.label %]
+                                  </BR>[% circ.circ.target_copy.parts.0.label | html -%]
+                            [%- END %]
                         </td>
                         [% IF ctx.get_org_setting(ctx.user.home_ou, 'opac.show_owning_lib_column'); %]
                           <td name="lib">