]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/acq/edi_account.tt2
JS reordering to account for readyState event leakage from XHR to the main page
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / acq / edi_account.tt2
1 [% WRAPPER default/base.tt2 %]
2 [% ctx.page_title = 'EDI Accounts' %]
3 <style type="text/css">
4     .footer_notes { padding-top: 16px; font-size: smaller; }
5 </style>
6
7 <div id='main-list-div'>
8     <div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
9         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
10             <div>EDI Accounts</div>
11             <div>
12                 <button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New Account</button>
13                 <button dojoType='dijit.form.Button' onClick='pListGrid.deleteSelected()'>Delete Selected</button> 
14             </div>
15         </div>
16     </div>
17     <!--
18     <div>
19         <span>Context Org Unit</span>
20         <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='btContextOrgSelect'
21             searchAttr='shortname' labelAttr='shortname'> </select>
22     </div>
23     -->
24     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
25         <table  jsId="pListGrid"
26                 dojoType="openils.widget.AutoGrid"
27                 fieldOrder="['id', 'label', 'host', 'username', 'password', 'account', 'owner', 'last_activity', 'provider', 'path', 'in_dir', 'vendacct', 'vendcode']"
28                 query="{id: '*'}"
29                 defaultCellWidth='"auto"'
30                 fmClass='acqedi'
31                 showPaginator='true'
32                 editOnEnter='true'>
33             <thead>
34                 <tr>
35                     <th field='provider' get='getProvider' formatter='formatProvider'/>
36                     <th field='owner' get='getOwner'/>
37                 </tr>
38             </thead>
39         </table>
40     </div>
41     <div class="footer_notes">
42         <b>Username</b>, <b>Password</b> and <b>Account</b> are (s)FTP/SSH parameters.<br />
43         <b>Account</b> is unlikely to be used by modern systems and should typically be empty.<br />
44         <b>Vendor Account Number</b> (VAN) is vendor-assigned, only needed if different than the org_unit SAN.<br />
45         <b>Vendor Assigned Code</b> (VAC) is essentially a sub-account designation, e.g. '0001'.  It can be used with or without VAN.<br />
46         The location of codes in the EDI message itself may vary according to vendor-specific semantics.
47     </div>
48 </div>
49
50 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/edi_account.js'> </script>
51
52 <script type="text/javascript">
53 // dojo.require('openils.widget.OrgUnitFilteringSelect');
54 dojo.require('fieldmapper.OrgUtils');
55
56 var targetId = '[% ctx.page_args.0 %]';
57
58 function getOrgName(orgId) {
59     return fieldmapper.aou.findOrgUnit(orgId).shortname();
60 }
61 function getOwner(rowIndex, item) {
62     if (!item) return '';
63     var id = this.grid.store.getValue(item, 'owner');
64     return getOrgName(id);
65 }
66 function getProvider(rowIndex, item) {
67     if (!item) return '';
68     var id = this.grid.store.getValue(item, 'provider');
69     return id + ':' + id;   // TODO: get acq.provider.code from fieldmapper or elsewhere
70 }
71 function formatProvider(value) {
72     if (value) {
73         var vals = value.split(/:/);
74         return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
75     }
76 }
77 </script>
78 [% END %]
79