2 [% ctx.page_title = l("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 dojo.require("dojo.date.locale");
8 dojo.require("dojo.date.stamp");
11 function get_chdd_name(rowIndex, item) {
12 if (!item) return null;
14 "id": this.grid.store.getValue(item, "id"),
15 "name": this.grid.store.getValue(item, "name")
19 function format_chdd_name(blob) {
21 return "<a href='" + oilsBasePath +
22 "/conify/global/config/hard_due_date_values?chdd=" +
23 blob.id + "'>" + blob.name + "</a>";
29 openils.Util.addOnLoad(
31 var cgi = new openils.CGI();
33 var id = cgi.param("id");
34 var name = cgi.param("name");
37 openils.Util.show("one_only");
39 filter = {"name": name};
40 openils.Util.show("one_only");
42 chddGrid.loadAll({"order_by": {"chdd": "name"}}, filter);
44 function munge_ceiling(chdd) {
45 var cd = dojo.date.stamp.fromISOString(chdd.ceiling_date());
46 // set to end of day in client time zone; if we were using
47 // moment, we could do moment().endOf('day') instead
48 cd.setHours(23, 59, 59);
49 chdd.ceiling_date(dojo.date.stamp.toISOString(cd));
51 chddGrid.onEditPane = function(pane) {
52 pane.onSubmit = function(chdd, ops) {
54 (new openils.PermaCrud())[pane.mode](chdd, ops);
57 chddGrid.createPaneOnSubmit = function(chdd, ops, pane) {
59 (new openils.PermaCrud())[pane.mode](chdd, ops);
64 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
65 <div dojoType="dijit.layout.ContentPane"
66 layoutAlign="top" class="oils-header-panel">
67 <div>Hard Due Dates</div>
70 dojoType="dijit.form.Button"
71 onClick="chddGrid.showCreateDialog();">New Hard Due Date</button>
73 dojoType="dijit.form.Button"
74 onClick="chddGrid.deleteSelected();">Deleted Selected</button>
77 <div id="one_only" class="hidden">
78 <em>Showing only one hard due date.</em> [
79 <a href="./hard_due_date">Show them all</a>
83 <table jsId="chddGrid"
84 dojoType="openils.widget.AutoGrid"
87 defaultCellWidth="'auto'"
88 fieldOrder="['name', 'owner', 'ceiling_date', 'forceto']"
94 <th field="name" get="get_chdd_name"
95 formatter="format_chdd_name"></th>