Ignore:
Timestamp:
Feb 28, 2010, 7:13:47 PM (14 years ago)
Author:
gav
Message:

Add attentionFlag to Task domain along with views and logic to suite.
Add entry type 'cause', refactor as required.
Refactor task types.
Move createBreakin to createImmediateCallout.

Location:
trunk/grails-app/views/taskDetailed
Files:
1 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/taskDetailed/createImmediateCallout.gsp

    r406 r418  
    33        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    44        <meta name="layout" content="main" />
    5         <title>Create Breakin</title>
     5        <title>Create Immediate Callout</title>
    66        <nav:resources override="true"/>
    77        <resource:dateChooser />
     
    2323            </div>
    2424            </g:hasErrors>
     25            <g:hasErrors bean="${entryCauseInstance}">
     26            <div class="errors">
     27                <g:renderErrors bean="${entryCauseInstance}" as="list" />
     28            </div>
     29            </g:hasErrors>
    2530            <g:hasErrors bean="${entryWorkDoneInstance}">
    2631            <div class="errors">
     
    2934            </g:hasErrors>
    3035
    31             <g:form action="saveBreakin" method="post" name="createTaskForm">
     36            <g:form action="saveImmediateCallout" method="post" name="createTaskForm">
    3237                <div class="dialog">
    3338                    <table>
     
    3641                            <tr class="prop">
    3742                                <td valign="top" class="name">
    38                                     <label for="description">Breakin Description:</label>
     43                                    <label for="description">Callout Description:</label>
    3944                                </td>
    4045                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}">
     
    4247                                    <g:helpBalloon class="helpballoon" code="task.description" />
    4348                                </td>
     49                            </tr>
     50                       
     51                            <tr class="prop">
     52                                <td valign="top" class="name">
     53                                    <label for="durationHour">Down Time:</label>
     54                                </td>
     55
     56                                <td valign="top" class="value">
     57                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationHour','errors')}"
     58                                        type="text" id="entryFault.durationHour" name="entryFault.durationHour"
     59                                        value="${fieldValue(bean:entryFaultInstance,field:'durationHour')}" />
     60                                    :
     61                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationMinute','errors')}"
     62                                        type="text" id="entryFault.durationMinute" name="entryFault.durationMinute"
     63                                        value="${fieldValue(bean:entryFaultInstance,field:'durationMinute')}" />
     64                                    <g:helpBalloon code="entry.duration" />
     65                                </td>
    4466                            </tr>
    4567                       
     
    5678                            <tr class="prop">
    5779                                <td valign="top" class="name">
    58                                     <label for="durationHour">Fault Duration:</label>
     80                                    <label for="comment">${entryCauseInstance?.entryType.encodeAsHTML()}:</label>
    5981                                </td>
    60 
    61                                 <td valign="top" class="value">
    62                                     <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationHour','errors')}"
    63                                         type="text" id="entryFault.durationHour" name="entryFault.durationHour"
    64                                         value="${fieldValue(bean:entryFaultInstance,field:'durationHour')}" />
    65                                     :
    66                                     <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationMinute','errors')}"
    67                                         type="text" id="entryFault.durationMinute" name="entryFault.durationMinute"
    68                                         value="${fieldValue(bean:entryFaultInstance,field:'durationMinute')}" />
    69                                     <g:helpBalloon code="entry.duration" />
    70                                 </td>
     82                                <td valign="top" class="value ${hasErrors(bean:entryCauseInstance,field:'comment','errors')}">
     83                                    <textarea rows="5" cols="40" name="entryCause.comment">${fieldValue(bean:entryCauseInstance, field:'comment')}</textarea>
     84                                        <g:helpBalloon code="entry.comment.cause" />
     85                                </td>
    7186                            </tr>
    7287                       
  • trunk/grails-app/views/taskDetailed/search.gsp

    r356 r418  
    1414
    1515        <div class="body">
    16             <g:if test="${flash.message}">
    17                 <div class="message">${flash.message}</div>
    18             </g:if>
     16            <g:render template="/shared/messages" />
    1917            <g:if test="${params.message}">
    2018                <div class="message">${params.message}</div>
     
    9189                        <tr>
    9290
     91                            <custom:sortableColumnWithImg property="attentionFlag"
     92                                                                                            imgSrc="${resource(dir:'images/skin',file:'flag_red.png')}"
     93                                                                                            imgAlt="Flag" params="${filterParams}" />
     94
    9395                            <g:sortableColumn property="id" title="Id" params="${filterParams}" />
    9496
     
    9698
    9799                            <g:sortableColumn property="description" title="Description" params="${filterParams}" />
    98 
    99                             <g:sortableColumn  property="leadPerson" title="Lead Person" params="${filterParams}" />
    100100
    101101                            <g:sortableColumn  property="taskPriority" title="Task Priority" params="${filterParams}" />
     
    111111                    <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'/>
    112112
    113                             <td>${fieldValue(bean:taskInstance, field:'id')}</td>
     113                            <td class="idColumn">
     114                                <g:if test="${taskInstance.attentionFlag}">
     115                                    <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Flag" />
     116                                </g:if>
     117                            </td>
     118
     119                            <td class="idColumn">${fieldValue(bean:taskInstance, field:'id')}</td>
    114120
    115121                            <td><g:formatDate date="${taskInstance.targetStartDate}" format="EEE, dd-MMM-yyyy"/></td>
    116122
    117123                            <td>${fieldValue(bean:taskInstance, field:'description')}</td>
    118 
    119                             <td>${fieldValue(bean:taskInstance, field:'leadPerson')}</td>
    120124
    121125                            <td>${fieldValue(bean:taskInstance, field:'taskPriority')}</td>
  • trunk/grails-app/views/taskDetailed/show.gsp

    r410 r418  
    1212        </div>
    1313        <div class="body">
    14             <g:if test="${flash.message}">
    15             <div class="message">${flash.message}</div>
    16             </g:if>
     14            <g:render template="/shared/messages" />
    1715            <g:if test="${taskInstance.trash}" >
    1816                <div class="errors">
    19                         This task is in the trash bin, but can be restored if required.
     17                        <ul><li>This task is in the trash bin, but can be restored if required.<li><ul>
    2018                </div>
    2119            </g:if>
     
    2624            </g:hasErrors>
    2725
     26            <div class="tabHeader">
     27                <h1 class="taskHeader">
     28                    Task #${taskInstance.id}
     29                    <g:if test="${taskInstance.attentionFlag}" >
     30                        <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Flag" />
     31                    </g:if>
     32                    <g:if test="${taskInstance.taskStatus.id == 3}" >
     33                        <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Flag" />
     34                    </g:if>
     35                </h1>
     36                ${fieldValue(bean:taskInstance, field:'description')}
     37            </div>
     38
     39            <br/>
     40
    2841            <richui:tabView id="tabView">
    2942
    3043                <richui:tabLabels>
    31                     <richui:tabLabel selected="${showTab.task}" title="Task #${taskInstance.id}" />
     44                    <richui:tabLabel selected="${showTab.task}" title="Details" />
    3245                    <richui:tabLabel selected="${showTab.procedure}" title="Procedure" />
    3346                    <richui:tabLabel selected="${showTab.recurrence}" title="Recurrence" />
     
    5366                                        </tr>
    5467                                    </g:if>
    55 
    56                                     <tr class="prop">
    57                                         <td valign="top" class="name">Description:</td>
    58 
    59                                         <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'description')}</td>
    60 
    61                                     </tr>
    6268
    6369                                    <tr class="prop">
     
    224230
    225231                                    <g:if test="${taskInstance.taskStatus.id != 3}" >
    226                                         <span class="button"><g:actionSubmit class="complete" value="Complete" /></span>
     232
     233                                        <g:if test="${taskInstance.attentionFlag}" >
     234                                            <span class="button"><g:actionSubmit class="flag" value="Clear" action="clearAttentionFlag"/></span>
     235                                        </g:if>
     236                                        <g:else>
     237                                            <span class="button"><g:actionSubmit class="flag" value="Unresolved" action="setAttentionFlag"/></span>
     238                                        </g:else>
     239
     240                                        <span class="button"><g:actionSubmit class="complete" value="Resolved" action="complete"/></span>
    227241
    228242                                        <g:if test="${taskInstance.approved}" >
     
    259273                                            <th>Comment</th>
    260274                                            <th>Date Done</th>
    261                                             <th>Duration</th>
     275                                            <th>Down Time</th>
    262276                                            <th>Entered By</th>
    263277                                            <th></th>
     
    292306                                <span class="button">
    293307                                    <g:actionSubmit value="Add Fault" action="create"  class="add"/>
     308                                </span>
     309                            </g:form>
     310                        </div>
     311
     312                        <br />
     313
     314                        <g:if test="${entryCauseList.isEmpty()}">
     315                            <h1>No Causes</h1>
     316                            <br />
     317                        </g:if>
     318                        <g:else>
     319                            <div class="list">
     320                                <h1>Causes</h1>
     321                                <table>
     322                                    <thead>
     323                                        <tr>
     324                                            <th>Comment</th>
     325                                            <th>Date Done</th>
     326                                            <th>Entered By</th>
     327                                            <th></th>
     328                                        </tr>
     329                                    </thead>
     330                                    <tbody>
     331                                        <g:each in="${entryCauseList}" status="i" var="entry">
     332                                                <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/entryDetailed/edit/${entry.id}"'/>
     333
     334                                                    <td style="width:65%">${entry.comment}</td>
     335                                                    <td><g:formatDate date="${entry.dateDone}" format="EEE, dd-MMM-yyyy"/></td>
     336                                                    <td>${entry.enteredBy}</td>
     337
     338                                                    <td>
     339                                                        <g:link controller="entryDetailed" action="edit" id="${entry.id}">
     340                                                            <img  src="${resource(dir:'images/skin',file:'database_edit.png')}" alt="Edit" />
     341                                                        </g:link>
     342                                                    </td>
     343
     344                                                </tr>
     345                                        </g:each>
     346                                    </tbody>
     347                                </table>
     348                            </div>
     349                        </g:else>
     350
     351                        <div class="buttons">
     352                            <g:form controller="entryDetailed">
     353                                <g:hiddenField name="taskInstance.id" value="${taskInstance?.id}" />
     354                                <g:hiddenField name="entryType.id" value="2" />
     355                                <span class="button">
     356                                    <g:actionSubmit value="Add Cause" action="create"  class="add"/>
    294357                                </span>
    295358                            </g:form>
     
    340403                            <g:form controller="entryDetailed">
    341404                                <g:hiddenField name="taskInstance.id" value="${taskInstance?.id}" />
    342                                 <g:hiddenField name="entryType.id" value="2" />
     405                                <g:hiddenField name="entryType.id" value="3" />
    343406                                <span class="button">
    344407                                    <g:actionSubmit value="Add Work Done" action="create"  class="add"/>
     
    687750            </richui:tabView>
    688751
    689         </div>
     752        </div> <!--body-->
    690753    </body>
    691754</html>
Note: See TracChangeset for help on using the changeset viewer.