2 [% ctx.page_title = l("Configure Authority Control Sets") %]
3 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
5 <div>[% l('Control Sets') %]</div>
7 <button dojoType="dijit.form.Button" onClick="acs_grid.showCreateDialog()">[% l('New Control Set') %]</button>
8 <button dojoType="dijit.form.Button" onClick="acs_grid.deleteSelected()">[% l('Delete Selected') %]</button>
12 <table jsId="acs_grid"
13 dojoType="openils.widget.AutoGrid"
15 defaultCellWidth="'auto'"
16 fieldOrder="['name','description','id']"
17 suppressEditFields="['id']"
23 <th name="Other properties"
24 field="id" formatter="format_acs_id"></th>
30 <script type="text/javascript">
31 dojo.require("openils.widget.AutoGrid");
32 dojo.require("openils.CGI");
33 dojo.requireLocalization("openils.authority", "authority");
35 dojo.i18n.getLocalization("openils.authority", "authority");
39 function format_acs_id(id) {
41 var tlen = acs_cache[id].thesauri() ?
42 acs_cache[id].thesauri().length : 0;
43 var alen = acs_cache[id].authority_fields() ?
44 acs_cache[id].authority_fields().length : 0;
46 return "<a href='" + oilsBasePath +
47 "/conify/global/cat/authority/thesaurus?acs=" + id + "'>" +
48 dojo.string.substitute(localeStrings.THESAURI, [tlen]) +
49 "</a> " + " <a href='" + oilsBasePath +
50 "/conify/global/cat/authority/control_set_authority_field?acs=" +
52 dojo.string.substitute(localeStrings.AUTHORITY_FIELDS, [alen]) +
57 function acs_grid_loader() {
59 acs_grid.resetStore();
60 acs_grid.showLoadProgressIndicator();
61 fieldmapper.standardRequest(
62 ["open-ils.cat", "open-ils.cat.authority.control_set.retrieve"], {
64 "params": [acs_grid.displayLimit, acs_grid.displayOffset, cgi.param("focus")],
65 "onresponse": function(r) {
66 if (r = openils.Util.readResponse(r)) {
67 acs_cache[r.id()] = r;
68 acs_grid.store.newItem(r.toStoreItem());
71 "oncomplete": function() {
72 acs_grid.hideLoadProgressIndicator();
78 openils.Util.addOnLoad(
80 cgi = new openils.CGI();
82 acs_grid.onPostCreate = function(obj) {acs_cache[obj.id()] = obj;};
83 acs_grid.dataLoader = acs_grid_loader;