228 |
23 Mar 05 |
nicklas |
1 |
<%-- $Id$ |
228 |
23 Mar 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Martin Svensson |
228 |
23 Mar 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
228 |
23 Mar 05 |
nicklas |
9 |
|
228 |
23 Mar 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
228 |
23 Mar 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
228 |
23 Mar 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
228 |
23 Mar 05 |
nicklas |
14 |
|
228 |
23 Mar 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
228 |
23 Mar 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
228 |
23 Mar 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
228 |
23 Mar 05 |
nicklas |
18 |
GNU General Public License for more details. |
228 |
23 Mar 05 |
nicklas |
19 |
|
228 |
23 Mar 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
228 |
23 Mar 05 |
nicklas |
22 |
------------------------------------------------------------------ |
228 |
23 Mar 05 |
nicklas |
23 |
|
228 |
23 Mar 05 |
nicklas |
24 |
This page is used to display and modify the attributes of |
228 |
23 Mar 05 |
nicklas |
25 |
the logged in user. It displays a tabbed dialogue: |
228 |
23 Mar 05 |
nicklas |
26 |
|
228 |
23 Mar 05 |
nicklas |
27 |
@param page |
228 |
23 Mar 05 |
nicklas |
28 |
The name active page of the tabbed dialog. |
228 |
23 Mar 05 |
nicklas |
29 |
- contact: Contact information for the user, address, phone, email, etc. |
228 |
23 Mar 05 |
nicklas |
30 |
- password: The password for the user |
228 |
23 Mar 05 |
nicklas |
31 |
- other: Other information |
228 |
23 Mar 05 |
nicklas |
32 |
|
228 |
23 Mar 05 |
nicklas |
33 |
Saving the form invokes the submit_user.jsp page with cmd=SaveSettings |
228 |
23 Mar 05 |
nicklas |
34 |
|
228 |
23 Mar 05 |
nicklas |
35 |
@author Nicklas |
228 |
23 Mar 05 |
nicklas |
36 |
@version 2.0 |
228 |
23 Mar 05 |
nicklas |
37 |
--%> |
5426 |
24 Sep 10 |
nicklas |
38 |
<%@ page pageEncoding="UTF-8" session="false" |
228 |
23 Mar 05 |
nicklas |
39 |
import="net.sf.basedb.core.*" |
5442 |
07 Oct 10 |
nicklas |
40 |
import="net.sf.basedb.util.EmailUtil" |
228 |
23 Mar 05 |
nicklas |
41 |
import="net.sf.basedb.clients.web.*" |
228 |
23 Mar 05 |
nicklas |
42 |
import="net.sf.basedb.clients.web.util.HTML" |
3535 |
28 Jun 07 |
martin |
43 |
import="net.sf.basedb.util.formatter.Formatter" |
6153 |
28 Sep 12 |
nicklas |
44 |
import="net.sf.basedb.util.json.JsonUtil" |
6153 |
28 Sep 12 |
nicklas |
45 |
import="net.sf.basedb.util.json.JsonConverter" |
7499 |
06 Aug 18 |
nicklas |
46 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
3535 |
28 Jun 07 |
martin |
47 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
3535 |
28 Jun 07 |
martin |
48 |
import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
7499 |
06 Aug 18 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7499 |
06 Aug 18 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
7499 |
06 Aug 18 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
7499 |
06 Aug 18 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6153 |
28 Sep 12 |
nicklas |
53 |
import="org.json.simple.JSONObject" |
6153 |
28 Sep 12 |
nicklas |
54 |
import="org.json.simple.JSONArray" |
3535 |
28 Jun 07 |
martin |
55 |
import="java.util.Date" |
6153 |
28 Sep 12 |
nicklas |
56 |
import="java.util.List" |
228 |
23 Mar 05 |
nicklas |
57 |
%> |
228 |
23 Mar 05 |
nicklas |
58 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
228 |
23 Mar 05 |
nicklas |
59 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
7502 |
10 Aug 18 |
nicklas |
60 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
228 |
23 Mar 05 |
nicklas |
61 |
<% |
522 |
04 May 05 |
nicklas |
62 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
522 |
04 May 05 |
nicklas |
63 |
final String ID = sc.getId(); |
522 |
04 May 05 |
nicklas |
64 |
final String activePage = request.getParameter("page"); |
522 |
04 May 05 |
nicklas |
65 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
66 |
final DbControl dc = sc.newDbControl(":Edit user"); |
3535 |
28 Jun 07 |
martin |
67 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, Item.USER, null, null); |
228 |
23 Mar 05 |
nicklas |
68 |
try |
228 |
23 Mar 05 |
nicklas |
69 |
{ |
522 |
04 May 05 |
nicklas |
70 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
5904 |
09 Dec 11 |
nicklas |
71 |
final String title = "Information for " + HTML.encodeTags(user.getName()); |
522 |
04 May 05 |
nicklas |
72 |
final boolean writePermission = user.hasPermission(Permission.RESTRICTED_WRITE); |
5905 |
12 Dec 11 |
nicklas |
73 |
final String ifDisabled = writePermission ? "" : "disabled"; |
7587 |
06 Feb 19 |
nicklas |
74 |
final String passwordDisabled = writePermission ? "" : "disabled"; |
253 |
24 Mar 05 |
nicklas |
75 |
dc.detachItem(user); |
522 |
04 May 05 |
nicklas |
76 |
sc.setSessionSetting("user", user); |
3535 |
28 Jun 07 |
martin |
77 |
|
3535 |
28 Jun 07 |
martin |
78 |
List<ExtendedProperty> extendedProperties = ExtendedProperties.getProperties("UserData"); |
6153 |
28 Sep 12 |
nicklas |
79 |
JSONArray jsonExtendedProperties = JsonUtil.toArray(extendedProperties, new JsonConverter<ExtendedProperty>() |
6153 |
28 Sep 12 |
nicklas |
80 |
{ |
6153 |
28 Sep 12 |
nicklas |
81 |
public Object convert(ExtendedProperty ep) |
6153 |
28 Sep 12 |
nicklas |
82 |
{ |
7501 |
09 Aug 18 |
nicklas |
83 |
if (ep.isRestrictedEdit()) return null; |
6153 |
28 Sep 12 |
nicklas |
84 |
JSONObject json = new JSONObject(); |
6153 |
28 Sep 12 |
nicklas |
85 |
json.put("name", ep.getName()); |
6153 |
28 Sep 12 |
nicklas |
86 |
json.put("valueType", ep.getType().name()); |
6153 |
28 Sep 12 |
nicklas |
87 |
json.put("title", ep.getTitle()); |
6153 |
28 Sep 12 |
nicklas |
88 |
json.put("nullable", ep.isNullable()); |
6153 |
28 Sep 12 |
nicklas |
89 |
return json; |
6153 |
28 Sep 12 |
nicklas |
90 |
} |
6153 |
28 Sep 12 |
nicklas |
91 |
}); |
3535 |
28 Jun 07 |
martin |
92 |
|
3535 |
28 Jun 07 |
martin |
93 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
3535 |
28 Jun 07 |
martin |
94 |
String dateFormat = FormatterSettings.getDateFormat(sc); |
3535 |
28 Jun 07 |
martin |
95 |
String jsDateFormat = HTML.javaScriptEncode(dateFormat); |
3535 |
28 Jun 07 |
martin |
96 |
String htmlDateFormat = HTML.encodeTags(dateFormat); |
5443 |
07 Oct 10 |
nicklas |
97 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
5443 |
07 Oct 10 |
nicklas |
98 |
String dateTimeFormat = FormatterSettings.getDateTimeFormat(sc); |
5443 |
07 Oct 10 |
nicklas |
99 |
String jsDateTimeFormat = HTML.javaScriptEncode(dateTimeFormat); |
5443 |
07 Oct 10 |
nicklas |
100 |
String htmlDateTimeFormat = HTML.encodeTags(dateTimeFormat); |
7502 |
10 Aug 18 |
nicklas |
101 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, user); |
7605 |
26 Feb 19 |
nicklas |
102 |
ExtensionsInvoker<TabAction> tabsInvoker = ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_EDIT+"user-information"); |
6153 |
28 Sep 12 |
nicklas |
103 |
%> |
5904 |
09 Dec 11 |
nicklas |
104 |
<base:page type="popup" title="<%=title%>"> |
7502 |
10 Aug 18 |
nicklas |
105 |
<base:head scripts="tabcontrol-2.js,~settings.js" styles="tabcontrol.css"> |
7502 |
10 Aug 18 |
nicklas |
106 |
<ext:scripts context="<%=jspContext%>" /> |
7502 |
10 Aug 18 |
nicklas |
107 |
<ext:stylesheets context="<%=jspContext%>" /> |
7502 |
10 Aug 18 |
nicklas |
108 |
</base:head> |
5901 |
08 Dec 11 |
nicklas |
109 |
<base:body> |
5905 |
12 Dec 11 |
nicklas |
110 |
<h1><%=title%><base:help tabcontrol="settings" /></h1> |
5901 |
08 Dec 11 |
nicklas |
111 |
|
6153 |
28 Sep 12 |
nicklas |
112 |
<div id="page-data" class="datacontainer" |
6153 |
28 Sep 12 |
nicklas |
113 |
data-date-format="<%=htmlDateFormat%>" |
6153 |
28 Sep 12 |
nicklas |
114 |
data-datetime-format="<%=htmlDateTimeFormat%>" |
6153 |
28 Sep 12 |
nicklas |
115 |
data-extended-properties="<%=HTML.encodeTags(jsonExtendedProperties.toJSONString())%>" |
6153 |
28 Sep 12 |
nicklas |
116 |
></div> |
6153 |
28 Sep 12 |
nicklas |
117 |
|
6162 |
10 Oct 12 |
nicklas |
118 |
<form action="submit_user.jsp?ID=<%=ID%>" method="post" name="user"> |
5905 |
12 Dec 11 |
nicklas |
119 |
<input type=hidden name="cmd" value="SaveSettings"> |
228 |
23 Mar 05 |
nicklas |
120 |
|
5905 |
12 Dec 11 |
nicklas |
121 |
<t:tabcontrol |
5905 |
12 Dec 11 |
nicklas |
122 |
subclass="content dialogtabcontrol" |
5905 |
12 Dec 11 |
nicklas |
123 |
active="<%=activePage%>" id="settings" |
7499 |
06 Aug 18 |
nicklas |
124 |
extensions="<%=tabsInvoker%>" |
5905 |
12 Dec 11 |
nicklas |
125 |
position="bottom" remember="false"> |
440 |
22 Apr 05 |
nicklas |
126 |
|
6166 |
11 Oct 12 |
nicklas |
127 |
<t:tab id="contact" title="Contact information" helpid="userpreferences.contact"> |
5905 |
12 Dec 11 |
nicklas |
128 |
<table class="fullform input100"> |
5905 |
12 Dec 11 |
nicklas |
129 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
130 |
<th>Full name</th> |
5905 |
12 Dec 11 |
nicklas |
131 |
<td><%=HTML.encodeTags(user.getName())%></td> |
5905 |
12 Dec 11 |
nicklas |
132 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
133 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
134 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
135 |
<th>Email</th> |
5905 |
12 Dec 11 |
nicklas |
136 |
<td><input <%=ifDisabled%> type="text" name="email" value="<%=HTML.encodeTags(user.getEmail())%>" maxlength="<%=User.MAX_EMAIL_LENGTH%>"></td> |
5905 |
12 Dec 11 |
nicklas |
137 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
138 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
139 |
<% |
5905 |
12 Dec 11 |
nicklas |
140 |
if (EmailUtil.isEnabled() && writePermission) |
5905 |
12 Dec 11 |
nicklas |
141 |
{ |
5905 |
12 Dec 11 |
nicklas |
142 |
%> |
5905 |
12 Dec 11 |
nicklas |
143 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
144 |
<th class="subprompt"></th> |
5905 |
12 Dec 11 |
nicklas |
145 |
<td> |
5905 |
12 Dec 11 |
nicklas |
146 |
<% |
5905 |
12 Dec 11 |
nicklas |
147 |
boolean sendMessagesAsEmail = user.getSendMessagesAsEmail(); |
5905 |
12 Dec 11 |
nicklas |
148 |
%> |
5905 |
12 Dec 11 |
nicklas |
149 |
<input type="checkbox" name="sendMessagesAsEmail" id="sendMessagesAsEmail" value="1" <%=sendMessagesAsEmail ? "checked" : ""%> |
5905 |
12 Dec 11 |
nicklas |
150 |
><label for="sendMessagesAsEmail">Send system messages as email</label> |
5905 |
12 Dec 11 |
nicklas |
151 |
</td> |
5905 |
12 Dec 11 |
nicklas |
152 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
153 |
</tr> |
7410 |
09 Oct 17 |
nicklas |
154 |
<tr> |
7410 |
09 Oct 17 |
nicklas |
155 |
<th class="subprompt"></th> |
7410 |
09 Oct 17 |
nicklas |
156 |
<td> |
7410 |
09 Oct 17 |
nicklas |
157 |
<% |
7410 |
09 Oct 17 |
nicklas |
158 |
boolean useDeviceVerification = user.getUseDeviceVerification(); |
7410 |
09 Oct 17 |
nicklas |
159 |
%> |
7410 |
09 Oct 17 |
nicklas |
160 |
<input type="checkbox" name="useDeviceVerification" id="useDeviceVerification" value="1" <%=useDeviceVerification ? "checked" : ""%> |
7410 |
09 Oct 17 |
nicklas |
161 |
><label for="useDeviceVerification">Enable 2-factor login</label> |
7410 |
09 Oct 17 |
nicklas |
162 |
</td> |
7410 |
09 Oct 17 |
nicklas |
163 |
<td></td> |
7410 |
09 Oct 17 |
nicklas |
164 |
</tr> |
5442 |
07 Oct 10 |
nicklas |
165 |
<% |
5905 |
12 Dec 11 |
nicklas |
166 |
} |
3535 |
28 Jun 07 |
martin |
167 |
%> |
5904 |
09 Dec 11 |
nicklas |
168 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
169 |
<th>Organisation</th> |
5905 |
12 Dec 11 |
nicklas |
170 |
<td><input <%=ifDisabled%> type="text" name="organisation" value="<%=HTML.encodeTags(user.getOrganisation())%>" maxlength="<%=User.MAX_ORGANISATION_LENGTH%>"></td> |
5905 |
12 Dec 11 |
nicklas |
171 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
172 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
173 |
<tr class="big"> |
5905 |
12 Dec 11 |
nicklas |
174 |
<th>Address</th> |
3535 |
28 Jun 07 |
martin |
175 |
<td> |
6166 |
11 Oct 12 |
nicklas |
176 |
<textarea <%=ifDisabled%> rows="4" name="address" id="address"><%=HTML.encodeTags(user.getAddress())%></textarea> |
5905 |
12 Dec 11 |
nicklas |
177 |
</td> |
5905 |
12 Dec 11 |
nicklas |
178 |
<td style="width: 20px;"> |
6166 |
11 Oct 12 |
nicklas |
179 |
<base:zoom textarea="address" title="Address" /> |
5905 |
12 Dec 11 |
nicklas |
180 |
</td> |
5905 |
12 Dec 11 |
nicklas |
181 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
182 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
183 |
<th>Phone</th> |
5905 |
12 Dec 11 |
nicklas |
184 |
<td><input <%=ifDisabled%> type="text" name="phone" value="<%=HTML.encodeTags(user.getPhone())%>" maxlength="<%=User.MAX_PHONE_LENGTH%>"></td> |
5905 |
12 Dec 11 |
nicklas |
185 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
186 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
187 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
188 |
<th>Fax</th> |
5905 |
12 Dec 11 |
nicklas |
189 |
<td><input <%=ifDisabled%> type="text" name="fax" value="<%=HTML.encodeTags(user.getFax())%>" maxlength="<%=User.MAX_FAX_LENGTH%>"></td> |
5905 |
12 Dec 11 |
nicklas |
190 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
191 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
192 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
193 |
<th>Url</th> |
5905 |
12 Dec 11 |
nicklas |
194 |
<td><input <%=ifDisabled%> type="text" name="url" value="<%=HTML.encodeTags(user.getUrl())%>" maxlength="<%=User.MAX_URL_LENGTH%>"></td> |
5905 |
12 Dec 11 |
nicklas |
195 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
196 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
197 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
198 |
<th></th> |
5905 |
12 Dec 11 |
nicklas |
199 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
200 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
201 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
202 |
</table> |
5905 |
12 Dec 11 |
nicklas |
203 |
</t:tab> |
5905 |
12 Dec 11 |
nicklas |
204 |
|
6166 |
11 Oct 12 |
nicklas |
205 |
<t:tab id="password" title="Password" helpid="userpreferences.password"> |
5977 |
20 Feb 12 |
nicklas |
206 |
<table class="fullform input100"> |
5905 |
12 Dec 11 |
nicklas |
207 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
208 |
<th>Login</th> |
5905 |
12 Dec 11 |
nicklas |
209 |
<td><%=HTML.encodeTags(user.getLogin())%></td> |
5905 |
12 Dec 11 |
nicklas |
210 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
211 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
212 |
<th>New password</th> |
5905 |
12 Dec 11 |
nicklas |
213 |
<td><input <%=passwordDisabled%> type="password" name="password" value="" maxlength="30"></td> |
5905 |
12 Dec 11 |
nicklas |
214 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
215 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
216 |
<th>Retype password</th> |
5905 |
12 Dec 11 |
nicklas |
217 |
<td><input <%=passwordDisabled%> type="password" name="retype_password" value="" maxlength="30"></td> |
5905 |
12 Dec 11 |
nicklas |
218 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
219 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
220 |
<th></th> |
5905 |
12 Dec 11 |
nicklas |
221 |
<td><i>- leave empty to not change the password</i></td> |
5905 |
12 Dec 11 |
nicklas |
222 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
223 |
</table> |
5905 |
12 Dec 11 |
nicklas |
224 |
</t:tab> |
5905 |
12 Dec 11 |
nicklas |
225 |
|
5905 |
12 Dec 11 |
nicklas |
226 |
<t:tab id="other" title="Other information" |
6166 |
11 Oct 12 |
nicklas |
227 |
helpid="userpreferences.other"> |
5905 |
12 Dec 11 |
nicklas |
228 |
<table class="fullform input100"> |
5905 |
12 Dec 11 |
nicklas |
229 |
<% |
5905 |
12 Dec 11 |
nicklas |
230 |
if (extendedProperties != null) |
5905 |
12 Dec 11 |
nicklas |
231 |
{ |
6153 |
28 Sep 12 |
nicklas |
232 |
for (ExtendedProperty ep : extendedProperties) |
3535 |
28 Jun 07 |
martin |
233 |
{ |
5905 |
12 Dec 11 |
nicklas |
234 |
String name = ep.getName(); |
6166 |
11 Oct 12 |
nicklas |
235 |
String fieldName = "ep."+name; |
5905 |
12 Dec 11 |
nicklas |
236 |
Type type = ep.getType(); |
5905 |
12 Dec 11 |
nicklas |
237 |
boolean required = !ep.isNullable(); |
5905 |
12 Dec 11 |
nicklas |
238 |
Object value = user == null ? cc.getPropertyValue(name) : user.getExtended(name); |
5905 |
12 Dec 11 |
nicklas |
239 |
String isRequired = required ? "class=\"required\"" : ""; |
6428 |
03 Mar 14 |
nicklas |
240 |
final String isDisabled = ep.isRestrictedEdit() ? "disabled" : ""; |
5908 |
13 Dec 11 |
nicklas |
241 |
boolean addZoom = false; |
3535 |
28 Jun 07 |
martin |
242 |
%> |
5905 |
12 Dec 11 |
nicklas |
243 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
244 |
<th><%=HTML.encodeTags(ep.getTitle())%></th> |
5905 |
12 Dec 11 |
nicklas |
245 |
<td> |
5905 |
12 Dec 11 |
nicklas |
246 |
<% |
5905 |
12 Dec 11 |
nicklas |
247 |
if (type == Type.INT || type == Type.LONG) |
5905 |
12 Dec 11 |
nicklas |
248 |
{ |
5905 |
12 Dec 11 |
nicklas |
249 |
%> |
6428 |
03 Mar 14 |
nicklas |
250 |
<input <%=isRequired%> <%=isDisabled %> type="text" name="<%=fieldName%>" id="<%=fieldName%>" |
6166 |
11 Oct 12 |
nicklas |
251 |
value="<%=value == null ? "" : value%>" style="width: 15em;" maxlength="20"> |
5905 |
12 Dec 11 |
nicklas |
252 |
<% |
5905 |
12 Dec 11 |
nicklas |
253 |
} |
5905 |
12 Dec 11 |
nicklas |
254 |
else if (type == Type.FLOAT || type == Type.DOUBLE) |
5905 |
12 Dec 11 |
nicklas |
255 |
{ |
5905 |
12 Dec 11 |
nicklas |
256 |
%> |
6428 |
03 Mar 14 |
nicklas |
257 |
<input <%=isRequired%> <%=isDisabled%> type="text" name="<%=fieldName%>" id="<%=fieldName%>" |
6166 |
11 Oct 12 |
nicklas |
258 |
value="<%=value == null ? "" : value%>" style="width: 15em;" maxlength="20"> |
5905 |
12 Dec 11 |
nicklas |
259 |
<% |
5905 |
12 Dec 11 |
nicklas |
260 |
} |
5905 |
12 Dec 11 |
nicklas |
261 |
else if (type == Type.STRING) |
5905 |
12 Dec 11 |
nicklas |
262 |
{ |
5905 |
12 Dec 11 |
nicklas |
263 |
%> |
6428 |
03 Mar 14 |
nicklas |
264 |
<input <%=isRequired%> <%=isDisabled%> type="text" name="<%=fieldName%>" |
5905 |
12 Dec 11 |
nicklas |
265 |
value="<%=HTML.encodeTags((String)value)%>" |
6166 |
11 Oct 12 |
nicklas |
266 |
maxlength="<%=ep.getLength()%>"> |
5905 |
12 Dec 11 |
nicklas |
267 |
<% |
5905 |
12 Dec 11 |
nicklas |
268 |
} |
5905 |
12 Dec 11 |
nicklas |
269 |
else if (type == Type.TEXT) |
5905 |
12 Dec 11 |
nicklas |
270 |
{ |
5908 |
13 Dec 11 |
nicklas |
271 |
addZoom = true; |
5905 |
12 Dec 11 |
nicklas |
272 |
%> |
6428 |
03 Mar 14 |
nicklas |
273 |
<textarea <%=isRequired%> <%=isDisabled%> name="<%=fieldName%>" id="<%=fieldName%>" rows="6" |
5905 |
12 Dec 11 |
nicklas |
274 |
><%=HTML.encodeTags((String)value)%></textarea> |
5905 |
12 Dec 11 |
nicklas |
275 |
<% |
5905 |
12 Dec 11 |
nicklas |
276 |
} |
5905 |
12 Dec 11 |
nicklas |
277 |
else if (type == Type.BOOLEAN) |
5905 |
12 Dec 11 |
nicklas |
278 |
{ |
5905 |
12 Dec 11 |
nicklas |
279 |
Boolean b = (Boolean)value; |
5905 |
12 Dec 11 |
nicklas |
280 |
if (!required) |
5905 |
12 Dec 11 |
nicklas |
281 |
{ |
5905 |
12 Dec 11 |
nicklas |
282 |
%> |
7495 |
11 Jul 18 |
nicklas |
283 |
<input type="radio" <%=isDisabled%> name="<%=fieldName%>" id="<%=fieldName%>.null" value="" |
5905 |
12 Dec 11 |
nicklas |
284 |
<%=b == null ? "checked" : ""%> |
6166 |
11 Oct 12 |
nicklas |
285 |
><label for="<%=fieldName%>.null"><i>- not specified -</i></label><br> |
5905 |
12 Dec 11 |
nicklas |
286 |
<% |
5905 |
12 Dec 11 |
nicklas |
287 |
} |
5905 |
12 Dec 11 |
nicklas |
288 |
%> |
7495 |
11 Jul 18 |
nicklas |
289 |
<input type="radio" <%=isDisabled%> name="<%=fieldName%>" id="<%=fieldName%>.true" value="true" |
5905 |
12 Dec 11 |
nicklas |
290 |
<%=b != null && b == true ? "checked" : ""%> |
6175 |
19 Oct 12 |
nicklas |
291 |
><label for="<%=fieldName%>.true">true</label> |
7495 |
11 Jul 18 |
nicklas |
292 |
<input type="radio" <%=isDisabled%> name="<%=fieldName%>" id="<%=fieldName%>.false" value="false" |
7501 |
09 Aug 18 |
nicklas |
293 |
<%=b != null && b == false || required && b == null ? "checked" : ""%> |
6166 |
11 Oct 12 |
nicklas |
294 |
><label for="<%=fieldName%>.false">false</label> |
5905 |
12 Dec 11 |
nicklas |
295 |
<% |
5905 |
12 Dec 11 |
nicklas |
296 |
} |
5905 |
12 Dec 11 |
nicklas |
297 |
else if (type == Type.DATE) |
5905 |
12 Dec 11 |
nicklas |
298 |
{ |
5905 |
12 Dec 11 |
nicklas |
299 |
%> |
5905 |
12 Dec 11 |
nicklas |
300 |
<table> |
5905 |
12 Dec 11 |
nicklas |
301 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
302 |
<td> |
6428 |
03 Mar 14 |
nicklas |
303 |
<input <%=isRequired%> <%=isDisabled%> type="text" name="<%=fieldName%>" id="<%=fieldName%>" |
5921 |
10 Jan 12 |
nicklas |
304 |
value="<%=dateFormatter.format((Date)value)%>" style="width: 15em;" |
6153 |
28 Sep 12 |
nicklas |
305 |
maxlength="20" title="Enter date in format: <%=dateFormat%>" |
5905 |
12 Dec 11 |
nicklas |
306 |
> |
5905 |
12 Dec 11 |
nicklas |
307 |
</td> |
5905 |
12 Dec 11 |
nicklas |
308 |
<td> |
5905 |
12 Dec 11 |
nicklas |
309 |
<base:button |
6166 |
11 Oct 12 |
nicklas |
310 |
id="<%="btn."+fieldName%>" |
6166 |
11 Oct 12 |
nicklas |
311 |
data-extended-property="<%=name%>" |
5905 |
12 Dec 11 |
nicklas |
312 |
image="calendar.png" |
5905 |
12 Dec 11 |
nicklas |
313 |
title="Calendar…" |
5905 |
12 Dec 11 |
nicklas |
314 |
tooltip="Select a date from a calendar" |
5905 |
12 Dec 11 |
nicklas |
315 |
visible="<%=writePermission%>" |
5905 |
12 Dec 11 |
nicklas |
316 |
/> |
5905 |
12 Dec 11 |
nicklas |
317 |
</td> |
5905 |
12 Dec 11 |
nicklas |
318 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
319 |
</table> |
5905 |
12 Dec 11 |
nicklas |
320 |
<% |
5905 |
12 Dec 11 |
nicklas |
321 |
} |
5905 |
12 Dec 11 |
nicklas |
322 |
else if (type == Type.TIMESTAMP) |
5905 |
12 Dec 11 |
nicklas |
323 |
{ |
5905 |
12 Dec 11 |
nicklas |
324 |
%> |
5905 |
12 Dec 11 |
nicklas |
325 |
<table> |
5905 |
12 Dec 11 |
nicklas |
326 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
327 |
<td> |
6428 |
03 Mar 14 |
nicklas |
328 |
<input <%=isRequired%> <%=isDisabled%> type="text" name="<%=fieldName%>" id="<%=fieldName%>" |
5921 |
10 Jan 12 |
nicklas |
329 |
value="<%=dateTimeFormatter.format((Date)value)%>" style="width: 15em;" |
6153 |
28 Sep 12 |
nicklas |
330 |
maxlength="20" title="Enter timestamp in format: <%=dateTimeFormat%>" |
5905 |
12 Dec 11 |
nicklas |
331 |
> |
5905 |
12 Dec 11 |
nicklas |
332 |
</td> |
5905 |
12 Dec 11 |
nicklas |
333 |
<td> |
5905 |
12 Dec 11 |
nicklas |
334 |
<base:button |
6166 |
11 Oct 12 |
nicklas |
335 |
id="<%="btn."+fieldName%>" |
6166 |
11 Oct 12 |
nicklas |
336 |
data-extended-property="<%=name%>" |
5905 |
12 Dec 11 |
nicklas |
337 |
image="calendar.png" |
5905 |
12 Dec 11 |
nicklas |
338 |
title="Calendar…" |
5905 |
12 Dec 11 |
nicklas |
339 |
tooltip="Select a timestamp from a calendar" |
5905 |
12 Dec 11 |
nicklas |
340 |
visible="<%=writePermission%>" |
5905 |
12 Dec 11 |
nicklas |
341 |
/> |
5905 |
12 Dec 11 |
nicklas |
342 |
</td> |
5905 |
12 Dec 11 |
nicklas |
343 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
344 |
</table> |
5905 |
12 Dec 11 |
nicklas |
345 |
<% |
5905 |
12 Dec 11 |
nicklas |
346 |
} |
3535 |
28 Jun 07 |
martin |
347 |
%> |
5905 |
12 Dec 11 |
nicklas |
348 |
</td> |
5908 |
13 Dec 11 |
nicklas |
349 |
<td style="width: 20px;"> |
6166 |
11 Oct 12 |
nicklas |
350 |
<% |
6166 |
11 Oct 12 |
nicklas |
351 |
if (addZoom) |
5908 |
13 Dec 11 |
nicklas |
352 |
{ |
5908 |
13 Dec 11 |
nicklas |
353 |
%> |
6166 |
11 Oct 12 |
nicklas |
354 |
<base:zoom textarea="<%=fieldName%>" title="<%=HTML.encodeTags(ep.getTitle()) %>" /> |
5908 |
13 Dec 11 |
nicklas |
355 |
<% |
5908 |
13 Dec 11 |
nicklas |
356 |
} |
5908 |
13 Dec 11 |
nicklas |
357 |
%> |
5908 |
13 Dec 11 |
nicklas |
358 |
</td> |
3535 |
28 Jun 07 |
martin |
359 |
</tr> |
3535 |
28 Jun 07 |
martin |
360 |
<% |
3535 |
28 Jun 07 |
martin |
361 |
} |
5905 |
12 Dec 11 |
nicklas |
362 |
} |
5905 |
12 Dec 11 |
nicklas |
363 |
%> |
5905 |
12 Dec 11 |
nicklas |
364 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
365 |
<th>Description</th> |
5905 |
12 Dec 11 |
nicklas |
366 |
<td> |
6166 |
11 Oct 12 |
nicklas |
367 |
<textarea <%=ifDisabled%> rows="5" name="description" id="description"><%=HTML.encodeTags(user.getDescription())%></textarea> |
3535 |
28 Jun 07 |
martin |
368 |
</td> |
5905 |
12 Dec 11 |
nicklas |
369 |
<td style="width: 20px;"> |
6166 |
11 Oct 12 |
nicklas |
370 |
<base:zoom textarea="description" title="Description" /> |
5905 |
12 Dec 11 |
nicklas |
371 |
</td> |
3535 |
28 Jun 07 |
martin |
372 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
373 |
</table> |
5905 |
12 Dec 11 |
nicklas |
374 |
</t:tab> |
5905 |
12 Dec 11 |
nicklas |
375 |
</t:tabcontrol> |
5905 |
12 Dec 11 |
nicklas |
376 |
</form> |
5900 |
07 Dec 11 |
nicklas |
377 |
|
5900 |
07 Dec 11 |
nicklas |
378 |
<base:buttongroup subclass="dialogbuttons"> |
6166 |
11 Oct 12 |
nicklas |
379 |
<base:button id="btnSave" title="Save" visible="<%=writePermission%>"/> |
6166 |
11 Oct 12 |
nicklas |
380 |
<base:button id="close" title="Cancel" visible="<%=writePermission%>"/> |
6166 |
11 Oct 12 |
nicklas |
381 |
<base:button id="close" title="Close" visible="<%=!writePermission%>"/> |
5900 |
07 Dec 11 |
nicklas |
382 |
</base:buttongroup> |
5900 |
07 Dec 11 |
nicklas |
383 |
|
415 |
18 Apr 05 |
nicklas |
384 |
</base:body> |
228 |
23 Mar 05 |
nicklas |
385 |
</base:page> |
228 |
23 Mar 05 |
nicklas |
386 |
<% |
228 |
23 Mar 05 |
nicklas |
387 |
} |
228 |
23 Mar 05 |
nicklas |
388 |
finally |
228 |
23 Mar 05 |
nicklas |
389 |
{ |
228 |
23 Mar 05 |
nicklas |
390 |
if (dc != null) dc.close(); |
228 |
23 Mar 05 |
nicklas |
391 |
} |
228 |
23 Mar 05 |
nicklas |
392 |
%> |