From: Lebbeous Fogle-Weekley Date: Tue, 5 Mar 2013 21:47:41 +0000 (-0500) Subject: acq - break off Add to Purchase Order dialog into separate thing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3bdbd24c15f7dfba148727ba167836296281f09e;p=evergreen%2Fequinox.git acq - break off Add to Purchase Order dialog into separate thing will need to fuss with it more, i'm sure Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/templates/acq/common/add_to_po.tt2 b/Open-ILS/src/templates/acq/common/add_to_po.tt2 new file mode 100644 index 0000000000..6d167bb17f --- /dev/null +++ b/Open-ILS/src/templates/acq/common/add_to_po.tt2 @@ -0,0 +1,56 @@ +[%# We require add_to_po.js to be included, but can't do it ourselves. %] +
+ + + + + + + + + + +
+ [% l('Save') %] +
+
diff --git a/Open-ILS/src/templates/acq/lineitem/related.tt2 b/Open-ILS/src/templates/acq/lineitem/related.tt2 index fe2f527414..337a64f752 100644 --- a/Open-ILS/src/templates/acq/lineitem/related.tt2 +++ b/Open-ILS/src/templates/acq/lineitem/related.tt2 @@ -49,23 +49,12 @@ [% INCLUDE "acq/common/info.tt2" which = "Related" %] [% INCLUDE "acq/common/li_table.tt2" %] + [% END %] diff --git a/Open-ILS/web/js/ui/default/acq/lineitem/related.js b/Open-ILS/web/js/ui/default/acq/lineitem/related.js index eb04bc48f0..ba6dbdce8b 100644 --- a/Open-ILS/web/js/ui/default/acq/lineitem/related.js +++ b/Open-ILS/web/js/ui/default/acq/lineitem/related.js @@ -148,44 +148,6 @@ function load() { prepareButtons(); fetchRelated(); - dojo.connect(addToPoSave, 'onClick', addToPo) - openils.Util.registerEnterHandler(addToPoInput.domNode, addToPo); -} - -var _addToPoHappened = false; -function addToPo(args) { - var poId = addToPoInput.attr('value'); - if (!poId) return false; - if (_addToPoHappened) return false; - - var liId = liTable.getSelected()[0].id(); - console.log("adding li " + liId + " to PO " + poId); - - // hmm, addToPo is invoked twice for some reason... - _addToPoHappened = true; - - fieldmapper.standardRequest( - ['open-ils.acq', 'open-ils.acq.purchase_order.add_lineitem'], - { async : true, - params : [openils.User.authtoken, poId, liId], - oncomplete : function(r) { - var resp = openils.Util.readResponse(r); - if (resp.success) { - location.href = oilsBasePath + '/acq/po/view/' + poId; - } else { - _addToPoHappened = false; - if (resp.error == 'bad-po-state') { - alert(localeStrings.ADD_LI_TO_PO_BAD_PO_STATE); - } else if (resp.error == 'bad-li-state') { - alert(localeStrings.ADD_LI_TO_PO_BAD_LI_STATE); - } - } - } - } - ); - - addToPoDialog.hide(); - return false; // prevent form submission } openils.Util.addOnLoad(load);