source: trunk/grails-app/views/taskDetailed/create.gsp @ 601

Last change on this file since 601 was 601, checked in by gav, 14 years ago

Add default.please.select.text and default.none.select.text messages.
Update Task views and service to use new messages.

File size: 11.7 KB
Line 
1<html>
2    <head>
3        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4        <meta name="layout" content="main" />
5        <title>Create Task</title>
6        <nav:resources override="true"/>
7        <resource:dateChooser />
8    </head>
9    <body onload="document.createTaskForm.description.focus();">
10        <div class="nav">
11            <nav:renderSubItems group="nav"/>
12        </div>
13        <div class="body">
14            <g:render template="/shared/messages" />
15            <g:hasErrors bean="${taskInstance}">
16            <div class="errors">
17                <g:renderErrors bean="${taskInstance}" as="list" />
18            </div>
19            </g:hasErrors>
20
21            <g:form action="save" method="post" name="createTaskForm">
22                <div class="dialog">
23                    <table>
24                        <tbody>
25                       
26                            <tr class="prop">
27                                <td valign="top" class="name">
28                                    <label for="description">Description:</label>
29                                </td>
30                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}">
31                                    <input type="text"  class="description" maxlength="75" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/>
32                                    <g:helpBalloon class="helpballoon" code="task.description" />
33                                </td>
34                            </tr>
35                       
36                            <tr class="prop">
37                                <td valign="top" class="name">
38                                    <label for="comment">Comment:</label>
39                                </td>
40                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'comment','errors')}">
41                                    <textarea  rows="5" cols="40" name="comment">${fieldValue(bean:taskInstance, field:'comment')}</textarea>
42                                    <g:helpBalloon class="helpballoon" code="task.comment" />
43                                </td>
44                            </tr>
45                       
46                            <tr class="prop">
47                                <td valign="top" class="name">
48                                    <label for="targetStartDate">Target Start Date:</label>
49                                </td>
50                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'targetStartDate','errors')}">
51                                    <richui:dateChooser name="targetStartDate" format="dd-MM-yyyy" value="${taskInstance.targetStartDate}" />
52                                    <g:helpBalloon class="helpballoon" code="task.targetStartDate" />
53                                </td>
54                            </tr>
55
56                            <tr class="prop">
57                                <td valign="top" class="name">
58                                    <label for="targetCompletionDate">Target Completion Date:</label>
59                                </td>
60                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'targetCompletionDate','errors')}">
61                                    <richui:dateChooser name="targetCompletionDate" format="dd-MM-yyyy" value="${taskInstance.targetCompletionDate}" />
62                                    <g:helpBalloon class="helpballoon" code="task.targetCompletionDate" />
63                                </td>
64                            </tr>
65                       
66                            <tr class="prop">
67                                <td valign="top" class="name">
68                                    <label for="leadPerson">Lead Person:</label>
69                                </td>
70                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'leadPerson','errors')}">
71                                    <g:select optionKey="id"
72                                                        from="${Person.findAllByIsActive(true).sort { p1, p2 -> p1.firstName.compareToIgnoreCase(p2.firstName) }}"
73                                                        name="leadPerson.id"
74                                                        value="${taskInstance?.leadPerson?.id}" >
75                                    </g:select>
76                                    <g:helpBalloon code="task.leadPerson" />
77                                </td>
78                            </tr>
79                       
80                            <tr class="prop">
81                                <td valign="top" class="name">
82                                    <label for="primaryAsset">Primary Asset:</label>
83                                </td>
84                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'primaryAsset','errors')}">
85                                    <g:select optionKey="id"
86                                                        from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
87                                                        name="primaryAsset.id"
88                                                        value="${taskInstance?.primaryAsset?.id}"
89                                                        noSelection="['null':/${g.message(code:'default.none.select.text')}/]">
90                                    </g:select>
91                                    <g:helpBalloon code="task.primaryAsset" />
92                                </td>
93                            </tr>
94
95                            <tr class="prop">
96                                <td valign="top" class="name">
97                                    <label for="associatedAssets">Associated Assets:</label>
98                                </td>
99                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'associatedAssets','errors')}">
100                                    <g:select id="associatedAssets" name="associatedAssets"
101                                                    from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
102                                                    size="5" multiple="yes" optionKey="id"
103                                                    value="${taskInstance?.associatedAssets?.id}"
104                                                    noSelection="['':/${g.message(code:'default.none.select.text')}/]">
105                                    </g:select>
106                                    <g:helpBalloon code="task.associatedAssets" />
107                                </td>
108                            </tr>
109                       
110                            <tr class="prop">
111                                <td valign="top" class="name">
112                                    <label for="taskPriority">Task Priority:</label>
113                                </td>
114                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskPriority','errors')}">
115                                    <g:select optionKey="id"
116                                                        from="${scheduledTaskPriorities}"
117                                                        name="taskPriority.id"
118                                                        value="${taskInstance?.taskPriority?.id}" >
119                                    </g:select>
120                                </td>
121                            </tr>
122                       
123                            <tr class="prop">
124                                <td valign="top" class="name">
125                                    <label for="taskGroup">Task Group:</label>
126                                </td>
127                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskGroup','errors')}">
128                                    <g:select optionKey="id"
129                                                        from="${TaskGroup.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
130                                                        name="taskGroup.id"
131                                                        value="${taskInstance?.taskGroup?.id}"
132                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]">
133                                    </g:select>
134                                </td>
135                            </tr>
136                       
137                            <tr class="prop">
138                                <td valign="top" class="name">
139                                    <label for="taskType">Task Type:</label>
140                                </td>
141                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskType','errors')}">
142                                    <g:select optionKey="id"
143                                                        from="${scheduledTaskTypes}"
144                                                        name="taskType.id"
145                                                        value="${taskInstance?.taskType?.id}"
146                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]">
147                                    </g:select>
148                                </td>
149                            </tr>
150                       
151                            <tr class="prop">
152                                <td valign="top" class="name">
153                                    <label for="isActive">Safety Requirement:</label>
154                                </td>
155                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'safetyRequirement','errors')}">
156                                    <g:checkBox name="safetyRequirement" value="${taskInstance?.safetyRequirement}" ></g:checkBox>
157                                    <g:helpBalloon code="task.safetyRequirement" />
158                                </td>
159                            </tr>
160                       
161                            <tr class="prop">
162                                <td valign="top" class="name">
163                                    <label for="isActive">Mandatory/Regulatory:</label>
164                                </td>
165                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'mandatoryRegulatory','errors')}">
166                                    <g:checkBox name="mandatoryRegulatory" value="${taskInstance?.mandatoryRegulatory}" ></g:checkBox>
167                                    <g:helpBalloon code="task.mandatoryRegulatory" />
168                                </td>
169                            </tr>
170                       
171                            <tr class="prop">
172                                <td valign="top" class="name">
173                                    <label for="isActive">Positive Fault:</label>
174                                </td>
175                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'positiveFault','errors')}">
176                                    <g:checkBox name="positiveFault" value="${taskInstance?.positiveFault}" ></g:checkBox>
177                                    <g:helpBalloon code="task.positiveFault" />
178                                </td>
179                            </tr>
180                       
181                        </tbody>
182                    </table>
183                </div>
184                <div class="buttons">
185                    <span class="button"><input class="save" type="submit" value="Create" /></span>
186                </div>
187            </g:form>
188        </div>
189    </body>
190</html>
Note: See TracBrowser for help on using the repository browser.