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