$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 = [];
return ws == w.name
})[0];
+ $scope.workstation_obj = ws_obj;
$scope.workstation = ws_obj.id;
$scope.workstation_owner = ws_obj.owning_lib;
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;
prs.set_field_patterns(field_patterns);
apply_username_regex();
});
-
-
// update the currently displayed field documentation
$scope.set_selected_field_doc = function(cls, field) {
}
$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() {
case 'barcode':
apply_username_regex();
+ $scope.barcode_changed(value);
break;
case 'dob':