Rev 1216 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1216 | Rev 1223 | ||
---|---|---|---|
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
2 | <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> |
2 | <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> |
3 | <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> |
3 | <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> |
4 | <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> |
4 | <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> |
5 | <%@ taglib uri="/WEB-INF/ak-backpath.tld" prefix="backpath" %> |
5 | <%@ taglib uri="/WEB-INF/ak-backpath.tld" prefix="backpath" %> |
6 | <%@ taglib uri="/WEB-INF/ak-strutsx.tld" prefix="strutsx" %> |
6 | <%@ taglib uri="/WEB-INF/ak-strutsx.tld" prefix="strutsx" %> |
7 | <%@ taglib uri="/WEB-INF/hostadmiral-core.tld" prefix="core" %> |
7 | <%@ taglib uri="/WEB-INF/hostadmiral-core.tld" prefix="core" %> |
8 | <html> |
8 | <html> |
9 | 9 | ||
10 | <head> |
10 | <head> |
11 | <meta http-equiv="expires" content="0"> |
11 | <meta http-equiv="expires" content="0"> |
12 | <title><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></title> |
12 | <title><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></title> |
13 | <link rel="stylesheet" type="text/css" href="<strutsx:root />/style/general.css"> |
13 | <link rel="stylesheet" type="text/css" href="<strutsx:root />/style/general.css"> |
14 | <script> |
14 | <script> |
15 | function submitForm() |
15 | function submitForm() |
16 | { |
16 | { |
17 | idx = 0; |
17 | idx = 0; |
18 | while(true) { |
18 | while(true) { |
19 | var t = document.forms[0].elements["dests[" + (idx++) + "].email"]; |
19 | var t = document.forms[0].elements["dests[" + (idx++) + "].email"]; |
20 | if(t) t.disabled = false; |
20 | if(t) t.disabled = false; |
21 | else break; |
21 | else break; |
22 | } |
22 | } |
23 | } |
23 | } |
24 | 24 | ||
25 | function loadForm() |
25 | function loadForm() |
26 | { |
26 | { |
27 | idx = 0; |
27 | idx = 0; |
28 | while(true) { |
28 | while(true) { |
29 | var s = document.forms[0].elements["dests[" + (idx++) + "].mailbox"]; |
29 | var s = document.forms[0].elements["dests[" + (idx++) + "].mailbox"]; |
30 | if(s) mailboxChanged(s); |
30 | if(s) mailboxChanged(s); |
31 | else break; |
31 | else break; |
32 | } |
32 | } |
33 | } |
33 | } |
34 | 34 | ||
35 | function mailboxChanged(s) |
35 | function mailboxChanged(s) |
36 | { |
36 | { |
37 | // extract index |
37 | // extract index |
38 | var name = s.name; |
38 | var name = s.name; |
39 | var i1 = name.indexOf("["); |
39 | var i1 = name.indexOf("["); |
40 | var i2 = name.indexOf("]"); |
40 | var i2 = name.indexOf("]"); |
41 | 41 | ||
42 | if(i1 < 0 || i2 < 0) return; |
42 | if(i1 < 0 || i2 < 0) return; |
43 | 43 | ||
44 | var idx = name.substring(i1+1, i2); |
44 | var idx = name.substring(i1+1, i2); |
45 | 45 | ||
46 | // find text field |
46 | // find text field |
47 | var t = document.forms[0].elements["dests[" + idx + "].email"]; |
47 | var t = document.forms[0].elements["dests[" + idx + "].email"]; |
48 | 48 | ||
49 | // change status |
49 | // change status |
50 | if(t) { |
50 | if(t) { |
51 | if(s.options[s.selectedIndex] && s.options[s.selectedIndex].value != '') { |
51 | if(s.options[s.selectedIndex] && s.options[s.selectedIndex].value != '') { |
52 | t.disabled = true; |
52 | t.disabled = true; |
53 | } |
53 | } |
54 | else { |
54 | else { |
55 | t.disabled = false; |
55 | t.disabled = false; |
56 | } |
56 | } |
57 | } |
57 | } |
58 | } |
58 | } |
59 | </script> |
59 | </script> |
60 | </head> |
60 | </head> |
61 | 61 | ||
62 | <body> |
62 | <body> |
63 | 63 | ||
64 | <h1><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></h1> |
64 | <h1><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></h1> |
65 | 65 | ||
66 | <strutsx:errorsIterator id="errors" /> |
66 | <strutsx:errorsIterator id="errors" /> |
67 | <strutsx:notEmpty name="errors"> |
67 | <strutsx:notEmpty name="errors"> |
68 | <div class="error"><bean:message key="ak.hostadmiral.page.general.errors" />: |
68 | <div class="error"><bean:message key="ak.hostadmiral.page.general.errors" />: |
69 | <ul> |
69 | <ul> |
70 | <logic:iterate name="errors" id="error"> |
70 | <logic:iterate name="errors" id="error"> |
71 | <li><strutsx:message name="error" property="key" valuesProperty="values" /></li> |
71 | <li><strutsx:message name="error" property="key" valuesProperty="values" /></li> |
72 | </logic:iterate> |
72 | </logic:iterate> |
73 | </ul> |
73 | </ul> |
74 | </div> |
74 | </div> |
75 | </strutsx:notEmpty> |
75 | </strutsx:notEmpty> |
76 | 76 | ||
77 | <html:form action="/mail/alias/submit" onsubmit="submitForm()"> |
77 | <html:form action="/mail/alias/submit" onsubmit="submitForm()"> |
78 | <backpath:current/> |
78 | <backpath:current/> |
79 | <html:hidden property="id" /> |
79 | <html:hidden property="id" /> |
80 | 80 | ||
81 | <table border=1> |
81 | <table border=1> |
82 | <tr> |
82 | <tr> |
83 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.address" /></th> |
83 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.address" /></th> |
84 | <td><html:text property="address" /></td> |
84 | <td><html:text property="address" /></td> |
85 | <td> </td> |
85 | <td> </td> |
86 | <td> </td> |
86 | <td> </td> |
87 | <td> </td> |
87 | <td> </td> |
88 | </tr> |
88 | </tr> |
89 | <tr> |
89 | <tr> |
90 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.domain" /></th> |
90 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.domain" /></th> |
91 | <td> |
91 | <td> |
92 | <html:select property="domain"> |
92 | <html:select property="domain"> |
93 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.domain.empty"/> |
93 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.domain.empty"/> |
94 | <html:options collection="domains" property="id" labelProperty="name" /> |
94 | <html:options collection="domains" property="id" labelProperty="name" /> |
95 | </html:select> |
95 | </html:select> |
96 | </td> |
96 | </td> |
97 | <td> </td> |
97 | <td> </td> |
98 | <td> </td> |
98 | <td> </td> |
99 | <td> </td> |
99 | <td> </td> |
100 | </tr> |
100 | </tr> |
101 | <tr> |
101 | <tr> |
102 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.owner" /></th> |
102 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.owner" /></th> |
103 | <td> |
103 | <td> |
104 | <html:select property="owner"> |
104 | <html:select property="owner"> |
105 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.owner.empty"/> |
105 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.owner.empty"/> |
106 | <html:options collection="users" property="id" labelProperty="login" /> |
106 | <html:options collection="users" property="id" labelProperty="login" /> |
107 | </html:select> |
107 | </html:select> |
108 | </td> |
108 | </td> |
109 | <td> </td> |
109 | <td> </td> |
110 | <td> </td> |
110 | <td> </td> |
111 | <td> </td> |
111 | <td> </td> |
112 | </tr> |
112 | </tr> |
113 | <tr> |
113 | <tr> |
114 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.enabled" /></th> |
114 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.enabled" /></th> |
115 | <td><html:checkbox property="enabled" /></td> |
115 | <td><html:checkbox property="enabled" /></td> |
116 | <td> </td> |
116 | <td> </td> |
117 | <td> </td> |
117 | <td> </td> |
118 | <td> </td> |
118 | <td> </td> |
119 | </tr> |
119 | </tr> |
120 | <tr> |
120 | <tr> |
121 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.comment" /></th> |
121 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.comment" /></th> |
122 | <td><html:textarea property="comment" /></td> |
122 | <td><html:textarea property="comment" /></td> |
123 | <td> </td> |
123 | <td> </td> |
124 | <td> </td> |
124 | <td> </td> |
125 | <td> </td> |
125 | <td> </td> |
126 | </tr> |
126 | </tr> |
127 | 127 | ||
128 | <tr> |
128 | <tr> |
129 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.tomailbox" /></th> |
129 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.tomailbox" /></th> |
130 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.toexternal" /></th> |
130 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.toexternal" /></th> |
131 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.enabled" /></th> |
131 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.enabled" /></th> |
132 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.comment" /></th> |
132 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.header.comment" /></th> |
133 | <th> </th> |
133 | <th> </th> |
134 | </tr> |
134 | </tr> |
135 | 135 | ||
136 | <logic:iterate name="MailAliasEditForm" property="dests" id="dests" indexId="iid"> |
136 | <logic:iterate name="MailAliasEditForm" property="dests" id="dests" indexId="iid"> |
137 | <tr> |
137 | <tr> |
138 | <td> |
138 | <td> |
139 | <html:hidden name="dests" property="id" indexed="true" /> |
139 | <html:hidden name="dests" property="id" indexed="true" /> |
140 | <html:select name="dests" property="mailbox" indexed="true" onchange="mailboxChanged(this)"> |
140 | <html:select name="dests" property="mailbox" indexed="true" onchange="mailboxChanged(this)"> |
141 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.external"/> |
141 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.external"/> |
142 | <html:options collection="mailboxes" property="id" labelProperty="login" /> |
142 | <html:options collection="mailboxes" property="id" labelProperty="login" /> |
143 | </html:select> |
143 | </html:select> |
144 | </td> |
144 | </td> |
145 | <td><html:text name="dests" property="email" indexed="true" /></td> |
145 | <td><html:text name="dests" property="email" indexed="true" /></td> |
146 | <td><html:checkbox name="dests" property="enabled" indexed="true" /></td> |
146 | <td><html:checkbox name="dests" property="enabled" indexed="true" /></td> |
147 | <td><html:text name="dests" property="comment" indexed="true" /></td> |
147 | <td><html:text name="dests" property="comment" indexed="true" /></td> |
148 | <td><html:submit property="delete.dests" indexed="true"><bean:message key="ak.hostadmiral.page.mail.alias.edit.delete" /></html:submit></td> |
148 | <td><html:submit property="delete.dests" indexed="true"><bean:message key="ak.hostadmiral.page.mail.alias.edit.delete" /></html:submit></td> |
149 | </tr> |
149 | </tr> |
150 | </logic:iterate> |
150 | </logic:iterate> |
151 | 151 | ||
152 | <tr> |
152 | <tr> |
153 | <td colspan=5><html:submit property="add"><bean:message key="ak.hostadmiral.page.mail.alias.edit.add" /></html:submit></td> |
153 | <td colspan=5><html:submit property="add"><bean:message key="ak.hostadmiral.page.mail.alias.edit.add" /></html:submit></td> |
154 | <tr> |
154 | <tr> |
155 | </tr> |
155 | </tr> |
156 | <td colspan=5> |
156 | <td colspan=5> |
157 | <html:submit property="submit"><bean:message key="ak.hostadmiral.page.mail.alias.edit.submit" /></html:submit> |
157 | <html:submit property="submit"><bean:message key="ak.hostadmiral.page.mail.alias.edit.submit" /></html:submit> |
158 | <backpath:backlink><bean:message key="ak.hostadmiral.page.mail.alias.edit.back" /></backpath:backlink> |
158 | <backpath:backlink><bean:message key="ak.hostadmiral.page.mail.alias.edit.back" /></backpath:backlink> |
159 | </td> |
159 | </td> |
160 | </tr> |
160 | </tr> |
161 | </table> |
161 | </table> |
162 | 162 | ||
163 | </html:form> |
163 | </html:form> |
164 | <script>loadForm();</script> |
164 | <script>loadForm();</script> |
165 | 165 | ||
166 | <p>FIXME: show mailbox@domain for destinations, not just mailbox</p> |
166 | <p>FIXME: show mailbox@domain for destinations, not just mailbox</p> |
167 | 167 | ||
168 | <p> |
168 | <p> |
169 | <bean:message key="ak.hostadmiral.page.general.version" />: |
169 | <bean:message key="ak.hostadmiral.page.general.version" />: |
170 | <bean:write name="projectVersion" /> |
170 | <bean:write name="projectVersion" /> |
171 | </p> |
171 | </p> |
172 | 172 | ||
173 | </body> |
173 | </body> |
174 | 174 | ||
175 | </html> |
175 | </html> |