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 overrideWidgetArgs : {
30 provider : { dijitArgs : { store_options : { base_filter : { active :"t" } } } }
32 "onSubmit": function(po) {
33 fieldmapper.standardRequest(
34 ["open-ils.acq", "open-ils.acq.purchase_order.create"],{
36 "params": [openils.User.authtoken, po],
37 "onresponse": function(r) {
39 openils.Util.readResponse(r).
46 "onCancel": function() {
49 /* I'd rather do window.close() or xulG.close_tab(),
50 * but neither of those seem to work here. */