Changeset 442


Ignore:
Timestamp:
Mar 16, 2010, 12:02:09 PM (14 years ago)
Author:
gav
Message:

Small fix to inventory movement list view pagination.

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/InventoryMovementDetailedController.groovy

    r406 r442  
    3333    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
    3434    def listInventoryMovements = {
    35         def inventoryItemInstance = InventoryItem.get(params.inventoryItem.id)
     35        def inventoryItemInstance
     36        if(params.id)
     37            inventoryItemInstance = InventoryItem.get(params.id)
     38        else if(params.inventoryItem?.id)
     39            inventoryItemInstance = InventoryItem.get(params.inventoryItem.id)
    3640
    3741        if(!inventoryItemInstance) {
    3842            flash.message = "Inventory item not found with id ${params.id}"
    3943            redirect(controller:'inventoryItemDetailed', action: 'search')
     44            return
    4045        }
    4146
  • trunk/grails-app/views/inventoryMovementDetailed/listInventoryMovements.gsp

    r224 r442  
    2626                        <tr>
    2727                       
    28                                 <g:sortableColumn action="listInventoryMovements" property="quantity" title="Quantity" />
     28                                <g:sortableColumn action="listInventoryMovements" property="quantity" title="Quantity" params="[id: inventoryItemInstance.id]"/>
    2929                       
    30                                 <g:sortableColumn action="listInventoryMovements"  property="inventoryMovementType" title="Movement Type" />
     30                                <g:sortableColumn action="listInventoryMovements"  property="inventoryMovementType" title="Movement Type" params="[id: inventoryItemInstance.id]" />
    3131                       
    32                             <g:sortableColumn action="listInventoryMovements"  property="date" title="Date" />
     32                            <g:sortableColumn action="listInventoryMovements"  property="date" title="Date" params="[id: inventoryItemInstance.id]" />
    3333                       
    34                                 <g:sortableColumn action="listInventoryMovements"  property="person" title="Person" />
     34                                <g:sortableColumn action="listInventoryMovements"  property="person" title="Person" params="[id: inventoryItemInstance.id]" />
    3535
    3636                            <th></th>
     
    6262            </div>
    6363            <div class="paginateButtons">
    64                 <g:paginate action="listInventoryMovements" id="${inventoryItemInstance?.id}" total="${inventoryMovementListTotal}" />
     64                <g:paginate action="listInventoryMovements" id="${inventoryItemInstance.id}" total="${inventoryMovementListTotal}" />
    6565            </div>
    6666        </div>
Note: See TracChangeset for help on using the changeset viewer.