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>
11 <table jsId="acs_grid"
12 dojoType="openils.widget.AutoGrid"
14 defaultCellWidth="'auto'"
15 fieldOrder="['name','description','id']"
16 suppressEditFields="['id']"
22 <th name="Other properties"
23 field="id" formatter="format_acs_id"></th>
29 <script type="text/javascript">
30 dojo.require("openils.widget.AutoGrid");
31 dojo.require("openils.CGI");
32 dojo.requireLocalization("openils.authority", "authority");
34 dojo.i18n.getLocalization("openils.authority", "authority");
38 function format_acs_id(id) {
40 var tlen = acs_cache[id].thesauri() ?
41 acs_cache[id].thesauri().length : 0;
42 var alen = acs_cache[id].authority_fields() ?
43 acs_cache[id].authority_fields().length : 0;
45 return "<a href='" + oilsBasePath +
46 "/conify/global/cat/authority/thesaurus?acs=" + id + "'>" +
47 dojo.string.substitute(localeStrings.THESAURI, [tlen]) +
48 "</a> " + " <a href='" + oilsBasePath +
49 "/conify/global/cat/authority/control_set_authority_field?acs=" +
51 dojo.string.substitute(localeStrings.AUTHORITY_FIELDS, [alen]) +
56 function acs_grid_loader() {
58 acs_grid.resetStore();
59 acs_grid.showLoadProgressIndicator();
60 fieldmapper.standardRequest(
61 ["open-ils.cat", "open-ils.cat.authority.control_set.retrieve"], {
63 "params": [acs_grid.displayLimit, acs_grid.displayOffset, cgi.param("focus")],
64 "onresponse": function(r) {
65 if (r = openils.Util.readResponse(r)) {
66 acs_cache[r.id()] = r;
67 acs_grid.store.newItem(r.toStoreItem());
70 "oncomplete": function() {
71 acs_grid.hideLoadProgressIndicator();
77 openils.Util.addOnLoad(
79 cgi = new openils.CGI();
81 acs_grid.onPostCreate = function(obj) {acs_cache[obj.id()] = obj;};
82 acs_grid.dataLoader = acs_grid_loader;