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