]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/conify/global/actor/address_alert.tt2
Alert addresses for patron registration : configuration UI
[Evergreen.git] / Open-ILS / src / templates / conify / global / actor / address_alert.tt2
1 [% WRAPPER base.tt2 %]
2 [% ctx.page_title = l('Address Alert') %]
3 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
4     <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
5         <div>[% l('Address Alert') %]</div>
6         <div>
7             <button dojoType='dijit.form.Button' onClick='addrAlertGrid.showCreateDialog()'>[% l('New Address Alert') %]</button>
8             <button dojoType='dijit.form.Button' onClick='addrAlertGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
9         </div>
10     </div>
11     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
12         <span>[% l('Context Org Unit') %]</span>
13         <select dojoType="openils.widget.OrgUnitFilteringSelect"
14                 jsId='contextOrgSelector'
15                 searchAttr='shortname'
16                 labelAttr='shortname'>
17         </select>
18     </div>
19     <div>
20         <p>
21             [% |l %]* Address Alert fields support regular expressions and are case-insensitive by default.[% END %]<br/>
22             <span class='pad-level-1'>[% |l %]* Example wildcard match:  742 Evergr.*n Terrace[% END %]</span><br/>
23             <span class='pad-level-1'>[% |l %]* Example case-sensitive match: (?c)742 Evergr.*n Terrace[% END %]</span><br/>
24             [% |l %]* If the billing or mailing address fields are selected, the tested address must be a billing or mailing address to match.[% END %]<br/>
25         </p>
26     </div>
27     <table  jsId="addrAlertGrid"
28             dojoType="openils.widget.AutoGrid"
29             fieldOrder="['owner', 'active', 'match_all', 'alert_message', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
30             query="{field: '*'}"
31             fmClass='aal'
32             autoHeight='true'
33             editOnEnter='true'>
34     </table>
35 </div>
36
37 <script type="text/javascript">
38     dojo.require('openils.Util');
39     dojo.require('openils.User');
40     dojo.require('openils.widget.AutoGrid');
41     dojo.require('openils.widget.OrgUnitFilteringSelect');
42
43     function loadGrid() {
44         var org = contextOrgSelector.attr('value');
45         addrAlertGrid.resetStore();
46         addrAlertGrid.loadAll({}, {owner : org}); 
47     }
48
49     openils.Util.addOnLoad( 
50         function() { 
51             new openils.User().buildPermOrgSelector('ADMIN_ADDRESS_ALERT', contextOrgSelector, null, 
52                 function() {
53                     dojo.connect(contextOrgSelector, 'onChange', loadGrid);
54                     loadGrid();
55                 }
56             );
57         } 
58     );
59 </script>
60 [% END %]
61
62