Adds "Total Circ Count" and "Last Circ Date" to the staff catalog Item
Table grid view.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Shula Link <slink@gchrl.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
</eg-grid-column>
<eg-grid-column i18n-label label="Due Date" path="due_date" datatype="timestamp">
</eg-grid-column>
+ <eg-grid-column i18n-label label="Last Circ Date" path="last_circ" datatype="timestamp">
+ </eg-grid-column>
+ <eg-grid-column i18n-label label="Total Circ Count" path="circ_count">
+ </eg-grid-column>
</eg-grid>
</div>
bmp => [
{column => 'label', alias => 'part_label'},
],
+ ($staff ? (erfcc => ['circ_count']) : ()),
($iss_id ? (sitem => ["issuance"]) : ())
},
sstr => { }
}
}
- } : ())
+ } : ()),
+ ($staff ? {
+ erfcc => {
+ fkey => 'id',
+ field => 'id'
+ }
+ }: ()),
]
},
my $resp;
while ($resp = $req->recv) {
- $client->respond($resp->content);
+ my $copy = $resp->content;
+
+ if ($is_staff) {
+ # last_circ is an IDL query so it cannot be queried directly
+ # via JSON query.
+ $copy->{last_circ} =
+ new_editor()->retrieve_reporter_last_circ_date($copy->{id})
+ ->last_circ;
+ }
+
+ $client->respond($copy);
}
return undef;