2 [% ctx.page_title = "Configure Authority Thesauri" %]
3 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
7 <button dojoType="dijit.form.Button" onClick="at_grid.showCreateDialog()">New Thesaurus</button>
8 <button dojoType="dijit.form.Button" onClick="at_grid.deleteSelected()">Delete Selected</button>
11 <div id="control-set-metadata-holder" class="hidden">
12 Showing only thesauri linked to control set:
13 <a id="control-set-metadata"></a>
17 dojoType="openils.widget.AutoGrid"
19 defaultCellWidth="'auto'"
20 fieldOrder="['code','control_set','name','description']"
21 suppressEditFields="['id']"
27 <th field="control_set" get="get_control_set"
28 formatter="format_control_set"></th>
34 <script type="text/javascript"
35 src="[% ctx.media_prefix %]/js/ui/default/conify/global/cat/authority/common.js"></script>
36 <script type="text/javascript">
37 dojo.require("openils.widget.AutoGrid");
38 dojo.require("openils.CGI");
39 dojo.require("openils.PermaCrud");
41 dojo.requireLocalization("openils.authority", "authority");
43 dojo.i18n.getLocalization("openils.authority", "authority");
48 function get_control_set(rowidx, item) {
50 /* I'm /sure/ there's a better way to do the following */
51 this._tmp = openils.widget.AutoGrid.defaultGetter;
52 var ordinary = this._tmp(rowidx, item);
58 var id = this.grid.store.getValue(item, "control_set");
60 "id": id, "text": ordinary
66 function format_control_set(f) {
67 if (typeof f == "object") {
68 return '<a href="' + oilsBasePath +
69 '/conify/global/cat/authority/control_set?focus=' + f.id +
70 '">' + f.text + "</a>";
78 var where = {"code": {"!=": null}};
80 cgi = new openils.CGI();
81 pcrud = new openils.PermaCrud();
83 control_set = cgi.param("acs");
85 control_set = pcrud.retrieve("acs", control_set);
86 where.control_set = control_set.id();
87 render_control_set_metadata(control_set);
89 at_grid.overrideEditWidgets.control_set =
90 new dijit.form.TextBox({"disabled": true});
91 at_grid.overrideEditWidgets.control_set.shove =
92 {"create": control_set.id()};
95 at_grid.loadAll({"order_by": {"at": "code"}}, where);
98 openils.Util.addOnLoad(my_init);