plugged in initial xpath parsing for provider attr defs. fixed some grid height issue...
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / acq / provider.tt2
1 [% WRAPPER default/base.tt2 %]
2 <script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/provider.js'> </script>
3
4 <script> 
5     var providerId = '[% ctx.page_args.0 %]';
6
7     function formatName(inDatum) {
8         switch (inDatum) {
9             case 'owning_lib':
10                 return 'Owning Library';
11             case 'quantity':
12                 return 'Quantity';
13             case 'call_number':
14                 return 'Call Number';
15             case 'fund_code':
16                 return 'Fund Code';
17             case 'local_note':
18                 return 'Local Note';
19             case 'price':
20                 return 'Price';
21             case 'circ-Modifier':
22                 return 'Circulation Modifier';
23             case 'copy_location':
24                 return 'Copy Location';
25             case 'collection_code':
26                 return 'Collection Code';
27         }
28     }
29
30     function getProviderName(rowIndex, item) {
31         if(!item) return '';
32         var name = this.grid.store.getValue(item, 'name');
33         var id = this.grid.store.getValue(item, 'id');
34         return id + ':' + name;
35     }
36
37     function formatName(value) {
38         if(value) {
39             var vals = value.split(/:/);
40             return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
41         }
42     }
43 </script>
44
45
46 <div class="hidden">
47     <select dojoType="dijit.form.FilteringSelect" jsId="nameSelect">
48         <option value='owning_lib'>Owning Library</option>
49         <option value='quantity'>Quantity</option>
50         <option value='call_number'>Call Number</option>
51         <option value='fund_code'>Fund Code</option>
52         <option value='local_note'>Local Note</option>
53         <option value='price'>Price</option>
54         <option value='circ_modifier'>Circulation Modifier</option>
55         <option value='copy_location'>Copy Location</option>
56         <option value='collection_code'>Collection Code</option>
57     </select>
58 </div> 
59
60 <div id='provider-list-div' style='height: 600px;'>
61     <div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
62         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
63             <div>Provider</div>
64             <div>
65                 <button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New Provider</button>
66                 <button dojoType='dijit.form.Button' onClick='pListGrid.deleteSelected()'>Delete Selected</button> 
67             </div>
68         </div>
69     </div>
70     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
71         <table  jsId="pListGrid"
72                 dojoType="openils.widget.AutoGrid"
73                 fieldOrder="['id', 'name', 'code', 'owner', 'currency_type']"
74                 query="{id: '*'}"
75                 defaultCellWidth='"auto"'
76                 autoHeight='true'
77                 fmClass='acqpro'
78                 editOnEnter='true'>
79             <thead>
80                 <tr><th field='name' get='getProviderName' formatter='formatName'/></tr>
81             </thead>
82         </table>
83         <div/>
84     </div>
85 </div>
86
87 <div id='provider-summary-pane'></div>     
88 <div id='provider-details-div' style='height:600px;'>
89 <div dojoType="dijit.layout.TabContainer" style='height:100%;' jsId='providerTabs'>
90
91     <div dojoType="dijit.layout.ContentPane" title='Provider Address' select='true' id='provider-address'>
92
93         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
94             <div> Provider Address</div>
95             <div>
96             <button dojoType='dijit.form.Button' onClick='paListGrid.showCreateDialog()'>New Provider Address</button>
97             <button dojoType='dijit.form.Button' onClick='paListGrid.deleteSelected()'>Delete Selected</button>
98         </div>
99         </div>
100         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:100px'>
101             <table  jsId="paListGrid"
102                     dojoType="openils.widget.AutoGrid"
103                     fieldOrder="['id', 'address_type', 'provider', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
104                     query="{id: '*'}"
105                     fmClass='acqpa'
106                     defaultCellWidth='"auto"' 
107                     editOnEnter='true'>
108             </table>
109         </div>
110     </div>
111
112     <div dojoType="dijit.layout.ContentPane" title='Provider Contact' id='tab-pro-contact'>
113         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
114             <div> Provider Contact</div>
115             <div>
116             <button dojoType='dijit.form.Button' onClick='pcListGrid.showCreateDialog()'>New Contact</button>
117             <button dojoType='dijit.form.Button' onClick='pcListGrid.deleteSelected()'>Delete Selected</button>
118             </div>
119         </div>
120         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
121             <table  jsId="pcListGrid"
122                     dojoType="openils.widget.AutoGrid"
123                     fieldOrder="['id', 'name', 'provider', 'role', 'email']"
124                     defaultCellWidth='"auto"'
125                     query="{id: '*'}"
126                     fmClass='acqpc'
127                     editOnEnter='true'>
128             </table>
129         </div>
130
131     <div id='contact-addr-div'>
132         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
133             <div>Contact Address</div>
134             <div>
135             <button dojoType='dijit.form.Button' onClick='pcaListGrid.showCreateDialog()'>New Contact Address</button>
136             <button dojoType='dijit.form.Button' onClick='pcaListGrid.deleteSelected()'>Delete Selected</button>
137             </div>
138         </div>
139         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:400px'>
140             <table  jsId="pcaListGrid"
141                     dojoType="openils.widget.AutoGrid"
142                     fieldOrder="['id', 'address_type', 'contact', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
143                     query="{id: '*'}"
144                     fmClass='acqpca'
145                     defaultCellWidth='"auto"' 
146                     editOnEnter='true'>
147
148             </table>
149         </div>
150     </div>
151     </div>
152     <div dojoType="dijit.layout.ContentPane" title='Attribute Definitions' id='tab-attr'>
153         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
154             <div> Attribute Definitions</div>
155             <div>
156             <button dojoType='dijit.form.Button' onClick='padListGrid.showCreateDialog()'>New Attribute Definition</button>
157             <button dojoType='dijit.form.Button' onClick='padListGrid.deleteSelected()'>Delete Selected</button>
158             </div>
159         </div>
160         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
161             <table  jsId="padListGrid"
162                     dojoType="openils.widget.AutoGrid"
163                     fieldOrder="['id', 'provider', 'code', 'description',  'provider', 'ident', 'remove',  'tag', 'subfield', 'xpath']"
164                     query="{id: '*'}"
165                     fmClass='acqlipad'
166                     editOnEnter='true'>
167                 <thead>
168                     <tr>
169                         <th field="xpath" width='auto'/>
170                         <th field="tag" get='getParsedTag'/>
171                         <th field="subfield" get='getParsedSubf'/>
172                     </tr>
173                 </thead>
174             </table>
175         </div>
176     </div>
177
178     <div dojoType="dijit.layout.ContentPane" title='Holding Subfield' id='tab-hold'>
179         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
180             <div>Holding Subfield</div>
181             <div>
182             <button dojoType='dijit.form.Button' onClick='phsListGrid.showCreateDialog()'>New Holding Subfield</button>
183             <button dojoType='dijit.form.Button' onClick='phsListGrid.deleteSelected()'>Delete Selected</button>
184             </div>
185         </div>
186         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
187             <table  jsId="phsListGrid"
188                     dojoType="openils.widget.AutoGrid"
189                     fieldOrder="['id', 'provider', 'name', 'subfield']"
190                     query="{id: '*'}"
191                     fmClass='acqphsm'
192                     editOnEnter='true'>
193
194             </table>
195         </div>
196     </div>
197 </div>
198 </div>
199 [% END %]
200