Backport r18535 from trunk: hard due date config UIs
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Nov 2010 19:33:44 +0000 (19:33 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Nov 2010 19:33:44 +0000 (19:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@18588 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2
Open-ILS/web/templates/default/conify/global/config/hard_due_date.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/config/hard_due_date_values.tt2 [new file with mode: 0644]
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

index 4c372d4..393acc8 100644 (file)
@@ -1599,7 +1599,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
        </class>
 
        <class id="chddv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date_values" oils_persist:tablename="config.hard_due_date_values" reporter:label="Hard Due Date Values">
-               <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_vales_id_seq">
+               <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
                        <field reporter:label="ID" name="id" reporter:datatype="id"/>
                        <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
                        <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
index 669bb3b..6f90ccb 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.conify.perm_list.label "Permissions">
 <!ENTITY staff.main.menu.admin.server_admin.conify.copy_status.label "Copy Statuses">
 <!ENTITY staff.main.menu.admin.server_admin.conify.marc_code_maps.label "MARC Codes">
+<!ENTITY staff.main.menu.admin.server_admin.conify.config_hard_due_date "Hard Due Date Changes">
 <!ENTITY staff.main.menu.admin.server_admin.conify.billing_type.label "Billing Types">
 <!ENTITY staff.main.menu.admin.server_admin.conify.z3950_source.label "Z39.50 Servers">
 <!ENTITY staff.main.menu.admin.server_admin.conify.circulation_modifier.label "Circulation Modifiers">
index 9bf0851..7338977 100644 (file)
@@ -7,7 +7,7 @@
 </div>
 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
     <table  jsId="cmGrid"
-            autoHeight='true'
+            style="height: 600px;"
             dojoType="openils.widget.AutoGrid"
             fieldOrder="['org_unit', 'active', 'grp', 'circ_modifier', 'marc_type', 'marc_form', 'marc_vr_format']"
             defaultCellWidth='"auto"'
             editOnEnter='true'
             showColumnPicker='true'
             columnPickerPrefix='"conify.config.circ_matrix_matchpoint"'>
+            <thead>
+                <tr>
+                    <th field="hard_due_date" formatter="format_hard_due_date">
+                    </th>
+                </tr>
+            </thead>
     </table>
 </div>
 
 
 <div class='hidden'><div dojoType='openils.widget.ProgressDialog' jsId='progressDialog'/></div>
 
+<script type="text/javascript">
+    function format_hard_due_date(name) {
+        return "<a href='" + oilsBasePath +
+            "/conify/global/config/hard_due_date?name=" +
+            encodeURIComponent(name) + "'>" + name + "</a>";
+    }
+</script>
 [% END %]
 
diff --git a/Open-ILS/web/templates/default/conify/global/config/hard_due_date.tt2 b/Open-ILS/web/templates/default/conify/global/config/hard_due_date.tt2
new file mode 100644 (file)
index 0000000..4d5c321
--- /dev/null
@@ -0,0 +1,80 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = "Hard Due Dates" %]
+<script type="text/javascript">
+    dojo.require("openils.CGI");
+    dojo.require("openils.Util");
+    dojo.require("openils.widget.AutoGrid");
+
+    function get_chdd_name(rowIndex, item) {
+        if (!item) return null;
+        else return {
+            "id": this.grid.store.getValue(item, "id"),
+            "name": this.grid.store.getValue(item, "name")
+        };
+    }
+
+    function format_chdd_name(blob) {
+        if (blob) {
+            return "<a href='" + oilsBasePath +
+                "/conify/global/config/hard_due_date_values?chdd=" +
+                blob.id + "'>" + blob.name + "</a>";
+        } else {
+            return "";
+        }
+    }
+
+    openils.Util.addOnLoad(
+        function() {
+            var cgi = new openils.CGI();
+            var filter = null;
+            var id = cgi.param("id");
+            var name = cgi.param("name");
+            if (id) {
+                filter = {"id": id};
+                openils.Util.show("one_only");
+            } else if (name) {
+                filter = {"name": name};
+                openils.Util.show("one_only");
+            }
+            chddGrid.loadAll({"order_by": {"chdd": "name"}}, filter);
+        }
+    );
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+        layoutAlign="top" class="oils-header-panel">
+        <div>Hard Due Dates</div>
+        <div>
+            <button
+                dojoType="dijit.form.Button"
+                onClick="chddGrid.showCreateDialog();">New Hard Due Date</button>
+            <button
+                dojoType="dijit.form.Button"
+                onClick="chddGrid.deleteSelected();">Deleted Selected</button>
+        </div>
+    </div>
+    <div id="one_only" class="hidden">
+        <em>Showing only one hard due date.</em> [
+            <a href="./hard_due_date">Show them all</a>
+        ]
+    </div>
+    <div>
+        <table jsId="chddGrid"
+            dojoType="openils.widget.AutoGrid"
+            showPaginator="true"
+            query="{name: '*'}"
+            defaultCellWidth="'auto'"
+            fieldOrder="['name', 'owner', 'ceiling_date', 'forceto']"
+            fmClass="chdd"
+            hideSelector="true"
+            editOnEnter="true">
+            <thead>
+                <tr>
+                    <th field="name" get="get_chdd_name"
+                        formatter="format_chdd_name"></th>
+                </tr>
+            </thead>
+        </table>
+    </div>
+</div>
+[% END %]
diff --git a/Open-ILS/web/templates/default/conify/global/config/hard_due_date_values.tt2 b/Open-ILS/web/templates/default/conify/global/config/hard_due_date_values.tt2
new file mode 100644 (file)
index 0000000..5c51664
--- /dev/null
@@ -0,0 +1,73 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = "Hard Due Date Values" %]
+<script type="text/javascript">
+    dojo.require("openils.CGI");
+    dojo.require("openils.PermaCrud");
+    dojo.require("openils.Util");
+    dojo.require("openils.widget.AutoGrid");
+    dojo.require("dijit.form.TextBox");
+
+    openils.Util.addOnLoad(
+        function() {
+            var filter = null;
+            var chdd_id = (new openils.CGI()).param("chdd");
+
+            if (chdd_id) {
+                filter = {"hard_due_date": chdd_id};
+                var hard_due_date =
+                    (new openils.PermaCrud()).retrieve("chdd", chdd_id);
+
+                dojo.byId("linked_chdd_name").innerHTML = hard_due_date.name();
+                dojo.byId("linked_chdd_link").innerHTML = hard_due_date.id();
+                dojo.byId("linked_chdd_link").onclick = function() {
+                    location.href = oilsBasePath +
+                        "/conify/global/config/hard_due_date?id=" +
+                        hard_due_date.id();
+                };
+                openils.Util.show("linked_chdd");
+            }
+
+            chddvGrid.overrideEditWidgets.hard_due_date =
+                new dijit.form.TextBox({"disabled": true});
+            chddvGrid.overrideEditWidgets.hard_due_date.shove = {
+                "create": chdd_id
+            };
+
+            chddvGrid.loadAll({"order_by": {"chddv": "active_date"}}, filter);
+        }
+    );
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+        layoutAlign="top" class="oils-header-panel">
+        <div>Hard Due Date Values</div>
+        <div>
+            <button
+                dojoType="dijit.form.Button"
+                onClick="chddvGrid.showCreateDialog();">New Hard Due Date Value</button>
+            <button
+                dojoType="dijit.form.Button"
+                onClick="chddvGrid.deleteSelected();">Deleted Selected</button>
+        </div>
+    </div>
+    <div class="hidden" id="linked_chdd">
+        <em>Showing only hard due date values related to hard due date object</em>
+        <strong id="linked_chdd_name"></strong> (#
+        <a href="javascript:void(0);" id="linked_chdd_link"></a>)
+    </div>
+    <div>
+        <table jsId="chddvGrid"
+            dojoType="openils.widget.AutoGrid"
+            showPaginator="true"
+            query="{name: '*'}"
+            defaultCellWidth="'auto'"
+            fieldOrder="['hard_due_date', 'ceiling_date', 'active_date']"
+            suppressFields="['hard_due_date']"
+            suppressEditFields="['id']"
+            fmClass="chddv"
+            hideSelector="true"
+            editOnEnter="true">
+        </table>
+    </div>
+</div>
+[% END %]
index 0c7649d..8b9a66f 100644 (file)
@@ -612,6 +612,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function() { open_eg_web_page('conify/global/booking/resource_attr_map'); }
             ],
+            'cmd_server_admin_config_hard_due_date' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/config/hard_due_date'); }
+            ],
             'cmd_acq_view_picklist' : [
                 ['oncommand'],
                 function() { open_eg_web_page('acq/picklist/list', 'menu.cmd_acq_view_picklist.tab'); }
index 87e921f..456892c 100644 (file)
     <command id="cmd_server_admin_billing_type"/>
     <command id="cmd_server_admin_z39_source"/>
     <command id="cmd_server_admin_circ_mod"/>
+    <command id="cmd_server_admin_config_hard_due_date"/>
 
     <command id="cmd_server_admin_booking_resource" />
     <command id="cmd_server_admin_booking_resource_type" />
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.perm_list.label;" command="cmd_server_admin_perm_list"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.copy_status.label;" command="cmd_server_admin_copy_status"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.marc_code_maps.label;" command="cmd_server_admin_marc_code"/>
+                <menuitem label="&staff.main.menu.admin.server_admin.conify.config_hard_due_date;" command="cmd_server_admin_config_hard_due_date"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.billing_type.label;" command="cmd_server_admin_billing_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.z3950_source.label;" command="cmd_server_admin_z39_source"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.circulation_modifier.label;" command="cmd_server_admin_circ_mod"/>