Index: trunk/grails-app/views/inventoryItemDetailed/edit.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 720)
+++ trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 727)
@@ -28,9 +28,32 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">Picture:</td>
+                                <td valign="top" class="groupHeader">
+                                    <label>Inventory Item</label>
+                                </td>
+                                <td valign="top" class="value">
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'name','errors')}">
+                                    <input type="text"
+                                                class="description"
+                                                maxlength="50"
+                                                id="name"
+                                                name="name"
+                                                value="${fieldValue(bean:inventoryItemInstance,field:'name')}"/>
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.name" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">Picture:</td>
                                 <td valign="top" class="value">
                                     <g:if test="${inventoryItemInstance.picture}" >
                                         <span class='gallery'>
-                                            <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" />
+                                            <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Small}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" />
                                         </span>
                                         <br />
@@ -43,17 +66,5 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="name">Name:</label>
-                                </td>
-                                <td valign="top">
-                                    <input class="description ${hasErrors(bean:inventoryItemInstance,field:'name','errors')}"
-                                                type="text" maxlength="50" id="name" name="name"
-                                                value="${fieldValue(bean:inventoryItemInstance,field:'name')}"/>
-                                    <g:helpBalloon class="helpballoon" code="inventory.item.name" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="description">Description:</label>
                                 </td>
@@ -65,5 +76,5 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="comment">Comment:</label>
                                 </td>
@@ -75,5 +86,5 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="unitsInStock">In Stock:</label>
                                 </td>
@@ -85,10 +96,10 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="inventoryLocation">Location:</label>
                                 </td>
                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
                                     <g:select optionKey="id"
-                                                        from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
+                                                        from="${ InventoryLocation.findAllByIsActive(true).sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
                                                         name="inventoryLocation.id"
                                                         value="${inventoryItemInstance?.inventoryLocation?.id}"
@@ -100,5 +111,41 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
+                                    <label for="inventoryGroup">Inventory Group:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
+                                    <g:select optionKey="id"
+                                                        from="${InventoryGroup.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
+                                                        name="inventoryGroup.id"
+                                                        value="${inventoryItemInstance?.inventoryGroup?.id}" >
+                                    </g:select>
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.group" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
+                                    <label for="inventoryType">Inventory Type:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
+                                    <g:select optionKey="id"
+                                                        from="${InventoryType.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
+                                                        name="inventoryType.id"
+                                                        value="${inventoryItemInstance?.inventoryType?.id}" >
+                                    </g:select>
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupHeader">
+                                    <label for="name">Reorder Details</label>
+                                </td>
+                                <td valign="top" class="value">
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
                                     <label for="isActive">Active:</label>
                                 </td>
@@ -110,5 +157,25 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
+                                    <label for="isObsolete">Obsolete:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
+                                    <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.is.obsolete" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
+                                    <label for="enableReorderListing">Enable Reorder Listing:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
+                                    <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
                                     <label for="reorderPoint">Reorder Point:</label>
                                 </td>
@@ -123,5 +190,5 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="reorderQuantity">Reorder Quantity:</label>
                                 </td>
@@ -136,25 +203,5 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="enableReorderListing">Enable Reorder Listing:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
-                                    <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
-                                    <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="isObsolete">Obsolete:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
-                                    <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
-                                    <g:helpBalloon class="helpballoon" code="inventory.item.is.obsolete" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="estimatedUnitPriceAmount">Estimated Unit Price:</label>
                                 </td>
@@ -172,9 +219,9 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="suppliersPartNumber">Suppliers Part Number:</label>
                                 </td>
                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
-                                    <input type="text" id="suppliersPartNumber" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
+                                    <input type="text" id="suppliersPartNumber" maxlength="50" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
                                     <g:helpBalloon class="helpballoon" code="inventory.item.suppliers.part.number" />
                                 </td>
@@ -182,9 +229,14 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="preferredSupplier">Preferred Supplier:</label>
                                 </td>
                                 <td valign="top">
-                                    <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
+                                    <g:select optionKey="id"
+                                                    from="${suppliers}"
+                                                    name="preferredSupplier.id"
+                                                    value="${inventoryItemInstance.preferredSupplier?.id}"
+                                                    noSelection="['null':'--None--']">
+                                    </g:select>
                                     <g:helpBalloon class="helpballoon" code="inventory.item.preferred.supplier" />
                                     <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
@@ -193,46 +245,41 @@
 
                             <tr class="prop">
-                                <td valign="top" class="name">
+                                <td valign="top" class="groupName">
                                     <label for="alternateSuppliers">Alternate Suppliers:</label>
                                 </td>
                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
-                                    <g:select id="alternateSuppliers" name="alternateSuppliers"
-                                                        from="${suppliers}"
-                                                        size="5" multiple="yes" optionKey="id"
-                                                        value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
                                     <g:helpBalloon class="helpballoon" code="inventory.item.alternate.suppliers" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="spareFor">Spare For:</label>
+                                    <custom:checkBoxList name="alternateSuppliers"
+                                                                    from="${suppliers}"
+                                                                    value="${inventoryItemInstance?.alternateSuppliers?.collect{it.id}}"
+                                                                    optionKey="id"
+                                                                    linkController="supplierDetailed"
+                                                                    linkAction="show"/>
+                                    <g:link controller="supplierDetailed" action="create">+Add Supplier</g:link>
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupHeader">
+                                    <label for="name">Spare For</label>
+                                </td>
+                                <td valign="top" class="value">
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="groupName">
+                                    <label for="spareFor">Assets:</label>
                                 </td>
                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}">
-                                    <g:select name="spareFor"
-                                                        from="${ Asset.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
-                                                        size="5" multiple="yes" optionKey="id"
-                                                        value="${inventoryItemInstance?.spareFor.id}" noSelection="['':'--None--']"/>
-
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="inventoryGroup">Inventory Group:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
-                                    <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></g:select>
-                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.group" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="inventoryType">Inventory Type:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
-                                    <g:select optionKey="id" from="${InventoryType.list()}" name="inventoryType.id" value="${inventoryItemInstance?.inventoryType?.id}" ></g:select>
-                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
+                                    <g:helpBalloon class="helpballoon" code="inventory.item.spare.for" />
+                                    <custom:checkBoxList name="spareFor"
+                                                                    from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
+                                                                    value="${inventoryItemInstance?.spareFor?.collect{it.id}}"
+                                                                    optionKey="id"
+                                                                    sortBy="name"
+                                                                    linkController="assetDetailed"
+                                                                    linkAction="show"/>
+                                    <g:link controller="assetDetailed" action="create">+Add Asset</g:link>
                                 </td>
                             </tr>
