Acq: admin interfaces for claims objects, link to claim policy from LI table
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Apr 2010 21:29:27 +0000 (21:29 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Apr 2010 21:29:27 +0000 (21:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16246 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/js/ui/default/conify/global/acq/claim_grid.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/templates/default/acq/common/li_table.tt2
Open-ILS/web/templates/default/conify/global/acq/claim_event_type.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/acq/claim_policy.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/acq/claim_policy_action.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/acq/claim_type.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 64a8636..19f540c 100644 (file)
@@ -6156,12 +6156,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
+                               <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
+                               <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
+                               <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
+                       </actions>
                </permacrud>
        </class>
 
        <class id="acqclet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_event_type" oils_persist:tablename="acq.claim_event_type" reporter:label="Claim Event Type">
                <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
-                       <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
                        <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
                        <field reporter:label="Code" name="code" reporter:datatype="text"/>
                        <field reporter:label="Description" name="description" reporter:datatype="text"/>
@@ -6171,6 +6177,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
+                               <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
+                               <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
+                               <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
+                       </actions>
                </permacrud>
        </class>
 
@@ -6231,7 +6243,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
                        <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
                        <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
-                       <field reporter:label="Action" name="action" reporter:datatype="link"/>
+                       <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
index 1393933..7a9288e 100644 (file)
@@ -220,6 +220,15 @@ function AcqLiTable() {
 
         this.updateLiNotesCount(li, row);
 
+        if (li.claim_policy()) {
+            var actViewInvoice = nodeByName("action_view_claim_policy", row);
+            actViewInvoice.disabled = false;
+            actViewInvoice.onclick = function() {
+                location.href = oilsBasePath + "/conify/global/acq/claim_policy/" +
+                    li.claim_policy();
+            };
+        }
+
         // show which PO this lineitem is a member of
         if(li.purchase_order() && !this.isPO) {
             var po = 
diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/claim_grid.js b/Open-ILS/web/js/ui/default/conify/global/acq/claim_grid.js
new file mode 100644 (file)
index 0000000..2557717
--- /dev/null
@@ -0,0 +1,35 @@
+dojo.require("openils.widget.AutoGrid");
+dojo.require("openils.widget.OrgUnitFilteringSelect");
+
+var owner;
+
+function prepareOwnerSelector(perm) {
+    new openils.User().buildPermOrgSelector(
+        perm,
+        ownerSelect,
+        null,
+        function() {
+            dojo.connect(
+                ownerSelect,
+                "onChange",
+                function() {
+                    owner = fieldmapper.aou.findOrgUnit(this.attr("value"));
+                    grid.resetStore();
+                    populateGrid();
+                }
+            );
+        }
+    );
+}
+
+function populateGrid(id) {
+    var search = typeof(ownerSelect) == "undefined" ? {"id": {"!=": null}} : {
+        "org_unit": fieldmapper.aou.orgNodeTrail(
+            owner || fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou()),
+            true /* asId */
+        )
+    };
+    if (id) search.id = id;
+
+    grid.loadAll(null, search);
+}
index 7dfbd5a..93ac6ce 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.acq.fund_tag.accesskey "F">
 <!ENTITY staff.main.menu.admin.server_admin.acq.cancel_reason.label "Cancel Reasons">
 <!ENTITY staff.main.menu.admin.server_admin.acq.cancel_reason.accesskey "C">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_type.label "Claim Types">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_type.accesskey "T">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_event_type.label "Claim Event Types">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_event_type.accesskey "E">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_policy.label "Claim Policies">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_policy.accesskey "P">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_policy_action.label "Claim Policy Actions">
+<!ENTITY staff.main.menu.admin.server_admin.acq.claim_policy_action.accesskey "A">
 
 <!ENTITY staff.main.menu.admin.server_admin.booking.label "Booking">
 <!ENTITY staff.main.menu.admin.server_admin.booking.accesskey "B">
index 4d42f38..a1e9694 100644 (file)
@@ -77,6 +77,7 @@
                                     <td style='width:70%;font-weight:bold;'>
                                         <a attr='title' href='javascript:void(0);'></a>
                                         <span name="worksheet">(<a name="worksheet_link" href="javascript:void(0);">&#x270D;</a>)</span>
+                                        <span name="claim_policy" class="hidden">(Claim Policy: <a name="claim_policy_link" href="javascript:void(0);"></a>)</span>
                                         <span name='pl' class='hidden'>(<a name='pl_link' href='javascript:void(0);'></a>)</span>
                                         <span name='po' class='hidden'>(<a name='po_link' href='javascript:void(0);'>PO</a>)</span>
                                     </td>
                             <option name='action_new_invoice' disabled='disabled'>New Invoice</option>
                             <option name='action_link_invoice' disabled='disabled'>Link to Invoice</option>
                             <option name='action_view_invoice' disabled='disabled'>View Invoice(s)</option>
+                            <option name='action_view_claim_policy' disabled='disabled'>View Claim Policy</option>
                         </select>
                     </td>
                     <td><span name='li_state'></span></td>
diff --git a/Open-ILS/web/templates/default/conify/global/acq/claim_event_type.tt2 b/Open-ILS/web/templates/default/conify/global/acq/claim_event_type.tt2
new file mode 100644 (file)
index 0000000..0ae7b59
--- /dev/null
@@ -0,0 +1,41 @@
+[% WRAPPER default/base.tt2 %]
+<script src="[% ctx.media_prefix %]/js/ui/default/conify/global/acq/claim_grid.js"></script>
+<script>
+openils.Util.addOnLoad(
+    function() {
+        prepareOwnerSelector("ADMIN_ACQ_CLAIM_EVENT_TYPE");
+        populateGrid();
+    }
+);
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div>Claim Event Types</div>
+        <div>
+            <button onclick="grid.showCreateDialog()">
+                New Claim Event Type
+            </button>
+            <button onclick="grid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <div class="oils-acq-basic-roomy">
+        <span>Show claim event types available to</span>
+        <select
+            dojoType="openils.widget.OrgUnitFilteringSelect"
+            jsId="ownerSelect" searchAttr="shortname"
+            labelAttr="shortname">
+        </select>
+    </div>
+    <table jsId="grid"
+        dojoType="openils.widget.AutoGrid"
+        fieldOrder="['code', 'org_unit', 'description']"
+        suppressFields="['id']"
+        query="{id: '*'}"
+        defaultCellWidth="20"
+        fmClass="acqclet"
+        showPaginator="true"
+        editOnEnter="true">
+    </table>
+</div>
+[% END %]
diff --git a/Open-ILS/web/templates/default/conify/global/acq/claim_policy.tt2 b/Open-ILS/web/templates/default/conify/global/acq/claim_policy.tt2
new file mode 100644 (file)
index 0000000..5c3724c
--- /dev/null
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+<script src="[% ctx.media_prefix %]/js/ui/default/conify/global/acq/claim_grid.js"></script>
+<script>
+openils.Util.addOnLoad(
+    function() {
+        prepareOwnerSelector("ADMIN_CLAIM_POLICY");
+        populateGrid("[% ctx.page_args.0 %]");
+    }
+);
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div>Claim Policies</div>
+        <div>
+            <button onclick="grid.showCreateDialog()">New Claim Policy</button>
+            <button onclick="grid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <div class="oils-acq-basic-roomy">
+        <span>Show claim policies available to</span>
+        <select
+            dojoType="openils.widget.OrgUnitFilteringSelect"
+            jsId="ownerSelect" searchAttr="shortname"
+            labelAttr="shortname">
+        </select>
+    </div>
+    <table jsId="grid"
+        dojoType="openils.widget.AutoGrid"
+        fieldOrder="['name', 'org_unit', 'description']"
+        suppressFields="['id']"
+        query="{id: '*'}"
+        defaultCellWidth="20"
+        fmClass="acqclp"
+        showPaginator="true"
+        editOnEnter="true">
+    </table>
+</div>
+[% END %]
diff --git a/Open-ILS/web/templates/default/conify/global/acq/claim_policy_action.tt2 b/Open-ILS/web/templates/default/conify/global/acq/claim_policy_action.tt2
new file mode 100644 (file)
index 0000000..27fe36f
--- /dev/null
@@ -0,0 +1,32 @@
+[% WRAPPER default/base.tt2 %]
+<script src="[% ctx.media_prefix %]/js/ui/default/conify/global/acq/claim_grid.js"></script>
+<script>
+openils.Util.addOnLoad(
+    function() {
+        /* XXX TODO support URI param for claim_policy search constraint */
+        populateGrid();
+    }
+);
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div>Claim Policy Actions</div>
+        <div>
+            <button onclick="grid.showCreateDialog()">
+                New Claim Policy Action
+            </button>
+            <button onclick="grid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <table jsId="grid"
+        dojoType="openils.widget.AutoGrid"
+        suppressFields="['id']"
+        query="{id: '*'}"
+        defaultCellWidth="20"
+        fmClass="acqclpa"
+        showPaginator="true"
+        editOnEnter="true">
+    </table>
+</div>
+[% END %]
diff --git a/Open-ILS/web/templates/default/conify/global/acq/claim_type.tt2 b/Open-ILS/web/templates/default/conify/global/acq/claim_type.tt2
new file mode 100644 (file)
index 0000000..8425558
--- /dev/null
@@ -0,0 +1,39 @@
+[% WRAPPER default/base.tt2 %]
+<script src="[% ctx.media_prefix %]/js/ui/default/conify/global/acq/claim_grid.js"></script>
+<script>
+openils.Util.addOnLoad(
+    function() {
+        prepareOwnerSelector("ADMIN_ACQ_CLAIM_TYPE");
+        populateGrid();
+    }
+);
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div>Claim Types</div>
+        <div>
+            <button onclick="grid.showCreateDialog()">New Claim Type</button>
+            <button onclick="grid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <div class="oils-acq-basic-roomy">
+        <span>Show claim types available to</span>
+        <select
+            dojoType="openils.widget.OrgUnitFilteringSelect"
+            jsId="ownerSelect" searchAttr="shortname"
+            labelAttr="shortname">
+        </select>
+    </div>
+    <table jsId="grid"
+        dojoType="openils.widget.AutoGrid"
+        fieldOrder="['code', 'org_unit', 'description']"
+        suppressFields="['id']"
+        query="{id: '*'}"
+        defaultCellWidth="20"
+        fmClass="acqclt"
+        showPaginator="true"
+        editOnEnter="true">
+    </table>
+</div>
+[% END %]
index 51f1c4c..aea955e 100644 (file)
@@ -667,6 +667,22 @@ main.menu.prototype = {
                 ['oncommand'],
                 function() { open_eg_web_page('conify/global/acq/cancel_reason'); }
             ],
+            'cmd_server_admin_acq_claim_type' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/acq/claim_type'); }
+            ],
+            'cmd_server_admin_acq_claim_event_type' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/acq/claim_event_type'); }
+            ],
+            'cmd_server_admin_acq_claim_policy' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/acq/claim_policy'); }
+            ],
+            'cmd_server_admin_acq_claim_policy_action' : [
+                ['oncommand'],
+                function() { open_eg_web_page('conify/global/acq/claim_policy_action'); }
+            ],
             'cmd_server_admin_z39_source' : [
                 ['oncommand'],
                 function() { open_eg_web_page('conify/global/config/z3950_source'); }
index 52bf257..62dfe83 100644 (file)
     <command id="cmd_server_admin_acq_cancel_reason"/>
     <command id="cmd_server_admin_acq_lineitem_alert"/>
     <command id="cmd_server_admin_acq_fund_tag"/>
+    <command id="cmd_server_admin_acq_claim_type"/>
+    <command id="cmd_server_admin_acq_claim_event_type"/>
+    <command id="cmd_server_admin_acq_claim_policy"/>
+    <command id="cmd_server_admin_acq_claim_policy_action"/>
     <command id="cmd_server_admin_z39_source"/>
     <command id="cmd_server_admin_circ_mod"/>
     <command id="cmd_server_admin_org_unit_setting_type"/>
                         <menuitem label="&staff.main.menu.admin.server_admin.acq.lineitem_alert.label;" accesskey="&staff.main.menu.admin.server_admin.acq.lineitem_alert.accesskey;" command="cmd_server_admin_acq_lineitem_alert"/>
                         <menuitem label="&staff.main.menu.admin.server_admin.acq.fund_tag.label;" accesskey="&staff.main.menu.admin.server_admin.acq.fund_tag.accesskey;" command="cmd_server_admin_acq_fund_tag"/>
                         <menuitem label="&staff.main.menu.admin.server_admin.acq.cancel_reason.label;" accesskey="&staff.main.menu.admin.server_admin.acq.cancel_reason.accesskey;" command="cmd_server_admin_acq_cancel_reason"/>
+                        <menuseparator />
+                        <menuitem label="&staff.main.menu.admin.server_admin.acq.claim_type.label;" accesskey="&staff.main.menu.admin.server_admin.acq.claim_type.accesskey;" command="cmd_server_admin_acq_claim_type"/>
+                        <menuitem label="&staff.main.menu.admin.server_admin.acq.claim_event_type.label;" accesskey="&staff.main.menu.admin.server_admin.acq.claim_event_type.accesskey;" command="cmd_server_admin_acq_claim_event_type"/>
+                        <menuitem label="&staff.main.menu.admin.server_admin.acq.claim_policy.label;" accesskey="&staff.main.menu.admin.server_admin.acq.claim_policy.accesskey;" command="cmd_server_admin_acq_claim_policy"/>
+                        <menuitem label="&staff.main.menu.admin.server_admin.acq.claim_policy_action.label;" accesskey="&staff.main.menu.admin.server_admin.acq.claim_policy_action.accesskey;" command="cmd_server_admin_acq_claim_policy_action"/>
                     </menupopup>
                 </menu>
                 <menu id="main.menu.admin.server.booking" label="&staff.main.menu.admin.server_admin.booking.label;" accesskey="&staff.main.menu.admin.server_admin.booking.accesskey;">