lp1668352 patrons with negative balance barcode user/mrisher/lp1668352-negative-balances-barcode
authorMike Risher <mrisher@catalyte.io>
Tue, 11 Feb 2020 19:22:22 +0000 (19:22 +0000)
committerMike Risher <mrisher@catalyte.io>
Tue, 11 Feb 2020 19:22:22 +0000 (19:22 +0000)
WIP

Signed-off-by: Mike Risher <mrisher@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2
modified:   Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js

Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2
Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js

index 8291796..599f794 100644 (file)
@@ -41,6 +41,9 @@
     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>
index 1386c6c..098aef5 100644 (file)
@@ -10,6 +10,8 @@ function($scope , $q , $timeout , $location , $window , egCore ,
 
     $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();
@@ -22,9 +24,18 @@ function($scope , $q , $timeout , $location , $window , egCore ,
             '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);
 
@@ -46,14 +57,42 @@ function($scope , $q , $timeout , $location , $window , egCore ,
         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.