Alert addresses for patron registration : configuration UI
authorBill Erickson <berick@esilibrary.com>
Fri, 9 Dec 2011 15:43:28 +0000 (10:43 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 14 Dec 2011 15:10:40 +0000 (10:10 -0500)
Conify UI for managing Alert Addresses

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/templates/conify/global/actor/address_alert.tt2 [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

diff --git a/Open-ILS/src/templates/conify/global/actor/address_alert.tt2 b/Open-ILS/src/templates/conify/global/actor/address_alert.tt2
new file mode 100644 (file)
index 0000000..6350530
--- /dev/null
@@ -0,0 +1,62 @@
+[% WRAPPER base.tt2 %]
+[% ctx.page_title = l('Address Alert') %]
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+        <div>[% l('Address Alert') %]</div>
+        <div>
+            <button dojoType='dijit.form.Button' onClick='addrAlertGrid.showCreateDialog()'>[% l('New Address Alert') %]</button>
+            <button dojoType='dijit.form.Button' onClick='addrAlertGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
+        </div>
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+        <span>[% l('Context Org Unit') %]</span>
+        <select dojoType="openils.widget.OrgUnitFilteringSelect"
+                jsId='contextOrgSelector'
+                searchAttr='shortname'
+                labelAttr='shortname'>
+        </select>
+    </div>
+    <div>
+        <p>
+            [% |l %]* Address Alert fields support regular expressions and are case-insensitive by default.[% END %]<br/>
+            <span class='pad-level-1'>[% |l %]* Example wildcard match:  742 Evergr.*n Terrace[% END %]</span><br/>
+            <span class='pad-level-1'>[% |l %]* Example case-sensitive match: (?c)742 Evergr.*n Terrace[% END %]</span><br/>
+            [% |l %]* If the billing or mailing address fields are selected, the tested address must be a billing or mailing address to match.[% END %]<br/>
+        </p>
+    </div>
+    <table  jsId="addrAlertGrid"
+            dojoType="openils.widget.AutoGrid"
+            fieldOrder="['owner', 'active', 'match_all', 'alert_message', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
+            query="{field: '*'}"
+            fmClass='aal'
+            autoHeight='true'
+            editOnEnter='true'>
+    </table>
+</div>
+
+<script type="text/javascript">
+    dojo.require('openils.Util');
+    dojo.require('openils.User');
+    dojo.require('openils.widget.AutoGrid');
+    dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+    function loadGrid() {
+        var org = contextOrgSelector.attr('value');
+        addrAlertGrid.resetStore();
+        addrAlertGrid.loadAll({}, {owner : org}); 
+    }
+
+    openils.Util.addOnLoad( 
+        function() { 
+            new openils.User().buildPermOrgSelector('ADMIN_ADDRESS_ALERT', contextOrgSelector, null, 
+                function() {
+                    dojo.connect(contextOrgSelector, 'onChange', loadGrid);
+                    loadGrid();
+                }
+            );
+        } 
+    );
+</script>
+[% END %]
+
+
index 2ba73f7..e9a63bf 100644 (file)
 <!ENTITY staff.main.menu.admin.local_admin.copy_template.accesskey "T">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.label "Patrons with Negative Balances">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.accesskey "N">
+<!ENTITY staff.main.menu.admin.local_admin.address_alert.label "Address Alerts">
 
 <!ENTITY staff.main.menu.admin.server_admin.label "Server Administration">
 <!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_type.label "Organization Types">
index 65aa26c..fe93b18 100644 (file)
@@ -1048,6 +1048,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/booking/resource_attr_map', null, event); }
             ],
+            'cmd_local_admin_address_alert' : [
+                ['oncommand'],
+                function(event) { open_eg_web_page('conify/global/actor/address_alert', null, event); }
+            ],
             'cmd_acq_create_invoice' : [
                 ['oncommand'],
                 function(event) { open_eg_web_page('acq/invoice/view?create=1', 'menu.cmd_acq_create_invoice.tab', event); }
index 4ec89a3..33b171a 100644 (file)
     <command id="cmd_local_admin_work_log" />
     <command id="cmd_local_admin_patrons_due_refunds" />
     <command id="cmd_local_admin_copy_template" />
+    <command id="cmd_local_admin_address_alert"
+             perm="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT"
+             />
 
     <!-- server admin menu commands -->
     <command id="cmd_server_admin_org_type"
                 <menuitem label="&staff.main.menu.admin.local_admin.conify.survey.label;" command="cmd_local_admin_survey"/>
                 <menuitem label="&staff.server.admin.index.transit_list;" command="cmd_local_admin_transit_list"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.work_log.label;" accesskey="&staff.main.menu.admin.local_admin.work_log.accesskey;" command="cmd_local_admin_work_log"/>
+                <menuitem label="&staff.main.menu.admin.local_admin.address_alert.label;" command="cmd_local_admin_address_alert"/>
             </menupopup>
         </menu>
         <menu id="main.menu.admin.server" label="&staff.main.menu.admin.server_admin.label;">