1 function InvoiceLinkDialogManager(which, target) {
5 this.linkFoundInvoice = function(r) {
6 self.inv = openils.Util.readResponse(r);
7 var path = oilsBasePath + "/acq/invoice/view/" + self.inv.id();
8 if (!dojo.isArray(self.target)) self.target = [self.target];
9 dojo.forEach(self.target, function(target, idx) {
10 id = (typeof target != 'object') ? target : target.id();
11 var join = (idx == 0) ? '?' : '&';
12 path += join + "attach_" + self.which + "=" + id;
14 if (openils.XUL.isXUL()) {
15 openils.XUL.newTabEasy(
17 /* tab title */ dojo.string.substitute(
18 localeStrings.INVOICE_NUMBER, [self.inv.inv_ident()]
21 true /* <browser> wrapper */
32 new openils.widget.AutoFieldWidget({
33 "fmField": "provider",
35 "parentNode": dojo.byId("acq-" + this.which + "-link-invoice-provider"),
36 "orgLimitPerms": ["VIEW_INVOICE"],
40 dijit.byId("acq-" + this.which + "-link-invoice-link").onClick =
45 "provider": dijit.byId(
46 "acq-" + self.which + "-link-invoice-provider"
50 "acq-" + self.which + "-link-invoice-inv_ident"
55 "onresponse": self.linkFoundInvoice,
56 "oncomplete": function() {
58 alert(localeStrings.NO_FIND_INVOICE);