LP#1702557-Make Acq MarcEditor Just Have Save Button
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Fri, 19 Jan 2018 19:43:38 +0000 (14:43 -0500)
committerKathy Lussier <klussier@masslnc.org>
Thu, 22 Mar 2018 17:41:43 +0000 (13:41 -0400)
Like the changes to the z3950 marceditor UI, and serials,
make the Acq marceditor have a simple Save button, instead
of the Modify + Save Edits buttons needed to save a change.
Same change as in 1710405, et al. Note this also fixes a
propagation issue that prevented changes from marceditor's
scope.marcXml from making it to the modal controller scope,
and being saved. Props to miker for helping me debug this!

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2
Open-ILS/web/js/ui/default/staff/acq/app.js
Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js

index 1deeb5b..7fb287e 100644 (file)
@@ -6,11 +6,9 @@
   </div>
   <div class="modal-body">
     <eg-marc-edit-record dirty-flag="dirty_flag" marc-xml="args.marc_xml"
-                         in-place-mode="true" record-type="bre" save-label="[% l('Modify') %]" />
+                         on-save="ok" in-place-mode="true" record-type="bre" save-label="[% l('Save') %]" />
   </div>
   <div class="modal-footer">
-    <input type="submit" ng-click="ok(args)"
-        class="btn btn-primary" value="[% l('Use Edits') %]"/>
     <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
   </div>
 </div>
index e97ea29..4be5753 100644 (file)
@@ -80,7 +80,7 @@ function($scope , $routeParams , $location , $window , $timeout , egCore , $uibM
                 $scope.focusMe = true;
                 $scope.args = args;
                 $scope.dirty_flag = false;
-                $scope.ok = function(args) { $uibModalInstance.close(args) }
+                $scope.ok = function() { $uibModalInstance.close($scope.args) }
                 $scope.cancel = function () { $uibModalInstance.dismiss() }
             }]
         }).result.then(function (args) {
index 24a08c1..c4708ea 100644 (file)
@@ -1368,7 +1368,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                 $scope.saveRecord = function () {
                     if ($scope.inPlaceMode) {
                         $scope.marcXml = $scope.record.toXmlString();
-                        return processOnSaveCallbacks();
+                        return $timeout(processOnSaveCallbacks);
                     }
                     $scope.mangle_005();
                     $scope.Record().editor(egCore.auth.user().id());