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