LP#1705332 - Add creation date and creator(staff user account) to patron barcodes.
authorBill Ott <bott@grpl.org>
Mon, 20 Sep 2021 22:34:00 +0000 (17:34 -0500)
committerJosh Stompro <stompro@stompro.org>
Mon, 20 Sep 2021 22:40:33 +0000 (17:40 -0500)
Code from Bill Ott for local change that they have been using for a number of years.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/actor.pm
Open-ILS/src/templates/actor/user/register.tt2
Open-ILS/src/templates/staff/circ/patron/t_patron_cards_dialog.tt2
Open-ILS/src/templates/staff/css/circ.css.tt2

index 4cfdd3f..5e78cb5 100644 (file)
@@ -7249,9 +7249,12 @@ SELECT  usr,
                        <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
                        <field reporter:label="Card ID" name="id" reporter:datatype="id" />
                        <field reporter:label="User" name="usr" reporter:datatype="link"/>
+                        <field reporter:label="Creator" name="creator" reporter:datatype="link" />
+                        <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
+                        <link field="creator" reltype="has_a" key="id" map="" class="au"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
                        <actions>
index faf723b..afc742d 100644 (file)
@@ -1012,6 +1012,7 @@ sub _add_update_cards {
 sub _add_card {
     my( $e, $card ) = @_;
     $card->clear_id();
+    $card->creator($e->requestor->id);
 
     $logger->info("Adding new patron card ".$card->barcode);
 
index 6bf0481..8772a0a 100644 (file)
@@ -150,7 +150,7 @@ use base qw/actor/;
 
 __PACKAGE__->table( 'actor_card' );
 __PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Essential => qw/usr barcode active/ );
+__PACKAGE__->columns( Essential => qw/usr barcode active creator create_date/ );
 
 #-------------------------------------------------------------------------------
 package actor::user_access_entry;
index 7a02e9f..7fcc04a 100644 (file)
@@ -62,6 +62,8 @@
                     <th id='uedit-all-cards-barcode'>[% l('Barcode') %]</th>
                     <th id='uedit-all-cards-active'>[% l('Active') %]</th>
                     <th id='uedit-all-cards-primary'>[% l('Primary') %]</th>
+                    <th id='uedit-all-cards-create_date'>[% l('Created') %]</th>
+                    <th id='uedit-all-cards-creator'>[% l('Creator') %]</th>
                 </tr>
             </thead>
             <tbody id='uedit-all-cards-tbody'>
@@ -69,6 +71,8 @@
                     <td><div name='barcode'></div></td>
                     <td><div name='active'></div></td>
                     <td><div name='primary'></div></td>
+                    <td><div name='create_date'></div></td>
+                    <td><div name='creator'></div></td>
                 </tr>
             </tbody>
             <tbody>
index b171d71..10c5970 100644 (file)
         <div class="col-md-4">
           <label>[% l('Primary') %]</label>
         </div>
+        <div class="col-md-4">
+          <label>[% l('Created') %]</label>
+        </div>
+        <div class="col-md-4">
+          <label>[% l('Creator') %]</label>
+        </div>
       </div>
       <div class="row" ng-repeat="card in args.cards">
         <div class="col-md-4">{{card.barcode}}</div>
@@ -28,6 +34,8 @@
             ng-value='card.id'
             ng-disabled="!perms.UPDATE_PATRON_PRIMARY_CARD"/>
         </div>
+        <div class="col-md-4">{{card.create_date | limitTo:10}}</div>
+        <div class="col-md-4">{{card.creator}}</div>
       </div>
     </div>
     <div class="modal-footer">
index 5a92101..b7e92bc 100644 (file)
@@ -154,6 +154,8 @@ but the ones I'm finding aren't quite cutting it..*/
   font-weight: bold;
 }
 
+.patron-reg-barcodes div .col-md-4 { width: 115px; }
+
 .patron-reg-barcodes > .header {
   font-weight: bold;
 }