From: Galen Charlton <gmc@esilibrary.com>
Date: Thu, 21 Jan 2016 22:15:53 +0000 (-0500)
Subject: webstaff: add copy editor support for floating field
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d6e8b7b7ac4659f80a74e7d21d97e7b506a0f914;p=evergreen%2Fmasslnc.git

webstaff: add copy editor support for floating field

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
---

diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
index 553cb252a8..9753d5370c 100644
--- a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
+++ b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
@@ -370,6 +370,23 @@
                     </button>
                 </div>
             </div>
+
+            <div class="row pad-vert"></div>
+
+            <div class="row bg-info">
+                <div class="col-md-6">
+                    <b>[% l('Floating') %]</b>
+                </div>
+            </div>
+
+            <div class="row">
+                <div class="col-md-6" ng-class="{'bg-success': working.floating !== undefined}">
+                    <select class="form-control"
+                        ng-disabled="!defaults.attributes.floating" ng-model="working.floating"
+                        ng-options="a.id() as a.name() for a in floating_list"
+                    ></select>
+                </div>
+            </div>
         </div>
 
         <div class="col-md-4">
diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
index d2c6f98b86..dc67634dca 100644
--- a/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
+++ b/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
@@ -295,6 +295,14 @@
                 </div>
             </div>
 
+            <div class="row">
+                <div class="col-xs-6">
+                    <label>
+                        <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.attributes.floating"/>
+                        [% l('Floating') %]
+                    </label>
+                </div>
+            </div>
         </div>
 
         <div class="col-md-4">
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index dfe8df3ed5..5dbccfa0e4 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -190,6 +190,19 @@ function(egCore , $q) {
 
     };
 
+    service.get_floating_groups = function() {
+        if (egCore.env.cfg)
+            return $q.when(egCore.env.cfg.list);
+
+        return egCore.pcrud.retrieveAll('cfg', {}, {atomic : true}).then(
+            function(list) {
+                egCore.env.absorbList(list, 'cfg');
+                return list;
+            }
+        );
+
+    };
+
     service.bmp_parts = {};
     service.get_parts = function(rec) {
         if (service.bmp_parts[rec])
@@ -702,7 +715,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
             circ_as_type : true,
             location : true,
             holdable : true,
-            age_protect : true
+            age_protect : true,
+            floating : true
         }
     };
 
@@ -1353,6 +1367,12 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         });
         createSimpleUpdateWatcher('age_protect');
 
+        $scope.floating_list = [];
+        itemSvc.get_floating_groups().then(function(list){
+            $scope.floating_list = list;
+        });
+        createSimpleUpdateWatcher('floating');
+
         createSimpleUpdateWatcher('circ_lib');
         createSimpleUpdateWatcher('circulate');
         createSimpleUpdateWatcher('holdable');
@@ -1515,7 +1535,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         circ_as_type : true,
                         location : true,
                         holdable : true,
-                        age_protect : true
+                        age_protect : true,
+                        floating : true
                     }
                 };