From 49f3a957b44bede4532fcec355a8940c0b48d570 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 8 Jun 2017 15:54:01 -0400 Subject: [PATCH] offline: Use the workstation org unit as the default home library; copy barcode to user name Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/offline.js | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/offline.js b/Open-ILS/web/js/ui/default/staff/offline.js index bb4b201e11..1c08568140 100644 --- a/Open-ILS/web/js/ui/default/staff/offline.js +++ b/Open-ILS/web/js/ui/default/staff/offline.js @@ -240,6 +240,7 @@ function($routeProvider , $locationProvider , $compileProvider) { $scope.bad_barcode = null; $scope.focusMe = true; $scope.shared = { due_date : null, due_date_offset : '' }; + $scope.workstation_obj = null; $scope.workstation = ''; $scope.workstation_owner = ''; $scope.workstations = []; @@ -299,6 +300,7 @@ function($routeProvider , $locationProvider , $compileProvider) { return ws == w.name })[0]; + $scope.workstation_obj = ws_obj; $scope.workstation = ws_obj.id; $scope.workstation_owner = ws_obj.owning_lib; @@ -1288,7 +1290,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , patronSvc , patronRegSvc , egUnloadPrompt, egAlertDialog , egWorkLog , $timeout , egLovefield) { - patronRegSvc.org = $scope.workstation.owning_lib; + patronRegSvc.org = $scope.workstation_obj.owning_lib; $scope.offline = true; $scope.page_data_loaded = false; @@ -1404,8 +1406,6 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , prs.set_field_patterns(field_patterns); apply_username_regex(); }); - - // update the currently displayed field documentation $scope.set_selected_field_doc = function(cls, field) { @@ -1607,23 +1607,9 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , } $scope.barcode_changed = function(bc) { - if ($scope.offline) return; if (!bc) return; - $scope.dupe_barcode = false; - egCore.net.request( - 'open-ils.actor', - 'open-ils.actor.barcode.exists', - egCore.auth.token(), bc - ).then(function(resp) { - if (resp == '1') { // duplicate card - $scope.dupe_barcode = true; - console.log('duplicate barcode detected: ' + bc); - } else { - if (!$scope.patron.usrname) - $scope.patron.usrname = bc; - // No dupe -- A-OK - } - }); + if (!$scope.patron.usrname) + $scope.patron.usrname = bc; } $scope.cards_dialog = function() { @@ -1877,6 +1863,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , case 'barcode': apply_username_regex(); + $scope.barcode_changed(value); break; case 'dob': -- 2.11.0