Changeset 817


Ignore:
Timestamp:
Feb 21, 2011, 8:57:41 PM (9 years ago)
Author:
gav
Message:

Display the machines assigned to a tasks procedure, on both the task show and asset life plan views.

Location:
trunk/grails-app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/CustomTagLib.groovy

    r808 r817  
    278278
    279279    /**
     280    * Get a list of the machines assigned on a taskProcedureRevision.
     281    *
     282    * Fields:
     283    *  taskProcedureRevision - TaskProcedureRevision to use.
     284    *
     285    * Example:
     286    * <!--
     287    * <custom:taskProcedureMachines taskProcedureRevision="${taskInstance.taskProcedureRevision}" />
     288    * -->
     289    */
     290    def taskProcedureMachines = {attrs ->
     291        def taskProcedureRevision = attrs.taskProcedureRevision
     292        def machines = taskProcedureRevision.maintenanceActions.collect {it.assetSubItem.parentItem}.unique()
     293        out << machines.encodeAsHTML()
     294    }
     295
     296    /**
    280297    * Determine if a supplied string is considered a url or not.
    281298    * The scheme/protocol can be adjusted, file:// has been excluded here.
  • trunk/grails-app/views/assetDetailed/show.gsp

    r749 r817  
    143143                                        ${fieldValue(bean:t, field:'description')}
    144144                                        <br />
     145                                        <g:if test="${t.taskProcedureRevision?.maintenanceActions}" >
     146                                            <custom:taskProcedureMachines taskProcedureRevision="${t.taskProcedureRevision}" />
     147                                            <br />
     148                                        </g:if>
    145149                                        <g:if test="${t.safetyRequirement}" >
    146150                                            <img  src="${resource(dir:'images/skin',file:'lightning.png')}" alt="Safety Requirement" title="Safety Requirement" />
  • trunk/grails-app/views/taskDetailed/search.gsp

    r799 r817  
    150150                                    ${fieldValue(bean:taskInstance, field:'description')}
    151151                                    </b>
     152                                    <g:if test="${taskInstance.taskProcedureRevision?.maintenanceActions}" >
     153                                        <br />
     154                                        <custom:taskProcedureMachines taskProcedureRevision="${taskInstance.taskProcedureRevision}" />
     155                                    </g:if>
    152156                                    <g:if test="${taskInstance.safetyRequirement}" >
    153157                                        <br />
Note: See TracChangeset for help on using the changeset viewer.