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