From adcf4e7684e9953a37a4c5c0b0828e7ae0fcfca1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 9 Jul 2012 14:45:15 -0400 Subject: [PATCH] Invoice link dialog supports multiple lineitems/POs Adds support to the invoice linking dialog for linking sets of lineitems or POs instead of just one. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/acq/common/inv_dialog.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/common/inv_dialog.js b/Open-ILS/web/js/ui/default/acq/common/inv_dialog.js index b76aa97027..7a5789e1dc 100644 --- a/Open-ILS/web/js/ui/default/acq/common/inv_dialog.js +++ b/Open-ILS/web/js/ui/default/acq/common/inv_dialog.js @@ -4,8 +4,14 @@ function InvoiceLinkDialogManager(which, target) { this.linkFoundInvoice = function(r) { self.inv = openils.Util.readResponse(r); - location.href = oilsBasePath + "/acq/invoice/view/" + self.inv.id() + - "?attach_" + self.which + "=" + self.target.id(); + var path = oilsBasePath + "/acq/invoice/view/" + self.inv.id(); + if (!dojo.isArray(self.target)) self.target = [self.target]; + dojo.forEach(self.target, function(target, idx) { + id = (typeof target != 'object') ? target : target.id(); + var join = (idx == 0) ? '?' : '&'; + path += join + "attach_" + self.which + "=" + id; + }); + location.href = path; }; this.which = which; -- 2.11.0