source: trunk/grails-app/views/entryDetailed/_create.gsp @ 863

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

Add check for submit_confirmResult in entry create ajax.

File size: 8.1 KB
Line 
1
2
3    <g:render template="/shared/messages" />
4    <g:hasErrors bean="${entryInstance}">
5        <div class="errors">
6            <g:renderErrors bean="${entryInstance}" as="list" />
7        </div>
8    </g:hasErrors>
9    <div class="pane_close">
10        <img  src="${resource(dir:'images/skin',file:'cross.png')}" alt="Close" title="Close"/>
11    </div>
12    <g:form action="ajaxSave" method="post" name="createEntryForm">
13        <g:hiddenField name="task.id" value="${entryInstance.task.id}" />
14        <g:hiddenField name="entryType.id" value="${entryInstance.entryType.id}" />
15        <g:hiddenField name="submitAction" value="submit_default" />
16        <div class="dialog">
17            <table>
18                <tbody>
19
20                    <g:if test="${entryInstance?.entryType?.id == 1}">
21                        <tr class="prop">
22                            <td valign="top" class="name">
23                                <label for="productionReference">Production:</label>
24                            </td>
25                            <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'productionReference','errors')}">
26                                <g:select optionKey="id"
27                                                    from="${ProductionReference.findAllByIsActive(true)}"
28                                                    name="productionReference.id"
29                                                    value="${entryInstance.productionReference?.id}"
30                                                    noSelection="['null':'--None--']">
31                                </g:select>
32                                <custom:helpBalloon code="entry.productionReference.fault" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
33                            </td>
34                        </tr>
35                    </g:if>
36
37                    <g:if test="${entryInstance?.entryType?.id == 6}">
38                        <tr class="prop">
39                            <td valign="top" class="name">
40                                <label for="highestSeverity">Condition Severity:</label>
41                            </td>
42                            <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'highestSeverity','errors')}">
43                                <g:select optionKey="id"
44                                                    from="${ConditionSeverity.findAllByIsActive(true)}"
45                                                    name="highestSeverity.id"
46                                                    value="${entryInstance.highestSeverity?.id}"
47                                                    noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
48                                </g:select>
49                                <custom:helpBalloon code="entry.comment.pm.entry" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
50                            </td>
51                        </tr>
52                    </g:if>
53
54                    <tr class="prop">
55                        <td valign="top" class="name">
56                            <label for="comment">${entryInstance?.entryType.encodeAsHTML()}:</label>
57                        </td>
58                        <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'comment','errors')}">
59                            <textarea rows="5" cols="40" name="comment">${fieldValue(bean:entryInstance, field:'comment')}</textarea>
60                            <g:if test="${entryInstance?.entryType?.id == 1}">
61                                <custom:helpBalloon code="entry.comment.fault" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
62                            </g:if>
63                            <g:elseif test="${entryInstance?.entryType?.id == 2}">
64                                <custom:helpBalloon code="entry.comment.cause" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
65                            </g:elseif>
66                            <g:elseif test="${entryInstance?.entryType?.id == 3}">
67                                <custom:helpBalloon code="entry.comment.work.done" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
68                            </g:elseif>
69                            <g:elseif test="${entryInstance?.entryType?.id == 6}">
70                                <custom:helpBalloon code="entry.comment.pm.entry" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
71                            </g:elseif>
72                        </td>
73                    </tr>
74
75                    <tr class="prop">
76                        <td valign="top" class="name">
77                            <label for="dateDone">Date Done:</label>
78                        </td>
79                        <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'dateDone','errors')}">
80                            <richui:dateChooser name="dateDone" format="dd-MM-yyyy" value="${entryInstance.dateDone}" />
81                            <custom:helpBalloon code="entry.date.done" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
82                        </td>
83                    </tr>
84
85                    <g:if test="${entryInstance?.entryType?.id != 2}">
86                        <tr class="prop">
87                            <td valign="top" class="name">
88                                <label for="durationHour">Duration:</label>
89                            </td>
90
91                            <td valign="top" class="value">
92                                <input class="time ${hasErrors(bean:entryInstance,field:'durationHour','errors')}"
93                                    type="text" id="durationHour" name="durationHour"
94                                    value="${fieldValue(bean:entryInstance,field:'durationHour')}" />
95                                :
96                                <input class="time ${hasErrors(bean:entryInstance,field:'durationMinute','errors')}"
97                                    type="text" id="durationMinute" name="durationMinute"
98                                    value="${fieldValue(bean:entryInstance,field:'durationMinute')}" />
99                                <custom:helpBalloon code="entry.duration" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
100                            </td>
101                        </tr>
102                    </g:if>
103
104                </tbody>
105            </table>
106        </div>
107        <div class="buttons">
108            <span class="button">
109                <input class="save" type="submit" value="Save" />
110            </span>
111            <custom:helpBalloon code="task.save.entry"
112                                            iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
113            <span class="button">
114                <input class="flag" type="button" value="Unresolved" name="submit_andSetAttentionFlag" />
115            </span>
116            <custom:helpBalloon code="task.status.unresolved.save.entry"
117                                            iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
118            <span class="button">
119                <g:if test="${entryInstance.task.attentionFlag}" >
120                    <input class="complete"
121                                type="button"
122                                value="Resolved"
123                                onclick="submit_confirmResult = confirm('${message(code:'task.clear.attention.flag.on.completion.confirm')}');"
124                                name="submit_andComplete"/>
125                </g:if>
126                <g:else>
127                    <input class="complete" type="button" value="Resolved" name="submit_andComplete" />
128                </g:else>
129            </span>
130            <custom:helpBalloon code="task.status.resolved.save.entry"
131                                            iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />
132        </div>
133    </g:form>
Note: See TracBrowser for help on using the repository browser.