source: trunk/grails-app/views/taskDetailed/search.gsp @ 799

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

Change Task.toString() and display primaryAsset.name in front of description.

File size: 15.9 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>Task Search</title>
6        <filterpane:includes />
7        <nav:resources override="true"/>
8        <export:resource />
9        <resource:dateChooser />
10        <g:javascript src="taskQuickSearchPane.js" />
11    </head>
12    <body>
13        <div class="nav">
14            <nav:renderSubItems group="nav"/>
15        </div>
16
17        <div class="body">
18            <g:render template="/shared/messages" />
19            <g:hasErrors bean="${appCore}">
20                <div class="errors">
21                    <g:renderErrors bean="${appCore}" as="list" />
22                </div>
23            </g:hasErrors>
24            <filterpane:currentCriteria domainBean="Task"
25                                    action="search"
26                                    dateFormat="EEE, dd-MMM-yyyy"
27                                    removeImgDir="images"
28                                    removeImgFile="bullet_delete.png"
29                                    title="Advanced Search"/>
30
31            <div class="paginateButtons">
32                <span class="searchButtons">
33                    <a href='' onclick="showElement('searchPane'); return false;">Quick</a>
34                </span>
35                Results: ${taskInstanceList.size()} / ${taskInstanceTotal}
36                <span class="searchButtons">
37                    <filterpane:filterButton text="Advanced" appliedText="Advanced" />
38                </span>
39            </div>
40
41            <jsUtil:toggleControl toggleId="options"
42                                                    imageId="optionsImg"
43                                                    closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}"
44                                                    openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}"
45                                                    text="${g.message(code: 'default.options.text')}"
46                                                    />
47
48            <div id="options" style="display:none;">
49                <g:form method="post" action="setSearchParamsMax" >
50                    <g:hiddenField name="params" value="${filterParams}" />
51                    <div class="dialog">
52                        <table>
53                            <tbody>
54
55                                <tr class="prop">
56                                    <td valign="top" class="name">
57                                        <label for="max">Results per page:</label>
58                                    </td>
59                                    <td valign="top" class="value">
60                                        <input type="text" maxlength="4" id="description" name="newMax" value="${params.max}"/>
61
62                                        <span class="buttons">
63                                            <g:actionSubmit action="setSearchParamsMax" class="go" value="Update" />
64                                        </span>
65                                    </td>
66                                </tr>
67
68                            </tbody>
69                        </table>
70                    </div>
71                <export:formats  params="${filterParams}" formats="['csv', 'excel', 'pdf', 'rtf']"/>
72                </g:form>
73            </div>
74
75            <br />
76
77            <g:if test="${taskInstanceTotal > taskInstanceList.size()}">
78                <div class="paginateButtons">
79                    <g:paginate action="search" total="${taskInstanceTotal}" params="${filterParams}" />
80                </div>
81            </g:if>
82
83            <g:if test="${taskInstanceList.size() > 0}">
84                <div class="list">
85                    <table>
86                        <thead>
87                            <tr>
88
89                                <custom:sortableColumnWithImg property="attentionFlag"
90                                                                                                imgSrc="${resource(dir:'images/skin',file:'flag_red.png')}"
91                                                                                                imgAlt="Flag"
92                                                                                                imgTitle="Attention Flag"
93                                                                                                params="${filterParams}" />
94
95                                <g:sortableColumn property="targetStartDate" title="Target Start Date" params="${filterParams}" />
96
97                                <g:sortableColumn property="description" title="Description" params="${filterParams}" />
98
99                                <g:sortableColumn property="taskGroup" title="Group" params="${filterParams}" />
100
101                                <g:sortableColumn  property="taskType" title="Type" params="${filterParams}" />
102
103                                <custom:sortableColumnWithImg property="taskStatus"
104                                                                                                imgSrc="${resource(dir:'images/skin',file:'status.png')}"
105                                                                                                imgAlt="Status"
106                                                                                                imgTitle="Status"
107                                                                                                params="${filterParams}" />
108
109                                <g:sortableColumn  property="taskPriority" title="Priority" params="${filterParams}" />
110
111                                <custom:sortableColumnWithImg property="defaultSort"
112                                                                                                imgSrc="${resource(dir:'images/skin',file:'table_sort.png')}"
113                                                                                                imgAlt="Sort"
114                                                                                                imgTitle="Default Sort"
115                                                                                                params="${filterParams}" />
116
117                            </tr>
118                        </thead>
119                        </tbody>
120                        <tbody>
121                        <g:each in="${taskInstanceList}" status="i" var="taskInstance">
122                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
123
124                                <td class="idColumn" onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
125                                    <g:if test="${taskInstance.attentionFlag}">
126                                        <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Flag" title="Attention Flag"/>
127                                    </g:if>
128                                </td>
129
130                                <td onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
131                                    <g:formatDate date="${taskInstance.targetStartDate}" format="EEE, dd-MMM-yyyy"/>
132                                </td>
133
134                                <td onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
135                                    <b>
136                                        Task #${fieldValue(bean:taskInstance, field:'id')}
137                                    </b>
138                                    <g:if test="${taskInstance.approved}" >
139                                        <img  src="${resource(dir:'images/skin',file:'cog.png')}" alt="Approved" title="Approved" />
140                                    </g:if>
141                                    <g:if test="${taskInstance.taskRecurringSchedule?.enabled}" >
142                                        <img  src="${resource(dir:'images/skin',file:'arrow_refresh.png')}" alt="Recurrence Enabled" title="Recurrence Enabled" />
143                                    </g:if>
144                                    <br />
145
146                                    <b>
147                                    <g:if test="${taskInstance.primaryAsset}">
148                                        ${fieldValue(bean:taskInstance, field:'primaryAsset')}:
149                                    </g:if>
150                                    ${fieldValue(bean:taskInstance, field:'description')}
151                                    </b>
152                                    <g:if test="${taskInstance.safetyRequirement}" >
153                                        <br />
154                                        <img  src="${resource(dir:'images/skin',file:'lightning.png')}" alt="Safety Requirement" title="Safety Requirement" />
155                                        Safety
156                                    </g:if>
157                                    <g:if test="${taskInstance.regulatoryRequirement}" >
158                                        <br />
159                                        <img  src="${resource(dir:'images/skin',file:'script_lightning.png')}" alt="Regulatory Requirement" title="Regulatory Requirement" />
160                                        Regulatory
161                                    </g:if>
162                                    <g:if test="${taskInstance.mandatoryRequirement}" >
163                                        <br />
164                                        <img  src="${resource(dir:'images/skin',file:'script.png')}" alt="Mandatory Requirement" title="Mandatory Requirement" />
165                                        Mandatory
166                                    </g:if>
167                                    <br />
168                                    <br />
169                                    <g:each in="${taskInstance.assignedGroups}" status="j" var="assignedGroup">
170                                        ${assignedGroup.encodeAsHTML()}<br />
171                                    </g:each>
172                                    <g:each in="${taskInstance.assignedPersons}" status="k" var="assignedPerson">
173                                        ${assignedPerson.encodeAsHTML()}<br />
174                                    </g:each>
175                                    <g:each in="${taskInstance.entries}" status="m" var="entry">
176                                        <g:if test="${entry.entryType.id == 3}">
177                                            <em>${'WD: ' +entry.toShortString().encodeAsHTML()}</em><br />
178                                        </g:if>
179                                    </g:each>
180                                    <g:if test="${taskInstance.subTasks}">
181                                        Sub Tasks: ${taskInstance.subTasks.size()}<br />
182                                    </g:if>
183                                </td>
184
185                                <td onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
186                                    ${fieldValue(bean:taskInstance, field:'taskGroup')}
187                                </td>
188
189                                <td onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
190                                    ${fieldValue(bean:taskInstance, field:'taskType')}
191                                </td>
192
193                                <td class="idColumn" onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
194                                    <g:if test="${taskInstance.taskStatus.id == 1}" >
195                                        <img  src="${resource(dir:'images/skin',file:'not_started.png')}" alt="Not Started" title="Not Started" />
196                                    </g:if>
197                                    <g:if test="${taskInstance.taskStatus.id == 2}" >
198                                        <img  src="${resource(dir:'images/skin',file:'arrow_right.png')}" alt="In Progress" title="In Progress" />
199                                    </g:if>
200                                    <g:if test="${taskInstance.taskStatus.id == 3}" >
201                                        <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Complete" title="Complete" />
202                                    </g:if>
203                                </td>
204
205                                <td onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'>
206                                    ${fieldValue(bean:taskInstance, field:'taskPriority')}
207                                </td>
208
209                                <td class="notClickable">
210                                    <g:link action="show" id="${taskInstance.id}">
211                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" />
212                                    </g:link>
213                                </td>
214
215                            </tr>
216                        </g:each>
217                        </tbody>
218                    </table>
219                </div>
220            </g:if>
221            <div class="paginateButtons">
222                <g:paginate action="search" total="${taskInstanceTotal}" params="${filterParams}" />
223            </div>
224
225            <filterpane:filterPane domainBean="Task"
226                                    title="Advanced Search"
227                                    action="search"
228                                    class="overlayPane"
229                                    additionalProperties="id"
230                                    excludeProperties="targetCompletionDate"
231                                    associatedProperties="taskPriority.name,
232                                                                                leadPerson.lastName,
233                                                                                leadPerson.firstName,
234                                                                                taskGroup.name,
235                                                                                associatedAssets.name,
236                                                                                primaryAsset.name,
237                                                                                taskStatus.name,
238                                                                                taskType.name"
239                                    filterPropertyValues="${['taskPriority.name':[values: associatedPropertyValues.taskPriorityList],
240                                                                                'leadPerson.lastName':[values: associatedPropertyValues.lastNameList],
241                                                                                'leadPerson.firstName':[values: associatedPropertyValues.firstNameList],
242                                                                                'taskGroup.name':[values: associatedPropertyValues.taskGroupList],
243                                                                                'associatedAssets.name':[values: associatedPropertyValues.assetList],
244                                                                                'primaryAsset.name':[values: associatedPropertyValues.assetList],
245                                                                                'taskStatus.name':[values: associatedPropertyValues.taskStatusList],
246                                                                                'taskType.name':[values: associatedPropertyValues.taskTypeList],
247                                                                                targetCompletionDate:[years: associatedPropertyValues.yearRange,precision:'day'],
248                                                                                targetStartDate:[years: associatedPropertyValues.yearRange,precision:'day']
249                                                                                ]}"/>
250
251            <g:render template="quickSearchPane" />
252
253        </div> <!-- end body  -->
254    </body>
255</html>
Note: See TracBrowser for help on using the repository browser.