

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create MaintenanceAction</title>
    </head>
    <body>
        <div class="nav">
            <h1>Create Maintenance Action</h1>
        </div>
        <div class="body">
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${maintenanceActionInstance}">
            <div class="errors">
                <g:renderErrors bean="${maintenanceActionInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="section">Section:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'section','errors')}">
                                    <g:select optionKey="id" from="${Section.list()}" name="section.id" value="${maintenanceActionInstance?.section?.id}" noSelection="['null':'']"></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="asset">Asset:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'asset','errors')}">
                                    <g:select optionKey="id" from="${Asset.list()}" name="asset.id" value="${maintenanceActionInstance?.asset?.id}" noSelection="['null':'']"></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="assetSubItem">Asset Sub Item:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'assetSubItem','errors')}">
                                    <g:select optionKey="id" from="${AssetSubItem.list()}" name="assetSubItem.id" value="${maintenanceActionInstance?.assetSubItem?.id}" noSelection="['null':'']"></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="maintenancePolicy">Maintenance Policy:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'maintenancePolicy','errors')}">
                                    <g:select optionKey="id" from="${MaintenancePolicy.list()}" name="maintenancePolicy.id" value="${maintenanceActionInstance?.maintenancePolicy?.id}" noSelection="['null':'']"></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="procedureStepNumber">Procedure Step Number:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'procedureStepNumber','errors')}">
                                    <input type="text" id="procedureStepNumber" name="procedureStepNumber" value="${fieldValue(bean:maintenanceActionInstance,field:'procedureStepNumber')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description">Description:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'description','errors')}">
                                    <input type="text" id="description" name="description" value="${fieldValue(bean:maintenanceActionInstance,field:'description')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="reasoning">Reasoning:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'reasoning','errors')}">
                                    <input type="text" id="reasoning" name="reasoning" value="${fieldValue(bean:maintenanceActionInstance,field:'reasoning')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="isActive">Is Active:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'isActive','errors')}">
                                    <g:checkBox name="isActive" value="${maintenanceActionInstance?.isActive}" ></g:checkBox>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="taskProcedure">Task Procedure:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:maintenanceActionInstance,field:'taskProcedure','errors')}">
                                    <g:select optionKey="id" from="${TaskProcedure.list()}" name="taskProcedure.id" value="${maintenanceActionInstance?.taskProcedure?.id}" ></g:select>
                                    <p><g:link controller="taskProcedureDetailed" action="create">+Add Task Procedure</g:link></p>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
