</link> is not valid HTML
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / acq / edi_account.tt2
1 [% WRAPPER default/base.tt2 %]
2 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/edi_account.js'> </script>
3
4 <script type="text/javascript">
5 // dojo.require('openils.widget.OrgUnitFilteringSelect');
6 dojo.require('fieldmapper.OrgUtils');
7
8 var targetId = '[% ctx.page_args.0 %]';
9
10 function getOrgName(orgId) {
11     return fieldmapper.aou.findOrgUnit(orgId).shortname();
12 }
13 function getOwner(rowIndex, item) {
14     if (!item) return '';
15     var id = this.grid.store.getValue(item, 'owner');
16     return getOrgName(id);
17 }
18 function getProvider(rowIndex, item) {
19     if (!item) return '';
20     var id = this.grid.store.getValue(item, 'provider');
21     return id + ':' + id;   // TODO: get acq.provider.code from fieldmapper or elsewhere
22 }
23 function formatProvider(value) {
24     if (value) {
25         var vals = value.split(/:/);
26         return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
27     }
28 }
29 </script>
30
31 <div id='main-list-div'>
32     <div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
33         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
34             <div>EDI Accounts</div>
35             <div>
36                 <button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New Account</button>
37                 <button dojoType='dijit.form.Button' onClick='pListGrid.deleteSelected()'>Delete Selected</button> 
38             </div>
39         </div>
40     </div>
41     <!--
42     <div>
43         <span>Context Org Unit</span>
44         <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='btContextOrgSelect'
45             searchAttr='shortname' labelAttr='shortname'> </select>
46     </div>
47     -->
48     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
49         <table  jsId="pListGrid"
50                 dojoType="openils.widget.AutoGrid"
51                 fieldOrder="['id', 'label', 'host', 'username', 'password', 'account', 'owner', 'last_activity', 'provider', 'path', 'in_dir', 'vendcode']"
52                 query="{id: '*'}"
53                 defaultCellWidth='"auto"'
54                 autoHeight='true'
55                 fmClass='acqedi'
56                 showPaginator='true'
57                 editOnEnter='true'>
58             <thead>
59                 <tr>
60                     <th field='provider' get='getProvider' formatter='formatProvider'/>
61                     <th field='owner' get='getOwner'/>
62                 </tr>
63             </thead>
64         </table>
65     </div>
66 </div>
67
68 [% END %]
69