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; }
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>
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>
20 <span>[% l('Context Org Unit') %]</span>
21 <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='btContextOrgSelect'
22 searchAttr='shortname' labelAttr='shortname'> </select>
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']"
31 defaultCellWidth='"auto"'
37 <th field='provider' get='getProvider' formatter='formatProvider'/>
38 <th field='owner' get='getOwner'/>
43 <div class="footer_notes">
44 [% i18n_host = '<b>' _ l('Host') _ '</b>';
45 i18n_username = '<b>' _ l('Username') _ '</b>';
46 i18n_password = '<b>' _ l('Password') _ '</b>';
47 i18n_account = '<b>' _ l('Account') _ '</b>';
48 i18n_van = '<b>' _ l('Vendor Account Number') _ '</b>';
49 i18n_vac = '<b>' _ l('Vendor Assigned Code') _ '</b>';
50 l('[_1] is the full FTP/SSH hostname, including the protocol, e.g. ftp://ftp1.somevendor.com', i18n_host) %]<br />
51 [% l('[_1], [_2] and [_3] are (s)FTP/SSH parameters.', i18n_username, i18n_password, i18n_account) %]<br />
52 [% l('[_1] is unlikely to be used by modern systems and should typically be empty.', i18n_account) %]<br />
53 [% l('[_1] (VAN) is vendor-assigned, only needed if different than the org_unit SAN.', i18n_van) %]<br />
54 [% l("[_1] (VAC) is essentially a sub-account designation, e.g. '0001'. It can be used with or without VAN.", i18n_vac) %]<br />
55 [% l('The location of codes in the EDI message itself may vary according to vendor-specific semantics.') %]
59 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/edi_account.js'> </script>
61 <script type="text/javascript">
62 // dojo.require('openils.widget.OrgUnitFilteringSelect');
63 dojo.require('fieldmapper.OrgUtils');
65 var targetId = '[% ctx.page_args.0 %]';
67 function getOrgName(orgId) {
68 return fieldmapper.aou.findOrgUnit(orgId).shortname();
70 function getOwner(rowIndex, item) {
72 var id = this.grid.store.getValue(item, 'owner');
73 return getOrgName(id);
75 function getProvider(rowIndex, item) {
77 var id = this.grid.store.getValue(item, 'provider');
78 return id + ':' + id; // TODO: get acq.provider.code from fieldmapper or elsewhere
80 function formatProvider(value) {
82 var vals = value.split(/:/);
83 return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';