source: trunk/grails-app/views/inventoryItemDetailed/search.gsp @ 468

Last change on this file since 468 was 468, checked in by gav, 14 years ago

Add inventory item purchase search view and logic.

File size: 11.4 KB
Line 
1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
7        <title>InventoryItem Search</title>
8        <nav:resources override="true"/>
9        <g:render template="/shared/pictureHead" />
10        <filterpane:includes />
11        <export:resource />
12    </head>
13    <body>
14        <div class="nav">
15            <nav:renderSubItems group="nav"/>
16        </div>
17        <div class="body">
18            <g:render template="/shared/messages" />
19            <filterpane:currentCriteria domainBean="InventoryItem"
20                                    action="search"
21                                    dateFormat="EEE, dd-MMM-yyyy"
22                                    removeImgDir="images"
23                                    removeImgFile="bullet_delete.png"
24                                    title="Search"/>
25
26            <div class="paginateButtons">
27                <span class="searchButtons">
28                    <a href='' onclick="showElement('searchPane'); return false;">Quick</a>
29                </span>
30                Results: ${inventoryItemInstanceList.size()} / ${inventoryItemInstanceTotal}
31                <span class="searchButtons">
32                    <filterpane:filterButton text="Search" appliedText="Change Search" />
33                </span>
34            </div>
35
36            <jsUtil:toggleControl toggleId="options"
37                                                    imageId="optionsImg"
38                                                    closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}"
39                                                    openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}"
40                                                    text="${g.message(code: 'default.options.text')}"
41                                                    />
42
43            <div id="options" style="display:none;">
44                <g:form method="post" >
45                    <g:hiddenField name="params" value="${filterParams}" />
46                    <div class="dialog">
47                        <table>
48                            <tbody>
49
50                                <tr class="prop">
51                                    <td valign="top" class="name">
52                                        <label for="max">Results per page:</label>
53                                    </td>
54                                    <td valign="top" class="value">
55                                        <input type="text" maxlength="4" id="description" name="newMax" value="${params.max}"/>
56
57                                        <span class="buttons">
58                                            <g:actionSubmit action="setSearchParamsMax" class="go" value="Update" />
59                                        </span>
60                                    </td>
61                                </tr>
62
63                                <tr class="prop">
64                                    <td valign="top" class="name">
65                                        <label for="max">Inventory:</label>
66                                    </td>
67                                    <td valign="top" class="value">
68                                        <g:link action="exportInventory">
69                                            Export
70                                        </g:link>
71                                        /
72                                        <g:link action="exportInventoryTemplate">
73                                            Template
74                                        </g:link>
75                                        /
76                                        <g:link action="exportInventoryExample">
77                                            Example
78                                        </g:link>
79                                        /
80                                        <g:link action="importInventory">
81                                            Import Inventory
82                                        </g:link>
83                                        /
84                                        <g:link action="importInventoryItemPurchases">
85                                            Import Purchases
86                                        </g:link>
87                                    </td>
88                                </tr>
89
90                            </tbody>
91                        </table>
92                    </div>
93                </g:form>
94                <export:formats  params="${filterParams}" formats="['csv', 'excel', 'pdf', 'rtf']"/>
95            </div>
96
97            <br />
98
99            <g:if test="${inventoryItemInstanceList.size() > 10}">
100                <g:if test="${inventoryItemInstanceTotal > inventoryItemInstanceList.size()}">
101                    <div class="paginateButtons">
102                        <g:paginate total="${inventoryItemInstanceTotal}" params="${filterParams}" />
103                    </div>
104                </g:if>
105            </g:if>
106
107            <g:if test="${inventoryItemInstanceList.size() > 0}">
108                <div class="list">
109                    <table>
110                        <thead>
111                            <tr>
112
113                                <th>Picture</th>
114                           
115                                <g:sortableColumn property="name" title="Name" params="${filterParams}" />
116                           
117                                <g:sortableColumn property="description" title="Description" params="${filterParams}" />
118                           
119                                <g:sortableColumn property="unitsInStock" title="Units In Stock" params="${filterParams}" />
120                               
121                                <th>Unit Of Measure</th>
122
123                                <th></th>
124                           
125                            </tr>
126                        </thead>
127                        <tbody>
128                        <g:each in="${inventoryItemInstanceList}" status="i" var="inventoryItemInstance">
129                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" />
130
131                                <td class='gallery'>
132                                    <g:if test="${inventoryItemInstance.picture}" >
133                                        <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}"
134                                                                                            size="${Image.Small}"
135                                                                                            lightboxSize="${Image.Large}"
136                                                                                            target="_blank"
137                                                                                            title="Show Original" />
138                                    </g:if>
139                                </td>
140                           
141                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
142                                    ${fieldValue(bean:inventoryItemInstance, field:'name')}
143                                </td>
144                           
145                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
146                                    ${fieldValue(bean:inventoryItemInstance, field:'description')}
147                                </td>
148                           
149                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
150                                    ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')}
151                                </td>
152                           
153                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
154                                    ${fieldValue(bean:inventoryItemInstance, field:'unitOfMeasure')}
155                                </td>
156
157                                <td>
158                                    <g:link action="show" id="${inventoryItemInstance.id}">
159                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
160                                    </g:link>
161                                </td>
162                           
163                            </tr>
164                        </g:each>
165                        </tbody>
166                    </table>
167                </div>
168            </g:if>
169            <div class="paginateButtons">
170                <g:paginate total="${inventoryItemInstanceTotal}" params="${filterParams}" />
171            </div>
172
173            <filterpane:filterPane domainBean="InventoryItem"
174                                    title="Search"
175                                    action="search"
176                                    class="overlayPane"
177                                    excludeProperties="estimatedUnitPriceCurrency,
178                                                                    averageDeliveryTime"
179                                    associatedProperties="inventoryLocation.name,
180                                                                            spareFor.name,
181                                                                            preferredManufacturer.name,
182                                                                            preferredSupplier.name"
183                                    filterPropertyValues="${['inventoryLocation.name':[values:InventoryLocation.list()],
184                                                                                'spareFor.name':[values:Asset.list()],
185                                                                                'preferredManufacturer.name':[values:Manufacturer.findAllByIsActive(true)],
186                                                                                'preferredSupplier.name':[values:Supplier.findAllByIsActive(true)],
187                                                                                ]}"/>
188        </div> <!-- end body div -->
189
190        <!-- Start Search Pane -->
191        <div class="overlayPane" id="searchPane" style="display:none;">
192            <h2>Quick Search</h2>
193            <g:form method="post" id="searchForm" name="searchForm" >
194                <table>
195                    <tbody>
196
197                        <tr class="prop">
198                            <td valign="top" class="name">
199                                <label>Links:</label>
200                            </td>
201                            <td valign="top" class="value">
202                                <g:link controller="inventoryItemPurchaseDetailed"
203                                                action="search">
204                                                Purchases
205                                </g:link>
206                                <br />
207                            </td>
208                        </tr>
209
210                    </tbody>
211                </table>
212                <div class="buttons">
213                    <span class="button">
214                        <input type="button" value="${g.message(code:'fp.tag.filterPane.button.cancel.text', default:'Cancel')}" onclick="return hideElement('searchPane');" />
215                    </span>
216                </div>
217            </g:form>
218        </div> <!-- end search pane -->
219
220    </body>
221</html>
Note: See TracBrowser for help on using the repository browser.