starting checkin mods
authorBill Erickson <berick@esilibrary.com>
Mon, 23 Jun 2014 21:27:40 +0000 (17:27 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 23 Jun 2014 21:27:40 +0000 (17:27 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/checkin/index.tt2
Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js
Open-ILS/web/js/ui/default/staff/services/hatch.js

index c7d6cf9..5fcf57f 100644 (file)
 
 [% INCLUDE 'staff/circ/checkin/t_checkin_table.tt2' %]
 
-<div class="flex-row pad-vert">
-  <div class="flex-cell"></div>
-  <div class="pad-horiz">
-    <button class="btn btn-default" 
-      ng-click="print_receipt()">[% l('Print Receipt') %]</button>
-  </div>
-  <div class="checkbox" ng-if="using_hatch">
-    <label>
-      <input ng-model="show_print_dialog" type="checkbox"/>
-      [% l('Show Print Dialog') %]
-    </label>
-  </div>
-  <div class="pad-horiz" ng-if="using_hatch"></div>
-  <div class="checkbox">
-    <label>
-      <input ng-model="trim_list" type="checkbox"/>
-      [% l('Trim List (20 Rows)') %]
-    </label>
-  </div>
-  <div class="pad-horiz"></div>
-  <div class="checkbox">
-    <label>
-      <input ng-model="strict_barcode" type="checkbox"/>
-      [% l('Strict Barcode') %]
-    </label>
-  </div>
-</div>
+<div class="row pad-vert">
+  <div class="col-md-10">
+    <div class="flex-row">
+      <div class="flex-cell"></div>
+      <div class="pad-horiz">
+        <button class="btn btn-default" 
+          ng-click="print_receipt()">[% l('Print Receipt') %]</button>
+      </div>
+      <div class="checkbox" ng-if="using_hatch">
+        <label>
+          <input ng-model="show_print_dialog" type="checkbox"/>
+          [% l('Show Print Dialog') %]
+        </label>
+      </div>
+      <div class="pad-horiz" ng-if="using_hatch"></div>
+      <div class="checkbox">
+        <label>
+          <input ng-model="trim_list" type="checkbox"/>
+          [% l('Trim List (20 Rows)') %]
+        </label>
+      </div>
+      <div class="pad-horiz"></div>
+      <div class="checkbox">
+        <label>
+          <input ng-model="strict_barcode" type="checkbox"/>
+          [% l('Strict Barcode') %]
+        </label>
+      </div>
+    </div><!-- flex row -->
+  </div><!-- col -->
+  <div class="col-md-2">
+    <div class="input-group-btn" dropdown>
+      <button type="button" class="btn btn-default dropdown-toggle">
+        [% l('Checkin Modifiers') %]
+        <span class="caret"></span>
+      </button>
+      <ul class="dropdown-menu pull-right">
+        <li>
+          <a href dropdown-toggle 
+            ng-click="modifiers.no_precat_alert=!modifiers.no_precat_alert">
+            <span ng-if="modifiers.no_precat_alert" 
+              class="label label-success">&#x2713;</span>
+            <span ng-if="!modifiers.no_precat_alert"
+              class="label label-warning">&#x2717;</span>
+            <span>[% l('Ignore Pre-cataloged Items') %]</span>
+          </a>
+        </li>
+      </ul>
+    </div><!-- btn grp -->
+  </div><!-- col -->
+</div><!-- row -->
 
 
 [% END %]
index 0c2205c..cacbf94 100644 (file)
@@ -30,9 +30,8 @@ function($scope , $q , egCore , checkinSvc , egGridDataProvider , egCirc)  {
     $scope.focusMe = true;
     $scope.checkins = checkinSvc.checkins;
     $scope.checkinArgs = {backdate : new Date()}
-
-    $scope.using_hatch = egCore.hatchAvailable || 
-        egCore.hatch.getLocalItem('eg.hatch.required');
+    $scope.using_hatch = egCore.hatch.usingHatch();
+    $scope.modifiers = {};
 
     var today = new Date();
 
@@ -67,9 +66,12 @@ function($scope , $q , egCore , checkinSvc , egGridDataProvider , egCirc)  {
                     delete params.backdate;
             }
 
-            var options = {check_barcode : $scope.strict_barcode};
+            var options = {
+                check_barcode : $scope.strict_barcode,
+                no_precat_alert : $scope.modifiers.no_precat_alert
+            };
 
-            egCirc.checkin(angular.copy(params, options))
+            egCirc.checkin(angular.copy(params), options)
             .then(function(final_resp) {
                 final_resp.evt.index = checkinSvc.checkins.length;
                 final_resp.evt.copy_barcode = params.copy_barcode;
index d4b7928..ffa4347 100644 (file)
@@ -32,8 +32,7 @@ function($scope , $q , $modal , $routeParams , egCore , egUser , patronSvc ,
         );
     }
 
-    $scope.using_hatch = egCore.hatchAvailable || 
-        egCore.hatch.getLocalItem('eg.hatch.required');
+    $scope.using_hatch = egCore.hatch.usingHatch();
 
     // avoid multiple, in-flight attempts on the same barcode
     var pending_barcodes = {};
index 1b370af..8606a7b 100644 (file)
@@ -518,6 +518,8 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
         // track the barcode regardless of whether it refers to a copy
         evt.copy_barcode = params.copy_barcode;
 
+        console.debug('checkin event ' + evt.textcode);
+
         switch (evt.textcode) {
             case 'SUCCESS':
             case 'NO_CHANGE':
@@ -548,6 +550,8 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
                     .result.then(function() {return final_resp});
 
             case 'ITEM_NOT_CATALOGED':
+                if (options.no_precat_alert) 
+                    return $q.when(final_resp);
                 return egAlertDialog.open(
                     egCore.strings.PRECAT_CHECKIN_MSG, params)
                     .result.then(function() {return final_resp});
index f679dc5..9e41d91 100644 (file)
@@ -120,7 +120,7 @@ angular.module('egCoreMod')
     // Returns true if Hatch is required or if we are currently
     // communicating with the Hatch service. 
     service.usingHatch = function() {
-        return egCore.hatchAvailable || service.hatchRequired();
+        return service.hatchAvailable || service.hatchRequired();
     }
 
     // Returns true if this browser (via localStorage) is