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>
<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>
sub _add_card {
my( $e, $card ) = @_;
$card->clear_id();
+ $card->creator($e->requestor->id);
$logger->info("Adding new patron card ".$card->barcode);
__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;
<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'>
<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>
<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>
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">
font-weight: bold;
}
+.patron-reg-barcodes div .col-md-4 { width: 115px; }
+
.patron-reg-barcodes > .header {
font-weight: bold;
}