LP1739288: Add a summary report to the list of bad barcodes. user/sandbergja/lp1739288_report_invalid_barcodes_in_item_status
authorJane Sandberg <sandbej@linnbenton.edu>
Sat, 26 Oct 2019 16:04:00 +0000 (09:04 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 26 Oct 2019 16:49:14 +0000 (09:49 -0700)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/templates/staff/cat/item/index.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 55951b9..51c014d 100644 (file)
 </div>
 
 <div class="row">
-  <div class="col-md-6">
+  <div class="col-md-9">
     <div ng-show="context.itemsNotFound.length" class="alert alert-danger" role="alert">
       <h3>[% l('The following barcodes are incorrect or deleted') %]</h3>
       <ul>
       </ul>
     </div>
   </div>
+  <div class="col-md-3" ng-show="context.fileDoneLoading">
+    <div ng-show="context.itemsNotFound.length" class="alert alert-info" role="alert">
+      <h3>[% l('Summary of file load') %]</h3>
+      <ul>
+        <li>[% l('[_1] valid barcodes', '{{context.numBarcodesInFile - context.itemsNotFound.length}}') %]</li>
+        <li>[% l('[_1] invalid barcodes', '{{context.itemsNotFound.length}}') %]</li>
+        <li>[% l('[_1] total barcodes', '{{context.numBarcodesInFile}}') %]</li>
+      </ul>
+    </div>
+  </div>
 </div>
 
 <div ng-view></div>
index 94e7024..5f0b01a 100644 (file)
@@ -360,6 +360,8 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
 
     $scope.$watch('barcodesFromFile', function(newVal, oldVal) {
         $scope.context.itemsNotFound = [];
+        $scope.context.fileDoneLoading = false;
+        $scope.context.numBarcodesInFile = 0;
         if (newVal && newVal != oldVal) {
             $scope.args.barcode = '';
             var barcodes = [];
@@ -386,6 +388,7 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
                     if(itemSvc.copies[0]){  // Were any copies actually retrieved
                         copyGrid.selectItems([itemSvc.copies[0].index]);
                     }
+                    $scope.context.fileDoneLoading = true;
                     return;
                 }
 
@@ -398,6 +401,7 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
             }
 
             if (barcodes.length) {
+                $scope.context.numBarcodesInFile = barcodes.length;
                 egProgressDialog.open({value: 0, max: barcodes.length});
                 fetch_next_copy();
             }