2 [% ctx.page_title = 'Vandelay Match Sets' %]
3 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
5 <div>[% ctx.page_title %]</div>
7 <button dojoType="dijit.form.Button"
8 onClick="vms_grid.showCreateDialog()">New Match Set</button>
9 <button dojoType="dijit.form.Button"
10 onClick="vms_grid.deleteSelected()">Delete Selected</button>
14 Show sets owned at or below:
15 <select dojoType="openils.widget.OrgUnitFilteringSelect"
16 jsId="context_org_selector"></select>
18 <table jsId="vms_grid"
19 dojoType="openils.widget.AutoGrid"
21 defaultCellWidth="'16em'"
23 fieldorder="['name', 'owner']"
24 suppressEditFields="['id']"
29 <th field="name" get="field_plus_id" formatter="tree_editor_link"></th>
30 <th field="owner" get="openils.widget.AutoGrid.orgUnitGetter">
37 <select dojoType="dijit.form.FilteringSelect" jsId="mtype_selector">
38 [%# for the origin of these hard coded options, see the definition
39 of vandelay.match_set.mtype in 012.schema.vandelay.sql %]
40 <option value="biblio">biblio</option>
41 <option value="authority">authority</option>
42 <!-- XXX: nah <option value="mfhd">mfhd</option> -->
46 <script type="text/javascript">
47 dojo.require("dijit.form.FilteringSelect");
48 dojo.require("openils.widget.AutoGrid");
49 dojo.require("openils.widget.OrgUnitFilteringSelect");
53 function load_grid(search) {
54 if (!search) search = {"id": {"!=": null}};
56 vms_grid.loadAll({"order_by": {"vms": "name"}}, search);
59 function field_plus_id(rowIndex, item) {
60 if (!item) return null;
62 datum[this.field] = this.grid.store.getValue(item, this.field);
63 datum.id = this.grid.store.getValue(item, "id");
67 function tree_editor_link(datum) {
68 if (!datum) return "";
69 return '<a href="[% ctx.base_path %]/eg/conify/global/vandelay/match_set_tree?match_set=' +
70 datum.id + '">' + datum.name + '</a>';
73 openils.Util.addOnLoad(
75 new openils.User().buildPermOrgSelector(
76 "ADMIN_IMPORT_MATCH_SET", context_org_selector,
78 context_org_selector.onChange = function() {
79 context_org = this.attr("value");
80 vms_grid.resetStore();
82 "owner": aou.descendantNodeList(context_org, true)
88 vms_grid.overrideEditWidgets.mtype = mtype_selector;
89 vms_grid.overrideEditWidgets.mtype.shove = {"create": "biblio"};