if (!dojo.isArray(disabled_fields)) disabled_fields = [];
+ // Widgets already created. No need to rebuild.
+ if (this.batchUpdateWidgets) return;
+
/* Note that this will directly contain dijits, not the AutoWidget
* wrapper object. */
if (!this.batchUpdateWidgets) {
*/
};
+ /* Re-fetches lineitem notes and updates
+ * note count for selected lineitems */
+ this.refreshLiNotes = function(li_ids) {
+ var self = this;
+ if (!li_ids) li_ids = Object.keys(this.liCache);
+ dojo.forEach(li_ids, function(li_id) {
+ fieldmapper.standardRequest(
+ ['open-ils.acq',
+ 'open-ils.acq.lineitem.retrieve.authoritative'],
+ { async: true,
+ params: [self.authtoken, li_id,
+ {clear_marc : true, flesh_notes : true}],
+ oncomplete: function(r) {
+ var li = openils.Util.readResponse(r);
+ // update the notes array on cached
+ // lineitem for consistency.
+ self.liCache[li_id].lineitem_notes(li.lineitem_notes());
+ self.updateLiNotesCount(li);
+ }
+ }
+ );
+ });
+ }
+
this.updateLiNotesCount = function(li, row) {
if (!row) row = this._findLiRow(li);
*/
this.drawLiNotes = function(li) {
var self = this;
+
+ // get the LI from the cache, since it may have been
+ // modified since this closure was first created.
+ // See refreshLiNotes();
+ li = self.liCache[li.id()];
+
this.focusLineitem = li.id();
if (!acqLitAlertAlertText._store_ready)
}
}
}
+ },
+ "oncomplete" : function() {
+ self.refreshLiNotes(id_list);
}
}
);
this.printPO = function() {
if(!this.isPO) return;
+ var self = this;
progressDialog.show(true);
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.purchase_order.format'],
if(evt && evt.template_output()) {
openils.Util.printHtmlString(evt.template_output().data());
}
+ self.refreshLiNotes();
}
}
);
var resp = openils.Util.readResponse(r);
self._updateProgressNumbers(resp, true);
},
+ oncomplete : function() {
+ self.refreshLiNotes(
+ li_list.map(function(li) { return li.id(); }))
+ }
}
);
};
);
progressDialog.hide();
}
+ },
+ oncomplete : function() {
+ if (part == 'lineitem' && !rollback)
+ self.refreshLiNotes([obj.id()]);
}
}
);