From: Dan Wells Date: Thu, 4 Apr 2013 20:43:38 +0000 (-0400) Subject: Add summary creation to embedded alt dist editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=38411f209cb0b658f08d9040f2f04fdb3e1bc3b4;p=evergreen%2Fequinox.git Add summary creation to embedded alt dist editor In the Serial Control View, summaries are created automatically with a new distribution. To avoid unhappy surprises, the embedded version of the alt distribution editor should do the same. Signed-off-by: Dan Wells Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/web/js/ui/default/serial/subscription.js b/Open-ILS/web/js/ui/default/serial/subscription.js index 6f1291fc49..bedb5878b8 100644 --- a/Open-ILS/web/js/ui/default/serial/subscription.js +++ b/Open-ILS/web/js/ui/default/serial/subscription.js @@ -303,6 +303,24 @@ openils.Util.addOnLoad( "name" : "record_entry" }); dist_grid.overrideEditWidgets.record_entry.shove = {}; + dist_grid.onPostCreate = function() { this.refresh(); }; + dist_grid.createPaneOnSubmit = function(fmObject, opts, pane) { + fmObject.isnew(1); + fieldmapper.standardRequest( + ['open-ils.serial', 'open-ils.serial.distribution.fleshed.batch.update'], + { + "async":false, + "params":[openils.User.authtoken, [fmObject]], + "oncomplete": function(r) { + // TODO: adjust create method to send back fmObject, + // then pass through to avoid need for onPostCreate + // refresh + // TODO: check for and handle possible errors + pane.onPostSubmit(null, []); + } + } + ); + }; if (sub_id == 'new') { ssub_grid.overrideEditWidgets.record_entry = new dijit.form.TextBox({