webstaff: Add a save-and-continue mode
authorMike Rylander <mrylander@gmail.com>
Fri, 4 Sep 2015 17:57:16 +0000 (13:57 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 14 Sep 2015 19:44:20 +0000 (15:44 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 4897231..d6805ad 100644 (file)
                <eg-grid
                  id-field="id"
                  idl-class="acp"
+                 menu-label="[% l('Save... ') %]"
                  features="-pagination,-actions,-index"
                  items-provider="completedGridDataProvider"
                  grid-controls="completedGridControls"
                  persist-key="cat.volcopy.copies.complete">
                
-                 <eg-grid-menu-item handler="completeToWorking"
+                 <eg-grid-menu-item standalone="true" handler="completeToWorking"
                   label="[% l('Edit Selected') %]"></eg-grid-menu-item>
         
+                 <eg-grid-menu-item handler="saveAndContinue"
+                  label="[% l('Save Completed') %]"></eg-grid-menu-item>
                  <eg-grid-menu-item handler="saveAndExit"
                   label="[% l('Save & Exit') %]"></eg-grid-menu-item>
         
index b0f5dc7..031581d 100644 (file)
@@ -1117,7 +1117,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         $scope.saveCompletedCopies = function (and_exit) {
             var cnHash = {};
             var perCnCopies = {};
-            angular.forEach( $scope.completed_copies, function (cp) {
+            angular.forEach( egCore.idl.Clone($scope.completed_copies), function (cp) {
                 var cn_id = cp.call_number().id();
                 if (!cnHash[cn_id]) {
                     cnHash[cn_id] = cp.call_number();
@@ -1149,6 +1149,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
             });
         }
 
+        $scope.saveAndContinue = function () {
+            $scope.saveCompletedCopies(false);
+        }
+
         $scope.saveAndExit = function () {
             $scope.saveCompletedCopies(true);
         }