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/create.gsp

    r422 r435  
    147147                            <tr class="prop">
    148148                                <td valign="top" class="name">
    149                                     <label for="suppliers">Suppliers:</label>
    150                                 </td>
    151                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliers','errors')}">
    152                                     <g:select id="suppliers" name="suppliers"
    153                                                         from="${ Supplier.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
     149                                    <label for="preferredSupplier">Preferred Supplier:</label>
     150                                </td>
     151                                <td valign="top">
     152                                    <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
     153
     154                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
     155                                </td>
     156                            </tr>
     157                       
     158                            <tr class="prop">
     159                                <td valign="top" class="name">
     160                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
     161                                </td>
     162                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
     163                                    <g:select id="alternateSuppliers" name="alternateSuppliers"
     164                                                        from="${suppliers}"
    154165                                                        size="5" multiple="yes" optionKey="id"
    155                                                         value="${inventoryItemInstance?.suppliers?.id}" noSelection="['':'--None--']"/>
    156 
    157                                 <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
     166                                                        value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
    158167                                </td>
    159168                            </tr>
     
    170179                            <tr class="prop">
    171180                                <td valign="top" class="name">
    172                                     <label for="manufacturers">Manufacturers:</label>
    173                                 </td>
    174                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturers','errors')}">
    175                                     <g:select id="manufacturers" name="manufacturers"
    176                                                         from="${ Manufacturer.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
     181                                    <label for="preferredManufacturer">Preferred Manufacturer:</label>
     182                                </td>
     183                                <td valign="top">
     184                                    <g:select optionKey="id" from="${manufacturers}" name="preferredManufacturer.id" value="${inventoryItemInstance?.preferredManufacturer?.id}" noSelection="['null':'--None--']"></g:select>
     185
     186                                    <p><g:link controller="manufacturerDetailed" action="create">+Add Manufacturer</g:link></p>
     187                                </td>
     188                            </tr>
     189                       
     190                            <tr class="prop">
     191                                <td valign="top" class="name">
     192                                    <label for="manufacturers">Alternate Manufacturers:</label>
     193                                </td>
     194                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateManufacturers','errors')}">
     195                                    <g:select id="alternateManufacturers" name="alternateManufacturers"
     196                                                        from="${manufacturers}"
    177197                                                        size="5" multiple="yes" optionKey="id"
    178                                                         value="${inventoryItemInstance?.manufacturers?.id}" noSelection="['':'--None--']" />
    179 
    180                                     <p><g:link controller="manufacturerDetailed" action="create">+Add Manufacturer</g:link></p>
     198                                                        value="${inventoryItemInstance.alternateManufacturers?.id}" noSelection="['':'--None--']" />
    181199                                </td>
    182200                            </tr>
Note: See TracChangeset for help on using the changeset viewer.