- Timestamp:
- Feb 18, 2010, 3:50:42 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemDetailedController.groovy
r375 r382 13 13 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) 14 14 def index = { redirect(action:search, params:params) } 15 16 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])17 def list = {18 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100)19 [ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count() ]20 }21 15 22 16 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) -
trunk/grails-app/views/inventoryItemDetailed/create.gsp
r223 r382 49 49 </td> 50 50 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}"> 51 <g:select optionKey="id" from="${InventoryLocation.list()}" name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" ></g:select> 51 <g:select optionKey="id" 52 from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }" 53 name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" > 54 </g:select> 55 56 <p><g:link controller="inventoryLocationDetailed" action="create">add Location</g:link></p> 52 57 </td> 53 58 </tr> … … 61 66 type="text" id="reorderPoint" name="reorderPoint" 62 67 value="${fieldValue(bean:inventoryItemInstance,field:'reorderPoint')}" /> 63 <g:select optionKey="id" from="${UnitOfMeasure.list()}" name="unitOfMeasure.id" value="${inventoryItemInstance?.unitOfMeasure?.id}" ></g:select> 68 <g:select optionKey="id" 69 from="${UnitOfMeasure.list()}" 70 name="unitOfMeasure.id" 71 value="${inventoryItemInstance?.unitOfMeasure?.id}" > 72 </g:select> 64 73 </td> 65 74 </tr> … … 80 89 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}"> 81 90 <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></g:select> 91 92 <p><g:link controller="inventoryGroupDetailed" action="create">add Group</g:link></p> 82 93 </td> 83 94 </tr> … … 119 130 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliers','errors')}"> 120 131 <g:select id="suppliers" name="suppliers" 121 from="${ Supplier.list()}"132 from="${ Supplier.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 122 133 size="5" multiple="yes" optionKey="id" 123 134 value="${inventoryItemInstance?.suppliers?.id}" noSelection="['':'--None--']"/> 124 135 136 <p><g:link controller="supplierDetailed" action="create">add Supplier</g:link></p> 125 137 </td> 126 138 </tr> … … 141 153 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturers','errors')}"> 142 154 <g:select id="manufacturers" name="manufacturers" 143 from="${ Manufacturer.list()}"155 from="${ Manufacturer.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 144 156 size="5" multiple="yes" optionKey="id" 145 157 value="${inventoryItemInstance?.manufacturers?.id}" noSelection="['':'--None--']" /> 146 158 159 <p><g:link controller="manufacturerDetailed" action="create">add Manufacturer</g:link></p> 147 160 </td> 148 161 </tr> -
trunk/grails-app/views/inventoryItemDetailed/edit.gsp
r223 r382 80 80 </td> 81 81 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}"> 82 <g:select optionKey="id" from="${InventoryLocation.list()}" name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" ></g:select> 82 <g:select optionKey="id" 83 from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }" 84 name="inventoryLocation.id" 85 value="${inventoryItemInstance?.inventoryLocation?.id}" > 86 </g:select> 83 87 </td> 84 88 </tr> … … 141 145 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'averageDeliveryTime','errors')}"> 142 146 <input type="text" id="averageDeliveryTime" name="averageDeliveryTime" value="${fieldValue(bean:inventoryItemInstance,field:'averageDeliveryTime')}" /> 143 <g:select optionKey="id" from="${Period.list()}" name="averageDeliveryPeriod.id" value="${inventoryItemInstance?.averageDeliveryPeriod?.id}" noSelection="['null':'--None--']"></g:select> 147 <g:select optionKey="id" 148 from="${Period.list()}" 149 name="averageDeliveryPeriod.id" 150 value="${inventoryItemInstance?.averageDeliveryPeriod?.id}" 151 noSelection="['null':'--None--']"> 152 </g:select> 144 153 </td> 145 154 </tr> … … 160 169 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliers','errors')}"> 161 170 <g:select id="suppliers" name="suppliers" 162 from="${ Supplier.list()}"171 from="${ Supplier.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 163 172 size="5" multiple="yes" optionKey="id" 164 173 value="${inventoryItemInstance?.suppliers.id}" noSelection="['':'--None--']"/> 165 174 175 <p><g:link controller="supplierDetailed" action="create">add Supplier</g:link></p> 166 176 </td> 167 177 </tr> … … 182 192 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturers','errors')}"> 183 193 <g:select id="manufacturers" name="manufacturers" 184 from="${ Manufacturer.list()}"194 from="${ Manufacturer.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 185 195 size="5" multiple="yes" optionKey="id" 186 196 value="${inventoryItemInstance?.manufacturers.id}" noSelection="['':'--None--']"/> 197 198 <p><g:link controller="manufacturerDetailed" action="create">add Manufacturer</g:link></p> 187 199 </td> 188 200 </tr> … … 194 206 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}"> 195 207 <g:select name="spareFor" 196 from="${ Asset.list()}"197 size="5" multiple="yes" optionKey="id" 198 value="${inventoryItemInstance?.spareFor }" noSelection="['':'--None--']"/>208 from="${ Asset.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 209 size="5" multiple="yes" optionKey="id" 210 value="${inventoryItemInstance?.spareFor.id}" noSelection="['':'--None--']"/> 199 211 200 212 </td> … … 207 219 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateItems','errors')}"> 208 220 <g:select name="alternateItems" 209 from="${ InventoryItem.list()}"210 size="5" multiple="yes" optionKey="id" 211 value="${inventoryItemInstance?.alternateItems }" noSelection="['':'--None--']"/>221 from="${ InventoryItem.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 222 size="5" multiple="yes" optionKey="id" 223 value="${inventoryItemInstance?.alternateItems.id}" noSelection="['':'--None--']"/> 212 224 213 225 </td> -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r226 r382 133 133 ${inventoryItemInstance.inventoryLocation?.encodeAsHTML()} 134 134 </g:link> 135 in ${inventoryItemInstance.inventoryLocation?.inventoryStore.encodeAsHTML()}136 135 </td> 137 136 </tr> … … 160 159 <td valign="top" style="text-align:left;" class="value"> 161 160 <ul> 162 <g:each var="s" in="${ inventoryItemInstance.spareFor}">161 <g:each var="s" in="${ inventoryItemInstance.spareFor.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"> 163 162 <li><g:link controller="assetDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 164 163 </g:each> … … 235 234 <td valign="top" style="text-align:left;" class="value"> 236 235 <ul> 237 <g:each var="s" in="${ inventoryItemInstance.suppliers}">236 <g:each var="s" in="${ inventoryItemInstance.suppliers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"> 238 237 <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 239 238 </g:each> … … 260 259 <td valign="top" style="text-align:left;" class="value"> 261 260 <ul> 262 <g:each var="m" in="${ inventoryItemInstance.manufacturers}">261 <g:each var="m" in="${ inventoryItemInstance.manufacturers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"> 263 262 <li><g:link controller="manufacturerDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li> 264 263 </g:each>
Note: See TracChangeset
for help on using the changeset viewer.