From 6da6bd75375dfa53b63f26704f2dcef597c46a46 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Thu, 4 Apr 2013 16:43:38 -0400 Subject: [PATCH] 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 --- Open-ILS/web/js/ui/default/serial/subscription.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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({ -- 2.11.0