]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/cat/authority/control_set.tt2
Merge remote branch 'working/user/dbs/lp801624_blow_away_postgresql'
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / cat / authority / control_set.tt2
1 [% WRAPPER default/base.tt2 %]
2 [% ctx.page_title = "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>Control Sets</div>
6         <div>
7             <button dojoType="dijit.form.Button" onClick="acs_grid.showCreateDialog()">New Control Set</button>
8             <button dojoType="dijit.form.Button" onClick="acs_grid.deleteSelected()">Delete Selected</button>
9         </div>
10     </div>
11     <div>
12     <table  jsId="acs_grid"
13             dojoType="openils.widget.AutoGrid"
14             autoHeight="true"
15             defaultCellWidth="'auto'"
16             fieldOrder="['name','description','id']"
17             suppressEditFields="['id']"
18             query="{id: '*'}"
19             fmClass="acs"
20             editOnEnter="true">
21             <thead>
22                 <tr>
23                     <th name="Other properties"
24                         field="id" formatter="format_acs_id"></th>
25                 </tr>
26             </thead>
27     </table>
28 </div>
29
30 <script type="text/javascript">
31     dojo.require("openils.widget.AutoGrid");
32     dojo.require("openils.CGI");
33     dojo.requireLocalization("openils.authority", "authority");
34     var localeStrings =
35         dojo.i18n.getLocalization("openils.authority", "authority");
36     var acs_cache = {};
37     var cgi;
38
39     function format_acs_id(id) {
40         if (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;
45
46             return "<a href='" + oilsBasePath +
47                 "/conify/global/cat/authority/thesaurus?acs=" + id + "'>" +
48                 dojo.string.substitute(localeStrings.THESAURI, [tlen]) +
49                 "</a> &nbsp;" + " <a href='" + oilsBasePath +
50                 "/conify/global/cat/authority/control_set_authority_field?acs=" +
51                 id + "'>" +
52                 dojo.string.substitute(localeStrings.AUTHORITY_FIELDS, [alen]) +
53                 "</a>";
54         }
55     }
56
57     function acs_grid_loader() {
58         acs_cache = {};
59         acs_grid.resetStore();
60         acs_grid.showLoadProgressIndicator();
61         fieldmapper.standardRequest(
62             ["open-ils.cat", "open-ils.cat.authority.control_set.retrieve"], {
63                 "async": true,
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());
69                     }
70                 },
71                 "oncomplete": function() {
72                     acs_grid.hideLoadProgressIndicator();
73                 }
74             }
75         );
76     }
77
78     openils.Util.addOnLoad(
79         function() {
80             cgi = new openils.CGI();
81
82             acs_grid.onPostCreate = function(obj) {acs_cache[obj.id()] = obj;};
83             acs_grid.dataLoader = acs_grid_loader;
84             acs_grid_loader();
85         }
86     );
87 </script>
88 [% END %]