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         <table  jsId="pListGrid"
30                 dojoType="openils.widget.AutoGrid"
31                 fieldOrder="['id', 'name', 'code', 'owner', 'currency_type']"
32                 query="{id: '*'}"
33                 defaultCellWidth='"auto"'
34                 fmClass='acqpro'
35                 showPaginator='true'
36                 editOnEnter='true'>
37             <thead>
38                 <tr><th field='name' get='getProviderName' formatter='formatName'/></tr>
39             </thead>
40         </table>
41     </div>
42 </div>
43
44 <div id='provider-summary-pane'></div>     
45 <div id='provider-details-div' style='height:600px'>
46 <div dojoType="dijit.layout.TabContainer" style='height:100%' jsId='providerTabs'>
47
48     <div dojoType="dijit.layout.ContentPane" title='Provider Address' select='true' id='provider-address'>
49         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
50             <div>Provider Address</div>
51             <div>
52             <button dojoType='dijit.form.Button' onClick='paListGrid.showCreateDialog()'>New Provider Address</button>
53             <button dojoType='dijit.form.Button' onClick='paListGrid.deleteSelected()'>Delete Selected</button>
54             </div>
55         </div>
56         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:100px'>
57             <table  jsId="paListGrid"
58                     dojoType="openils.widget.AutoGrid"
59                     fieldOrder="['id', 'address_type', 'provider', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
60                     requiredFields="['street1', 'city', 'state', 'country', 'post_code']"
61                     query="{id: '*'}"
62                     fmClass='acqpa'
63                     defaultCellWidth='"auto"' 
64                     editOnEnter='true'>
65             </table>
66         </div>
67     </div>
68
69     <div dojoType="dijit.layout.ContentPane" title='Provider Contact' id='tab-pro-contact'>
70         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
71             <div>Provider Contact</div>
72             <div>
73             <button dojoType='dijit.form.Button' onClick='pcListGrid.showCreateDialog()'>New Contact</button>
74             <button dojoType='dijit.form.Button' onClick='pcListGrid.deleteSelected()'>Delete Selected</button>
75             </div>
76         </div>
77         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
78             <table  jsId="pcListGrid"
79                     dojoType="openils.widget.AutoGrid"
80                     fieldOrder="['id', 'name', 'provider', 'role', 'email']"
81                     requiredFields="['name']"
82                     defaultCellWidth='"auto"'
83                     query="{id: '*'}"
84                     fmClass='acqpc'
85                     editOnEnter='true'>
86             </table>
87         </div>
88       
89         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
90             <div>Contact Address</div>
91             <div>
92                 <button dojoType='dijit.form.Button' onClick='pcaListGrid.showCreateDialog()'>New Contact Address</button>
93                 <button dojoType='dijit.form.Button' onClick='pcaListGrid.deleteSelected()'>Delete Selected</button>
94             </div>
95         </div>
96         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
97             <table  jsId="pcaListGrid"
98                     dojoType="openils.widget.AutoGrid"
99                     fieldOrder="['id', 'address_type', 'contact', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
100                     requiredFields="['street1', 'city', 'state', 'country', 'post_code']"
101                     query="{id: '*'}"
102                     fmClass='acqpca'
103                     defaultCellWidth='"auto"' 
104                     editOnEnter='true'>
105             </table>
106         </div>
107        
108     </div>
109     <div dojoType="dijit.layout.ContentPane" title='Attribute Definitions' id='tab-attr'>
110         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
111             <div> Attribute Definitions</div>
112             <div>
113                 <button dojoType='dijit.form.Button' onClick='padListGrid.showCreateDialog()'>New Attribute Definition</button>
114                 <button dojoType='dijit.form.Button' onClick='padListGrid.deleteSelected()'>Delete Selected</button>
115             </div>
116         </div>
117         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
118             <table  jsId="padListGrid"
119                     dojoType="openils.widget.AutoGrid"
120                     fieldOrder="['id', 'provider', 'code', 'description',  'provider', 'ident', 'remove',  'tag', 'subfield', 'xpath']"
121                     requiredFields="['code', 'description', 'xpath']"
122                     query="{id: '*'}"
123                     fmClass='acqlipad'
124                     editOnEnter='true'>
125                 <thead>
126                     <tr>
127                         <th field="xpath" width='auto'/>
128                         <th field="tag" name="Tag" get='getParsedTag'/>
129                         <th field="subfield" name="Subfield" get='getParsedSubf'/>
130                     </tr>
131                 </thead>
132             </table>
133         </div>
134     </div>
135
136     <div dojoType="dijit.layout.ContentPane" title='Holding Subfield' id='tab-hold'>
137         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
138             <div>Holding Subfield</div>
139             <div>
140             <button dojoType='dijit.form.Button' onClick='phsListGrid.showCreateDialog()'>New Holding Subfield</button>
141             <button dojoType='dijit.form.Button' onClick='phsListGrid.deleteSelected()'>Delete Selected</button>
142             </div>
143         </div>
144         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:400px'>
145             <table  jsId="phsListGrid"
146                     dojoType="openils.widget.AutoGrid"
147                     fieldOrder="['id', 'provider', 'name', 'subfield']"
148                     requiredFields="['name', 'subfield']"
149                     query="{id: '*'}"
150                     fmClass='acqphsm'
151                     editOnEnter='true'>
152             </table>
153         </div>
154     </div>
155
156     <div dojoType="dijit.layout.ContentPane" title="Invoices" id="tab-invoice">
157         <big class="oils-acq-basic-roomy"><strong>Invoices</strong></big>
158         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style="height:400px">
159             <table jsId="invListGrid"
160                 dojoType="openils.widget.AutoGrid"
161                 fieldOrder="['inv_ident', 'receiver', 'shipper']"
162                 suppressFields="['id', 'provider']"
163                 query="{id: '*'}"
164                 showPaginator='true'
165                 fmClass="acqinv">
166                 <thead>
167                     <tr>
168                         <th field="inv_ident" get="getInvIdent" formatter="formatInvIdent" />
169                     </tr>
170                 </thead>
171             </table>
172         </div>
173     </div>
174 </div>
175 </div>
176
177 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/provider.js'> </script>
178
179 <script type="text/javascript"> 
180     var providerId = '[% ctx.page_args.0 %]';
181
182 function getInvIdent(rowIndex, item) {
183     if (!item) return {};
184     return {
185           "id": this.grid.store.getValue(item, "id"),
186         "name": this.grid.store.getValue(item, "inv_ident")
187     };
188 }
189
190 function formatInvIdent(o) {
191     return "<a href='" + oilsBasePath + "/acq/invoice/view/" + o.id + "'>" + o.name + "</a>";
192 }
193
194 function getProviderName(rowIndex, item) {
195     if(!item) return '';
196     var name = this.grid.store.getValue(item, 'name');
197     var id   = this.grid.store.getValue(item, 'id');
198     return id + ':' + name;
199 }
200
201 function formatName(value) {
202     if(value) {
203         var vals = value.split(/:/);
204         return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
205     }
206 }
207
208 </script>
209
210 [% END %]
211