label="[% l('Retrieve Patron') %]"></eg-grid-action>
<eg-grid-field label="[% l('Barred') %]" path='usr.barred'></eg-grid-field>
+ <eg-grid-field label="[% l('Barcode') %]">
+ <a href="[% usr.url %]" target="_blank">[% l('{{usr.card.barcode}}'); %]</a>
+ </eg-grid-field>
<eg-grid-field label="[% l('Date of Birth') %]" dateformat="{{$root.egDateFormat}}" datatype="timestamp" path='usr.dob'></eg-grid-field>
<eg-grid-field label="[% l('Last Name') %]" path='usr.family_name'></eg-grid-field>
<eg-grid-field label="[% l('First Name') %]" path='usr.first_given_name'></eg-grid-field>
$scope.grid_provider = egGridDataProvider.instance({});
+
+
// API does not currenlty support paging, so it's all or none.
$scope.grid_provider.get = function(offset, count) {
if (!$scope.context_org) return $q.when();
'open-ils.actor.users.negative_balance',
egCore.auth.token(), $scope.context_org.id())
.then(deferred.resolve, null, function(blob) {
+ console.log("blob")
+ console.log(blob)
+ console.log(blob.usr)
+ console.log(blob.usr.id())
+ // console.log(blob.usr.card().barcode())
egProgressDialog.increment();
+ blob.url = "./circ/patron/" + blob.usr.id() + "/checkout/";
// Give the grid a top-level identifier field
blob.usr_id = blob.usr.id();
+ console.log("after blob")
+ console.log(blob);
+ console.log(blob.usr);
deferred.notify(blob)
}).finally(egProgressDialog.close);
if (!selected.length) return;
angular.forEach(selected, function(data) {
$timeout(function() {
+ console.log("data")
+ console.log(data)
+ console.log(data.usr)
var url = $location.absUrl().replace(
/admin\/local\/.*/,
'circ/patron/' + data.usr.id() + '/checkout');
+ console.log(url)
$window.open(url, '_blank')
});
});
}
+ // egCore.net.request(
+ // 'open-ils.actor',
+ // 'open-ils.actor.get_barcodes',
+ // egCore.auth.token(), egCore.auth.user().ws_ou(),
+ // 'actor', args.barcode)
+
+ // .then(function(resp) { // get_barcodes
+
+ // if (evt = egCore.evt.parse(resp)) {
+ // console.error(evt.toString());
+ // return;
+ // }
+
+ // if (!resp || !resp[0]) {
+ // $scope.bcNotFound = args.barcode;
+ // $scope.selectMe = true;
+ // return;
+ // }
+
+ // // see if an opt-in request is needed
+ // user_id = resp[0].id;
+ // $location.path($location.path() + '/' + user_id);
+ // });
+
$scope.grid_controls = {
activateItem : function(selected) {
// activateItem returns a single row.