set default value of 'Renewing?' to false when creating alert type
authorGalen Charlton <gmc@esilibrary.com>
Thu, 25 Aug 2016 20:12:28 +0000 (16:12 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 31 Aug 2017 17:23:16 +0000 (13:23 -0400)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/admin/local/app.js

index bf1eb22..4462ce8 100644 (file)
@@ -58,6 +58,7 @@ angular.module('egLocalAdmin',
         createEditPrefetch: {
             ccs : { id : {'!=' : null} }
         },
+        createDefaults : { 'in_renew' : 'f' },
         createEditOrgExpand: ['scope_org'],
         createEditNullableBool : ['in_renew', 'at_circ', 'at_owning']
     });
@@ -136,6 +137,7 @@ function($scope , $route , $location , egCore , $timeout , egConfirmDialog , $ui
     $scope.createEditPrefetch = $route.current.$$route.createEditPrefetch || {};
     $scope.createEditOrgExpand = $route.current.$$route.createEditOrgExpand || [];
     $scope.createEditNullableBool = $route.current.$$route.createEditNullableBool || [];
+    $scope.createDefaults = $route.current.$$route.createDefaults || [];
     $scope.gridControls = {
         setQuery : function(q) {
             if (q) query = q;
@@ -163,7 +165,7 @@ function($scope , $route , $location , egCore , $timeout , egConfirmDialog , $ui
                     });
                 });
                 if ($scope.creating) {
-                    $scope.record = {};
+                    $scope.record = $scope.createDefaults;
                 } else {
                     egCore.pcrud.retrieve($scope.baseFmClass, id).then(function(to_edit) {
                         $scope.record = egCore.idl.toHash(to_edit);