]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/conify/global/config/hard_due_date_values.tt2
b1ba77cbfb6a6196a4ffd6a231bb5b0d640e1296
[working/Evergreen.git] / Open-ILS / src / templates / conify / global / config / hard_due_date_values.tt2
1 [% WRAPPER base.tt2 %]
2 [% ctx.page_title = l("Hard Due Date Values") %]
3 <script type="text/javascript">
4     dojo.require("openils.CGI");
5     dojo.require("openils.PermaCrud");
6     dojo.require("openils.Util");
7     dojo.require("openils.widget.AutoGrid");
8     dojo.require("dijit.form.TextBox");
9
10     openils.Util.addOnLoad(
11         function() {
12             var filter = null;
13             var chdd_id = (new openils.CGI()).param("chdd");
14
15             if (chdd_id) {
16                 filter = {"hard_due_date": chdd_id};
17                 var hard_due_date =
18                     (new openils.PermaCrud()).retrieve("chdd", chdd_id);
19
20                 dojo.byId("linked_chdd_name").innerHTML = hard_due_date.name();
21                 dojo.byId("linked_chdd_link").innerHTML = hard_due_date.id();
22                 dojo.byId("linked_chdd_link").onclick = function() {
23                     location.href = oilsBasePath +
24                         "/conify/global/config/hard_due_date?id=" +
25                         hard_due_date.id();
26                 };
27                 openils.Util.show("linked_chdd");
28             }
29
30             chddvGrid.overrideEditWidgets.hard_due_date =
31                 new dijit.form.TextBox({"disabled": true});
32             chddvGrid.overrideEditWidgets.hard_due_date.shove = {
33                 "create": chdd_id
34             };
35
36             chddvGrid.loadAll({"order_by": {"chddv": "active_date"}}, filter);
37         }
38     );
39 </script>
40 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
41     <div dojoType="dijit.layout.ContentPane"
42         layoutAlign="top" class="oils-header-panel">
43         <div>[% l('Hard Due Date Values') %]</div>
44         <div>
45             <button
46                 dojoType="dijit.form.Button"
47                 onClick="chddvGrid.showCreateDialog();">[% l('New Hard Due Date Value') %]</button>
48             <button
49                 dojoType="dijit.form.Button"
50                 onClick="chddvGrid.deleteSelected();">[% l('Deleted Selected') %]</button>
51         </div>
52     </div>
53     <div class="hidden" id="linked_chdd">
54         <em>[% l('Showing only hard due date values related to hard due date object') %]</em>
55         <strong id="linked_chdd_name"></strong> (#
56         <a href="javascript:void(0);" id="linked_chdd_link"></a>)
57     </div>
58     <div>
59         <table jsId="chddvGrid"
60             dojoType="openils.widget.AutoGrid"
61             showPaginator="true"
62             query="{name: '*'}"
63             defaultCellWidth="'auto'"
64             fieldOrder="['hard_due_date', 'ceiling_date', 'active_date']"
65             suppressFields="['hard_due_date']"
66             suppressEditFields="['id']"
67             fmClass="chddv"
68             hideSelector="true"
69             editOnEnter="true">
70         </table>
71     </div>
72 </div>
73 [% END %]