Config UIs for hard due dates and their values
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Oct 2010 22:43:48 +0000 (22:43 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Oct 2010 22:43:48 +0000 (22:43 +0000)
Also, connect to the UI for circ policies

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18535 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/templates/base.tt2
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 d2f0d03..3ef188b 100644 (file)
@@ -1906,7 +1906,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"/>
@@ -2465,6 +2465,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="ADMIN_HARD_DUE_DATE" global_required="true" />
+                               <retrieve />
+                               <update permission="ADMIN_HARD_DUE_DATE" global_required="true" />
+                               <delete permission="ADMIN_HARD_DUE_DATE" global_required="true" />
+                       </actions>
                </permacrud>
        </class>
 
index d2610cb..6cc1a3a 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.conify.circulation_modifier.label "Circulation Modifiers">
 <!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_setting_type "Organization Unit Setting Types">
 <!ENTITY staff.main.menu.admin.server_admin.conify.usr_setting_type "User Setting Types">
+<!ENTITY staff.main.menu.admin.server_admin.conify.config_hard_due_date "Hard Due Date Changes">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_circ_duration "Circulation Duration Rules">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_recurring_fine "Circulation Recurring Fine Rules">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_max_fine "Circulation Max Fine Rules">
index 19e905d..dc426c2 100644 (file)
@@ -21,7 +21,7 @@ var djConfig = {parseOnLoad:true,isDebug:false,AutoIDL:[
 'acqligad','acqliuad','acqlipad','acqphsm','acqlilad','acqedi','acqedim','acqdf','acqdfe','acqdfa','acqda','cnal',
 'acqclt','acqclet','acqcl','acqcle','acqscl','acqscle','acqclp','acqclpa','acqlisum','acqft','acqftm','actsce','actscecm',
 'jub','sdist','ssub','sstr','scap','bre','siss','act', 'acpl', 'ccm', 'aiit', 'atevdef', 'ath', 'atreact','atclean','atenv','atevparam','atcol','actsc','cit',
-'atval','crahp','crmf','crrf','crcd','cust','coust','cgf','czs','cbt','csp','brt','brsrc','bra','bram','brav','vaq','vbq','vqar','ccmm','ccmcmtm','citm','cifm','cvrfm','chmm','chdd']};
+'atval','crahp','crmf','crrf','crcd','cust','coust','cgf','czs','cbt','csp','brt','brsrc','bra','bram','brav','vaq','vbq','vqar','ccmm','ccmcmtm','citm','cifm','cvrfm','chmm','chdd','chddv']};
         </script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js"></script>
index b62042b..6054078 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 95d121e..e098173 100644 (file)
@@ -610,6 +610,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function() { open_eg_web_page('conify/global/config/rule_circ_duration'); }
             ],
+            'cmd_server_admin_config_hard_due_date' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/config/hard_due_date'); }
+            ],
             'cmd_server_admin_config_rule_recurring_fine' : [
                 ['oncommand'],
                 function() { open_eg_web_page('conify/global/config/rule_recurring_fine'); }
index ff1d29f..ed3ffaa 100644 (file)
     <command id="cmd_server_admin_global_flag"/>
     <command id="cmd_server_admin_org_unit_setting_type"/>
     <command id="cmd_server_admin_usr_setting_type"/>
+    <command id="cmd_server_admin_config_hard_due_date"/>
     <command id="cmd_server_admin_config_rule_circ_duration"/>
     <command id="cmd_server_admin_config_rule_recurring_fine"/>
     <command id="cmd_server_admin_config_rule_max_fine"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.global_flag.label;" command="cmd_server_admin_global_flag"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.org_unit_setting_type;" command="cmd_server_admin_org_unit_setting_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.usr_setting_type;" command="cmd_server_admin_usr_setting_type"/>
+                <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.config_rule_circ_duration;" command="cmd_server_admin_config_rule_circ_duration"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config_rule_recurring_fine;" command="cmd_server_admin_config_rule_recurring_fine"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config_rule_max_fine;" command="cmd_server_admin_config_rule_max_fine"/>