1 dojo.require("openils.widget.EditDialog");
2 dojo.require("openils.widget.EditPane");
6 function toPoListing() {
7 location.href = oilsBasePath + "/acq/search/unified?ca=po";
10 function toOnePo(id) {
11 location.href = oilsBasePath + "/acq/po/view/" + id;
14 openils.Util.addOnLoad(
16 editDialog = new openils.widget.EditDialog({
17 "editPane": new openils.widget.EditPane({
18 "fmObject": new acqpo(),
19 /* After realizing how many fields should be excluded from this
20 * interface because users shouldn't set them arbitrarily,
21 * it hardly seems like using these Edit widgets gives much
22 * much advantage over a hardcoded interface. */
24 "create_time", "edit_time", "editor", "order_date",
25 "owner", "cancel_reason", "creator", "state", "name"
27 "fieldOrder": ["ordering_agency", "provider"],
29 "onSubmit": function(po) {
30 fieldmapper.standardRequest(
31 ["open-ils.acq", "open-ils.acq.purchase_order.create"],{
33 "params": [openils.User.authtoken, po],
34 "onresponse": function(r) {
36 openils.Util.readResponse(r).
43 "onCancel": function() {
46 /* I'd rather do window.close() or xulG.close_tab(),
47 * but neither of those seem to work here. */