]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/conify/global/acq/edi_account.tt2
2d38ebe482d918d81405f4425d2ef272b60554e5
[working/Evergreen.git] / Open-ILS / src / templates / conify / global / acq / edi_account.tt2
1 [% WRAPPER base.tt2 %]
2 [% ctx.page_title = '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>EDI Accounts</div>
12             <div>
13                 <button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New Account</button>
14                 <button dojoType='dijit.form.Button' onClick='pListGrid.deleteSelected()'>Delete Selected</button> 
15             </div>
16         </div>
17     </div>
18     <!--
19     <div>
20         <span>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         <b>Host</b> is the full FTP/SSH hostname, including the protocol, e.g. ftp://ftp1.somevendor.com<br />  
45         <b>Username</b>, <b>Password</b> and <b>Account</b> are (s)FTP/SSH parameters.<br />
46         <b>Account</b> is unlikely to be used by modern systems and should typically be empty.<br />
47         <b>Vendor Account Number</b> (VAN) is vendor-assigned, only needed if different than the org_unit SAN.<br />
48         <b>Vendor Assigned Code</b> (VAC) is essentially a sub-account designation, e.g. '0001'.  It can be used with or without VAN.<br />
49         The location of codes in the EDI message itself may vary according to vendor-specific semantics.
50     </div>
51 </div>
52
53 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/edi_account.js'> </script>
54
55 <script type="text/javascript">
56 // dojo.require('openils.widget.OrgUnitFilteringSelect');
57 dojo.require('fieldmapper.OrgUtils');
58
59 var targetId = '[% ctx.page_args.0 %]';
60
61 function getOrgName(orgId) {
62     return fieldmapper.aou.findOrgUnit(orgId).shortname();
63 }
64 function getOwner(rowIndex, item) {
65     if (!item) return '';
66     var id = this.grid.store.getValue(item, 'owner');
67     return getOrgName(id);
68 }
69 function getProvider(rowIndex, item) {
70     if (!item) return '';
71     var id = this.grid.store.getValue(item, 'provider');
72     return id + ':' + id;   // TODO: get acq.provider.code from fieldmapper or elsewhere
73 }
74 function formatProvider(value) {
75     if (value) {
76         var vals = value.split(/:/);
77         return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
78     }
79 }
80 </script>
81 [% END %]
82