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