webstaff: serials code cleanup and removing an inf digest loop
authorMike Rylander <mrylander@gmail.com>
Mon, 15 May 2017 20:28:29 +0000 (16:28 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 30 May 2017 16:06:45 +0000 (12:06 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/serials/directives/item_manager.js
Open-ILS/web/js/ui/default/staff/serials/services/core.js

index 2ada6a4..bedc656 100644 (file)
@@ -15,45 +15,6 @@ function($scope , $q , egSerialsCoreSvc , egCore , $uibModal) {
 
     egSerialsCoreSvc.fetch($scope.bibId);
 
-    // convert to sitem funcs
-    $scope.createScap = function(pred) {
-        var scap = egCore.idl.fromTypedHash(pred);
-        egCore.pcrud.create(scap).then(function() {
-            // completely reset the model in order to reset the
-            // forms; causes a blink, alas
-            $scope.predictions = [];
-            $scope.new_prediction = null;
-            egSerialsCoreSvc.fetch($scope.bibId).then(function() {
-                reload($scope.ssubId);
-            });
-        });
-    }
-    $scope.updateScap = function(pred) {
-        var scap = egCore.idl.fromTypedHash(pred);
-        egCore.pcrud.update(scap).then(function() {
-            // completely reset the model in order to reset the
-            // forms; causes a blink, alas
-            $scope.predictions = [];
-            egSerialsCoreSvc.fetch($scope.bibId).then(function() {
-                reload($scope.ssubId);
-            });
-        });
-    }
-    $scope.deleteScap = function(pred) {
-        var scap = egCore.idl.fromTypedHash(pred);
-        // TODO ask to confirm
-        // TODO check whether there are linked issuances
-        egCore.pcrud.remove(scap).then(function() {
-            // completely reset the model in order to reset the
-            // forms; causes a blink, alas
-            $scope.predictions = [];
-            egSerialsCoreSvc.fetch($scope.bibId).then(function() {
-                reload($scope.ssubId);
-            });
-        });
-    }
-
-
 }]
     }
 })
index 62d7659..c935fcc 100644 (file)
@@ -283,7 +283,9 @@ function(egCore , orderByFilter , $q , $filter , $uibModal) {
                             date : $scope.pubdate,
                             prev_iss : options.prev_iss
                         });
-                        $scope.pubdate = $scope.args.date;
+                        if ($scope.args.date)
+                            $scope.pubdate = $scope.args.date;
+                        delete options.prev_iss; // only use this once
                     }
                 }