]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/default/conify/global/config/hard_due_date.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac...
[working/Evergreen.git] / Open-ILS / src / templates / default / conify / global / config / hard_due_date.tt2
1 [% WRAPPER default/base.tt2 %]
2 [% ctx.page_title = "Hard Due Dates" %]
3 <script type="text/javascript">
4     dojo.require("openils.CGI");
5     dojo.require("openils.Util");
6     dojo.require("openils.widget.AutoGrid");
7
8     function get_chdd_name(rowIndex, item) {
9         if (!item) return null;
10         else return {
11             "id": this.grid.store.getValue(item, "id"),
12             "name": this.grid.store.getValue(item, "name")
13         };
14     }
15
16     function format_chdd_name(blob) {
17         if (blob) {
18             return "<a href='" + oilsBasePath +
19                 "/conify/global/config/hard_due_date_values?chdd=" +
20                 blob.id + "'>" + blob.name + "</a>";
21         } else {
22             return "";
23         }
24     }
25
26     openils.Util.addOnLoad(
27         function() {
28             var cgi = new openils.CGI();
29             var filter = null;
30             var id = cgi.param("id");
31             var name = cgi.param("name");
32             if (id) {
33                 filter = {"id": id};
34                 openils.Util.show("one_only");
35             } else if (name) {
36                 filter = {"name": name};
37                 openils.Util.show("one_only");
38             }
39             chddGrid.loadAll({"order_by": {"chdd": "name"}}, filter);
40         }
41     );
42 </script>
43 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
44     <div dojoType="dijit.layout.ContentPane"
45         layoutAlign="top" class="oils-header-panel">
46         <div>Hard Due Dates</div>
47         <div>
48             <button
49                 dojoType="dijit.form.Button"
50                 onClick="chddGrid.showCreateDialog();">New Hard Due Date</button>
51             <button
52                 dojoType="dijit.form.Button"
53                 onClick="chddGrid.deleteSelected();">Deleted Selected</button>
54         </div>
55     </div>
56     <div id="one_only" class="hidden">
57         <em>Showing only one hard due date.</em> [
58             <a href="./hard_due_date">Show them all</a>
59         ]
60     </div>
61     <div>
62         <table jsId="chddGrid"
63             dojoType="openils.widget.AutoGrid"
64             showPaginator="true"
65             query="{name: '*'}"
66             defaultCellWidth="'auto'"
67             fieldOrder="['name', 'owner', 'ceiling_date', 'forceto']"
68             fmClass="chdd"
69             hideSelector="false"
70             editOnEnter="true">
71             <thead>
72                 <tr>
73                     <th field="name" get="get_chdd_name"
74                         formatter="format_chdd_name"></th>
75                 </tr>
76             </thead>
77         </table>
78     </div>
79 </div>
80 [% END %]