offline: keep working location and workstation in sync
authorMike Rylander <mrylander@gmail.com>
Tue, 13 Jun 2017 19:10:37 +0000 (15:10 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 13 Jun 2017 19:10:37 +0000 (15:10 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/offline.js

index 02642c1..6797d7e 100644 (file)
@@ -280,12 +280,23 @@ function($routeProvider , $locationProvider , $compileProvider) {
         $scope.in_house_use = {count : 1};
         $scope.checkin = { backdate : new Date() };
 
+        $scope.current_workstation_owning_lib = function () {
+            return $scope.workstations.filter(function(w) {
+                return $scope.workstation == w.id
+            })[0].owning_lib;
+        }
+
         $scope.current_workstation_name = function () {
             return $scope.workstations.filter(function(w) {
                 return $scope.workstation == w.id
             })[0].name;
         }
 
+        $scope.$watch('workstation', function (n,o) {
+            if (egCore.env.aou)
+                $scope.org = egCore.org.get($scope.current_workstation_owning_lib());
+        });
+
         $scope.changeCheck = function () {
             $scope.strict_barcode = !$scope.strict_barcode;
             $scope.do_check_changed = true;