1 | <head> |
---|
2 | <meta name="layout" content="main" /> |
---|
3 | <title>Edit Person</title> |
---|
4 | <nav:resources override="true"/> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | |
---|
9 | <div class="nav"> |
---|
10 | <nav:renderSubItems group="navAlt"/> |
---|
11 | </div> |
---|
12 | |
---|
13 | <div class="body"> |
---|
14 | <g:render template="/shared/messages" /> |
---|
15 | <g:hasErrors bean="${person}"> |
---|
16 | <div class="errors"> |
---|
17 | <g:renderErrors bean="${person}" as="list" /> |
---|
18 | </div> |
---|
19 | </g:hasErrors> |
---|
20 | |
---|
21 | <!--<div class="prop"> |
---|
22 | <span class="name">ID: ${person.id}</span> |
---|
23 | </div>--> |
---|
24 | |
---|
25 | <g:form> |
---|
26 | <input type="hidden" name="id" value="${person.id}" /> |
---|
27 | <input type="hidden" name="version" value="${person.version}" /> |
---|
28 | <input type="hidden" name="password" value="${person.password}" /> |
---|
29 | <div class="dialog"> |
---|
30 | <table> |
---|
31 | <tbody> |
---|
32 | |
---|
33 | <tr class="prop"> |
---|
34 | <td valign="top" class="name"><label for="loginName">Login Name:</label></td> |
---|
35 | <td valign="top" class="value ${hasErrors(bean:person,field:'loginName','errors')}"> |
---|
36 | <input type="text" id="loginName" name="loginName" value="${person.loginName?.encodeAsHTML()}"/> |
---|
37 | <g:helpBalloon class="helpballoon" code="person.loginName" /> |
---|
38 | </td> |
---|
39 | </tr> |
---|
40 | |
---|
41 | <tr class="prop"> |
---|
42 | <td valign="top" class="name"><label for="firstName">First Name:</label></td> |
---|
43 | <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}"> |
---|
44 | <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/> |
---|
45 | <g:helpBalloon class="helpballoon" code="person.firstName" /> |
---|
46 | </td> |
---|
47 | </tr> |
---|
48 | |
---|
49 | <tr class="prop"> |
---|
50 | <td valign="top" class="name"><label for="lastName">Last Name:</label></td> |
---|
51 | <td valign="top" class="value ${hasErrors(bean:person,field:'lastName','errors')}"> |
---|
52 | <input type="text" id="lastName" name="lastName" value="${person.lastName?.encodeAsHTML()}"/> |
---|
53 | <g:helpBalloon class="helpballoon" code="person.lastName" /> |
---|
54 | </td> |
---|
55 | </tr> |
---|
56 | |
---|
57 | <tr class="prop"> |
---|
58 | <td valign="top" class="name"><label for="pass">Password:</label></td> |
---|
59 | <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}"> |
---|
60 | <input type="password" id="pass" name="pass" value="${person.pass?.encodeAsHTML()}"/> |
---|
61 | <g:helpBalloon class="helpballoon" code="person.password" /> |
---|
62 | </td> |
---|
63 | </tr> |
---|
64 | |
---|
65 | <tr class="prop"> |
---|
66 | <td valign="top" class="name"><label for="isActive">Active:</label></td> |
---|
67 | <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}"> |
---|
68 | <g:checkBox name="isActive" value="${person.isActive}"/> |
---|
69 | <g:helpBalloon class="helpballoon" code="person.isActive" /> |
---|
70 | </td> |
---|
71 | </tr> |
---|
72 | |
---|
73 | <tr class="prop"> |
---|
74 | <td valign="top" class="name"><label for="description">Description:</label></td> |
---|
75 | <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}"> |
---|
76 | <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/> |
---|
77 | </td> |
---|
78 | </tr> |
---|
79 | |
---|
80 | <tr class="prop"> |
---|
81 | <td valign="top" class="name"> |
---|
82 | <label for="addresses">Contact:</label> |
---|
83 | </td> |
---|
84 | <td valign="top" class="value"> |
---|
85 | <ul> |
---|
86 | <g:each var="i" in="${person?.contacts}"> |
---|
87 | <li><g:link controller="contactDetailed" action="show" id="${i.id}"> |
---|
88 | ${i?.encodeAsHTML()} |
---|
89 | </g:link></li> |
---|
90 | </g:each> |
---|
91 | </ul> |
---|
92 | <g:link controller="contactDetailed" params="['person.id':person?.id]" action="create">+Add Contact</g:link> |
---|
93 | </td> |
---|
94 | </tr> |
---|
95 | |
---|
96 | <tr class="prop"> |
---|
97 | <td valign="top" class="name"> |
---|
98 | <label for="addresses">Addresses:</label> |
---|
99 | </td> |
---|
100 | <td valign="top" class="value"> |
---|
101 | <ul> |
---|
102 | <g:each var="i" in="${person?.addresses}"> |
---|
103 | <li><g:link controller="addressDetailed" action="show" id="${i.id}"> |
---|
104 | ${i?.encodeAsHTML()} |
---|
105 | </g:link></li> |
---|
106 | </g:each> |
---|
107 | </ul> |
---|
108 | <g:link controller="addressDetailed" params="['person.id':person?.id]" action="create">+Add Address</g:link> |
---|
109 | </td> |
---|
110 | </tr> |
---|
111 | |
---|
112 | <tr class="prop"> |
---|
113 | <td valign="top" class="name"><label for="employeeID">employee ID:</label></td> |
---|
114 | <td valign="top" class="value ${hasErrors(bean:person,field:'employeeID','errors')}"> |
---|
115 | <input type="text" id="employeeID" name="employeeID" value="${person.employeeID?.encodeAsHTML()}"/> |
---|
116 | </td> |
---|
117 | </tr> |
---|
118 | |
---|
119 | <tr class="prop"> |
---|
120 | <td valign="top" class="name"> |
---|
121 | <label for="department">Department:</label> |
---|
122 | </td> |
---|
123 | <td valign="top" class="value ${hasErrors(bean:person,field:'department','errors')}"> |
---|
124 | <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${person?.department?.id}" noSelection="['null':'--None--']"></g:select> |
---|
125 | </td> |
---|
126 | </tr> |
---|
127 | |
---|
128 | <tr class="prop"> |
---|
129 | <td valign="top" class="name"> |
---|
130 | <label for="personGroups">Groups:</label> |
---|
131 | </td> |
---|
132 | <td valign="top" class="value ${hasErrors(bean:person,field:'personGroups','errors')}"> |
---|
133 | <g:helpBalloon class="helpballoon" code="person.personGroups" /> |
---|
134 | <custom:checkBoxList name="personGroups" |
---|
135 | from="${PersonGroup.findAllByIsActive(true)}" |
---|
136 | value="${person?.personGroups?.collect{it.id}}" |
---|
137 | optionKey="id" |
---|
138 | sortBy="name" |
---|
139 | linkController="personGroupDetailed" |
---|
140 | linkAction="show"/> |
---|
141 | <g:link controller="personGroupDetailed" action="create">+Add Group</g:link> |
---|
142 | </td> |
---|
143 | </tr> |
---|
144 | |
---|
145 | <tr class="prop"> |
---|
146 | <td valign="top" class="name"> |
---|
147 | <label for="purchasingGroups">Purchasing Groups:</label> |
---|
148 | </td> |
---|
149 | <td valign="top" class="value ${hasErrors(bean:person,field:'purchasingGroups','errors')}"> |
---|
150 | <g:helpBalloon class="helpballoon" code="person.purchasingGroups" /> |
---|
151 | <custom:checkBoxList name="purchasingGroups" |
---|
152 | from="${PurchasingGroup.findAllByIsActive(true)}" |
---|
153 | value="${person?.purchasingGroups?.collect{it.id}}" |
---|
154 | optionKey="id" |
---|
155 | sortBy="name" |
---|
156 | linkController="purchasingGroupDetailed" |
---|
157 | linkAction="show"/> |
---|
158 | <g:link controller="purchasingGroupDetailed" action="create">+Add Group</g:link> |
---|
159 | </td> |
---|
160 | </tr> |
---|
161 | |
---|
162 | <tr class="prop"> |
---|
163 | <td valign="top" class="name" align="left"> |
---|
164 | Authorities: |
---|
165 | </td> |
---|
166 | <td valign="top" class="name" align="left"> |
---|
167 | <g:helpBalloon class="helpballoon" code="person.authorities" /> |
---|
168 | </td> |
---|
169 | </tr> |
---|
170 | |
---|
171 | <g:each var="entry" in="${roleMap}"> |
---|
172 | <tr> |
---|
173 | <td valign="top" class="name" align="left">${entry.key.description.encodeAsHTML()}</td> |
---|
174 | <td align="left"><g:checkBox name="${entry.key.authority}" value="${entry.value}"/></td> |
---|
175 | </tr> |
---|
176 | </g:each> |
---|
177 | |
---|
178 | </tbody> |
---|
179 | </table> |
---|
180 | </div> |
---|
181 | |
---|
182 | <div class="buttons"> |
---|
183 | <span class="button"><g:actionSubmit class="save" value="Update" /></span> |
---|
184 | <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span> |
---|
185 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
186 | </div> |
---|
187 | |
---|
188 | </g:form> |
---|
189 | |
---|
190 | </div> |
---|
191 | </body> |
---|