source: trunk/grails-app/views/entryDetailed/edit.gsp @ 838

Last change on this file since 838 was 838, checked in by gav, 13 years ago

Update service, controller and view logic to hand Task and Entry highestSeverity.
Also remove associatedAssets from task search panes.

File size: 8.3 KB
Line 
1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
7        <title>Edit Entry</title>
8        <resource:dateChooser />
9    </head>
10    <body>
11        <div class="nav">
12            <h1>Edit Entry</h1>
13        </div>
14        <div class="body">
15            <g:if test="${flash.message}">
16            <div class="message">${flash.message}</div>
17            </g:if>
18            <g:hasErrors bean="${entryInstance}">
19            <div class="errors">
20                <g:renderErrors bean="${entryInstance}" as="list" />
21            </div>
22            </g:hasErrors>
23            <g:form method="post" >
24                <input type="hidden" name="id" value="${entryInstance?.id}" />
25                <div class="dialog">
26                    <table>
27                        <tbody>
28                       
29                            <tr class="prop">
30                                <td valign="top" class="name">
31                                    <label for="task">Task:</label>
32                                </td>
33                                <td valign="top" class="name">
34                                    <g:link controller="taskDetailed" action="show" id="${entryInstance.task.id}" >
35                                        ${entryInstance?.task.encodeAsHTML()}
36                                    </g:link>
37                                </td>
38                            </tr>
39
40                            <g:if test="${entryInstance?.entryType?.id == 1}">
41                                <tr class="prop">
42                                    <td valign="top" class="name">
43                                        <label for="productionReference">Production:</label>
44                                    </td>
45                                    <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'productionReference','errors')}">
46                                        <g:select optionKey="id"
47                                                            from="${ProductionReference.findAllByIsActive(true)}"
48                                                            name="productionReference.id"
49                                                            value="${entryInstance.productionReference?.id}"
50                                                            noSelection="['null':'--None--']">
51                                        </g:select>
52                                        <g:helpBalloon code="entry.productionReference.fault" />
53                                    </td>
54                                </tr>
55                            </g:if>
56
57                            <g:if test="${entryInstance?.entryType?.id == 6}">
58                                <tr class="prop">
59                                    <td valign="top" class="name">
60                                        <label for="highestSeverity">Condition Severity:</label>
61                                    </td>
62                                    <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'highestSeverity','errors')}">
63                                        <g:select optionKey="id"
64                                                            from="${ConditionSeverity.findAllByIsActive(true)}"
65                                                            name="highestSeverity.id"
66                                                            value="${entryInstance.highestSeverity?.id}"
67                                                            noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
68                                        </g:select>
69                                        <custom:helpBalloon code="entry.comment.pm.entry" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
70                                    </td>
71                                </tr>
72                            </g:if>
73                       
74                            <tr class="prop">
75                                <td valign="top" class="name">
76                                    <label for="comment">Comment:</label>
77                                </td>
78                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'comment','errors')}">
79                                    <textarea rows="5" cols="40" name="comment">${fieldValue(bean:entryInstance, field:'comment')}</textarea>
80                                </td>
81                            </tr>
82                       
83                            <tr class="prop">
84                                <td valign="top" class="name">
85                                    <label for="dateDone">Date Done:</label>
86                                </td>
87                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'dateDone','errors')}">
88                                    <richui:dateChooser name="dateDone" format="dd-MM-yyyy" value="${entryInstance?.dateDone}" />
89                                </td>
90                            </tr>
91
92                            <g:if test="${entryInstance?.entryType?.id != 2}">
93                                <tr class="prop">
94                                    <td valign="top" class="name">
95                                        <label for="durationHour">Duration:</label>
96                                    </td>
97
98                                    <td valign="top" class="value">
99                                        <input class="time ${hasErrors(bean:entryInstance,field:'durationHour','errors')}"
100                                            type="text" id="durationHour" name="durationHour"
101                                            value="${fieldValue(bean:entryInstance,field:'durationHour')}" />
102                                        :
103                                        <input class="time ${hasErrors(bean:entryInstance,field:'durationMinute','errors')}"
104                                            type="text" id="durationMinute" name="durationMinute"
105                                            value="${fieldValue(bean:entryInstance,field:'durationMinute')}" />
106                                        <g:helpBalloon code="entry.duration" />
107                                    </td>
108                                </tr>
109                            </g:if>
110                       
111                            <tr class="prop">
112                                <td valign="top" class="name">
113                                    <label for="dateEntered">Date Entered:</label>
114                                </td>
115                                <td valign="top" class="value">
116                                    <g:formatDate date="${entryInstance?.dateEntered}" format="EEE, dd-MMM-yyyy @ HH:mm"/>
117                                </td>
118                            </tr>
119                       
120                            <tr class="prop">
121                                <td valign="top" class="name">
122                                    <label for="enteredBy">Entered By:</label>
123                                </td>
124                                <td valign="top" class="value">
125                                    ${entryInstance?.enteredBy?.toString()}
126                                </td>
127                            </tr>
128                       
129                            <tr class="prop">
130                                <td valign="top" class="name">
131                                    <label for="entryType">Entry Type:</label>
132                                </td>
133                                <td valign="top" class="name">
134                                        ${entryInstance?.entryType.encodeAsHTML()}
135                                </td>
136                            </tr>
137                       
138                        </tbody>
139                    </table>
140                </div>
141                <div class="buttons">
142                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
143                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
144                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
145                </div>
146            </g:form>
147        </div>
148    </body>
149</html>
Note: See TracBrowser for help on using the repository browser.