Index: trunk/grails-app/views/taskDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/taskDetailed/show.gsp	(revision 131)
+++ trunk/grails-app/views/taskDetailed/show.gsp	(revision 133)
@@ -16,14 +16,18 @@
             <div class="message">${flash.message}</div>
             </g:if>
-
+            <g:hasErrors bean="${taskProcedureInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${taskProcedureInstance}" as="list" />
+            </div>
+            </g:hasErrors>
 
             <richui:tabView id="tabView">
 
                 <richui:tabLabels>
-                    <richui:tabLabel selected="true" title="Task" />
-                    <richui:tabLabel title="Procedure" />
-                    <richui:tabLabel title="Recurrence" />
-                    <richui:tabLabel title="Inventory" />
-                    <richui:tabLabel title="Sub Tasks" />
+                    <richui:tabLabel selected="${showTaskTab}" title="Task #${taskInstance.id}" />
+                    <richui:tabLabel selected="${showProcedureTab}" title="Procedure" />
+                    <richui:tabLabel selected="${showRecurrenceTab}" title="Recurrence" />
+                    <richui:tabLabel selected="${showInventoryTab}" title="Inventory" />
+                    <richui:tabLabel selected="${showSubTasksTab}" title="Sub Tasks" />
                 </richui:tabLabels>
 
@@ -259,32 +263,122 @@
 <!-- Start Task Procedure tab-->
                     <richui:tabContent>
-
-                        <div class="list">
-                            <table>
-                                <thead>
-                                    <tr>
-                                        <th>Step</th>
-                                        <th>Description</th>
-                                        <th></th>
-                                    </tr>
-                                </thead>
-                                <tbody>
-                                    <g:each in="${taskProcedureInstance?.maintenanceActions}" status="i" var="maintenanceAction">
-                                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/maintenanceActionDetailed/edit/${maintenanceAction.id}"'/>
-                                        
-                                        <td valign="top" class="name">
-                                            ${maintenanceAction?.procedureStepNumber}
-                                        </td>
-                                        
-                                        <td  valign="top" style="text-align:left;" class="value">
-                                            ${maintenanceAction?.description}
-                                        </td>
-                                        
-                                    </tr>
-                                    </g:each>
-
-                                </tbody>
-                            </table>
-                        </div>
+                        <g:if test="${!taskProcedureExits}">
+
+                            <g:form controller="taskDetailed" >
+                                <input type="hidden" name="taskInstance.id" value="${taskInstance?.id}" />
+
+                                <div class="dialog">
+                                    <table>
+                                        <tbody>
+                                        
+                                            <tr class="prop">
+                                                <td valign="top" class="name">
+                                                    <label for="name">Name:</label>
+                                                </td>
+                                                <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'name','errors')}">
+                                                    <input type="text" maxlength="75" id="name" name="name" value="${fieldValue(bean:taskProcedureInstance,field:'name')}"/>
+                                                </td>
+                                            </tr> 
+                        
+                                            <tr class="prop">
+                                                <td valign="top" class="name">
+                                                    <label for="description">Description:</label>
+                                                </td>
+                                                <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'description','errors')}">
+                                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:taskProcedureInstance,field:'description')}"/>
+                                                </td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
+                                </div>
+                                <div class="buttons">
+                                    <span class="button">
+                                        <g:actionSubmit value="New" action="generateProcedure"  class="save"/>
+                                    </span>
+                                    <span class="button">
+                                        <g:actionSubmit value="Find" action="findProcedure"  class="save"/>
+                                    </span>
+                                </div>
+<!--                                <div class="buttons">
+                                    <span class="button"><input class="save" type="submit" value="Create Procedure" /></span>
+                                    <span class="button"><input class="save" type="submit" value="Find Procedure" /></span>
+                                </div>-->
+                            </g:form>
+
+                        </g:if>
+                        <g:else>
+                        <div class="dialog">
+                                <table>
+                                    <tbody>
+                
+                                    
+                                        <tr class="prop">
+                                            <td valign="top" class="name">Procedure Id:</td>
+                                            
+                                            <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'id')}</td>
+                                            
+                                        </tr>
+                                    
+                                        <tr class="prop">
+                                            <td valign="top" class="name">Name:</td>
+                                            
+                                            <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'name')}</td>
+                                            
+                                        </tr>
+                                    
+                                        <tr class="prop">
+                                            <td valign="top" class="name">Description:</td>
+                                            
+                                            <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'description')}</td>
+                                            
+                                        </tr>
+                                    
+                                        <tr class="prop">
+                                            <td valign="top" class="name">Is Active:</td>
+                                            
+                                            <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'isActive')}</td>
+                                            
+                                        </tr>
+                                    
+                                    </tbody>
+                                </table>
+                            </div>
+                            <div class="buttons">
+                                <g:form controller="taskProcedureDetailed">
+                                    <input type="hidden" name="id" value="${taskProcedureInstance?.id}" />
+                                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
+<!--                                     <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> -->
+                                </g:form>
+                            </div>
+    
+                            <div class="list">
+                                <table>
+                                    <thead>
+                                        <tr>
+                                            <th>Step</th>
+                                            <th>Description</th>
+                                            <th></th>
+                                        </tr>
+                                    </thead>
+                                    <tbody>
+                                        <g:each in="${taskProcedureInstance?.maintenanceActions}" status="i" var="maintenanceAction">
+                                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/maintenanceActionDetailed/edit/${maintenanceAction.id}"'/>
+                                            
+                                            <td valign="top" class="name">
+                                                ${maintenanceAction?.procedureStepNumber}
+                                            </td>
+                                            
+                                            <td  valign="top" style="text-align:left;" class="value">
+                                                ${maintenanceAction?.description}
+                                            </td>
+                                            
+                                        </tr>
+                                        </g:each>
+    
+                                    </tbody>
+                                </table>
+                            </div>
+
+                        </g:else>
 
                     </richui:tabContent>
