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