Ignore:
Timestamp:
Mar 8, 2010, 10:58:13 AM (14 years ago)
Author:
gav
Message:

Change InventoryItem to have a preferred and many alternate suppliers and manufacturers.
Controllers and views updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/inventoryItemDetailed/edit.gsp

    r425 r435  
    184184                            <tr class="prop">
    185185                                <td valign="top" class="name">
    186                                     <label for="suppliers">Suppliers:</label>
    187                                 </td>
    188                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliers','errors')}">
    189                                     <g:select id="suppliers" name="suppliers"
    190                                                         from="${ Supplier.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
    191                                                         size="5" multiple="yes" optionKey="id"
    192                                                         value="${inventoryItemInstance?.suppliers.id}" noSelection="['':'--None--']"/>
    193 
    194                                 <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
     186                                    <label for="preferredSupplier">Preferred Supplier:</label>
     187                                </td>
     188                                <td valign="top">
     189                                    <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
     190
     191                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
     192                                </td>
     193                            </tr>
     194
     195                            <tr class="prop">
     196                                <td valign="top" class="name">
     197                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
     198                                </td>
     199                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
     200                                    <g:select id="alternateSuppliers" name="alternateSuppliers"
     201                                                        from="${suppliers}"
     202                                                        size="5" multiple="yes" optionKey="id"
     203                                                        value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
    195204                                </td>
    196205                            </tr>
     
    207216                            <tr class="prop">
    208217                                <td valign="top" class="name">
    209                                     <label for="manufacturers">Manufacturers:</label>
    210                                 </td>
    211                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturers','errors')}">
    212                                     <g:select id="manufacturers" name="manufacturers"
    213                                                         from="${ Manufacturer.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
    214                                                         size="5" multiple="yes" optionKey="id"
    215                                                         value="${inventoryItemInstance?.manufacturers.id}" noSelection="['':'--None--']"/>
     218                                    <label for="preferredManufacturer">Preferred Manufacturer:</label>
     219                                </td>
     220                                <td valign="top">
     221                                    <g:select optionKey="id" from="${manufacturers}" name="preferredManufacturer.id" value="${inventoryItemInstance.preferredManufacturer?.id}" noSelection="['null':'--None--']"></g:select>
    216222
    217223                                    <p><g:link controller="manufacturerDetailed" action="create">+Add Manufacturer</g:link></p>
     224                                </td>
     225                            </tr>
     226
     227                            <tr class="prop">
     228                                <td valign="top" class="name">
     229                                    <label for="manufacturers">Alternate Manufacturers:</label>
     230                                </td>
     231                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateManufacturers','errors')}">
     232                                    <g:select id="alternateManufacturers" name="alternateManufacturers"
     233                                                        from="${manufacturers}"
     234                                                        size="5" multiple="yes" optionKey="id"
     235                                                        value="${inventoryItemInstance.alternateManufacturers?.id}" noSelection="['':'--None--']" />
    218236                                </td>
    219237                            </tr>
Note: See TracChangeset for help on using the changeset viewer.