]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/acq/po/search.tt2
Add an "virtual PO" view of PO search results in the Acquisitions module.
[working/Evergreen.git] / Open-ILS / web / templates / default / acq / po / search.tt2
1 [% WRAPPER default/base.tt2 %]
2 [% ctx.page_title = 'Purchase Orders' %]
3 <div id='oils-acq-list-header' class='container'>
4     <div id='oils-acq-list-header-label'>PO Search</div>
5 </div>
6
7 <div id="oils-acq-po-heading-template" class="hidden">
8     <span>Purchase Order: <a attr="name"></a></span>
9     <span>Total Lineitems: <span attr="lineitem_count"></span></span>
10     <span>Total Encumbered: $<span attr="amount_encumbered"></span></span>
11     <span>Total Spent: $<span attr="amount_spent"></span></span>
12     <span>Total Copies: <span attr="copies"></span></span>
13     <span>Status: <span attr="state"></span></span>
14     <span><a class="hidden" attr="activator" href="javascript:void(0);">Activate Order</a></span>
15 </div>
16 <!-- load the page-specific JS -->
17 <script src='[% ctx.media_prefix %]/js/ui/default/acq/po/search.js'> </script>
18
19 <script>
20     function formatId(id) {
21         if(id) return '<a href="[% ctx.base_path %]/acq/po/view/' + id + '">'+id;
22     }
23 </script>
24
25
26 <form dojoType='dijit.form.Form' action='' method='' id='oils-acq-po-search-form'>
27
28     <script type="dojo/method" event="onSubmit">
29         doSearch(this.getValues());
30         return false; /* don't redirect */
31     </script>
32
33     <div class='oils-acq-basic-form-div'>
34
35         <label for='id'>ID</label>
36         <input dojoType='dijit.form.NumberTextBox' name='id'> </input>
37
38         <label for='provider'>Provider</label>
39         <input id='po-search-provider-selector'/>
40
41         <label for='state'>State</label></td>
42         <script>
43             var stateStore = new dojo.data.ItemFileReadStore({
44                 data : {
45                     identifier:"value",
46                     label: "name",
47                     items: [
48                         /* FIXME This is probably not the correct final list of 
49                         possible states */
50                         {name:"New", value:'new'},
51                         {name:"In Process", value:'in-process'},
52                         {name:"Pending", value:'pending'},
53                         {name:"On order", value:'on-order'}
54                     ]
55                 }
56             });
57         </script>
58         <input dojoType='dijit.form.FilteringSelect' 
59             name='state' 
60             required='false' 
61             store='stateStore' 
62             labelAttr='name' 
63             valueAttr='value' 
64             searchAttr='name'/>
65
66         <label for='ordering_agency'>Ordering Agency</label>
67         <input id='po-search-agency-selector'/>
68
69         <span dojoType='dijit.form.Button' type='submit'>Search</span>
70     </div>
71     <div class="oils-acq-basic-form-div">
72         <input dojoType="dijit.form.CheckBox" value="1" name="metapo_view"
73             id="metapo_view" type="checkbox" />
74         <label for="metapo_view">Show results as a virtual combined PO</label>
75     </div>
76 </form>
77 <br/>
78 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id="holds_po_grid">
79     <table 
80             id="po-grid" 
81             autoHeight='true'
82             jsId="poGrid" 
83             dojoType="openils.widget.AutoGrid" 
84             query="{id: '*'}" 
85             fieldOrder="['id', 'owner', 'ordering_agency', 'provider', 'create_time', 'edit_time', 'state']"
86             suppressFields="['owner', 'editor', 'creator']"
87             query="{id: '*'}"
88             defaultCellWidth='"auto"'
89             showSequenceFields='true'
90             showPaginator='true'
91             fmClass='acqpo'> 
92         <thead> 
93             <tr> 
94                 <th field="id" formatter='formatId'>ID</th> 
95                 <!--
96                 <th field="owner" get='getPOOwner'/>
97                 -->
98             </tr> 
99         </thead> 
100     </table>     
101     <div comment='dojo-needs-me'></div>
102 </div>
103 <div id="oils-acq-holds-metapo-summary" class="hidden">
104     <table id="oils-acq-metapo-summary">
105         <thead>
106             <tr>
107                 <th colspan="2">Results Summary</th>
108             </tr>
109         </thead>
110         <tbody>
111             <tr>
112                 <th>Total Purchase Orders:</th>
113                 <td id="oils-acq-metapo-summary-po"></td>
114             </tr>
115             <tr>
116                 <th>Total Lineitems:</th>
117                 <td id="oils-acq-metapo-summary-lineitem_count"></td>
118             </tr>
119             <tr>
120                 <th>Total Copies:</th>
121                 <td id="oils-acq-metapo-summary-copies"></td>
122             </tr>
123             <tr>
124                 <th>Total Encumbered:</th>
125                 <td>$<span id="oils-acq-metapo-summary-amount_encumbered"></span></td>
126             </tr>
127             <tr>
128                 <th>Total Spent:</th>
129                 <td>$<span id="oils-acq-metapo-summary-amount_spent"></span></td>
130             </tr>
131         </tbody>
132     </table>
133 </div>
134 [% INCLUDE 'default/acq/common/li_table.tt2' %]
135 [% END %]