Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
920 | 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" %> |
||
924 | dev | 6 | <%@ taglib uri="/WEB-INF/hostadmiral-core.tld" prefix="core" %> |
920 | dev | 7 | <html> |
8 | |||
9 | <head> |
||
10 | <meta http-equiv="expires" content="0"> |
||
924 | dev | 11 | <title><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></title> |
920 | dev | 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 | |||
924 | dev | 62 | <h1><bean:message key="ak.hostadmiral.page.mail.alias.edit.title" /></h1> |
920 | dev | 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> |
||
924 | dev | 72 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.address" /></th> |
920 | dev | 73 | <td><html:text property="address" /></td> |
74 | <td> </td> |
||
75 | <td> </td> |
||
76 | <td> </td> |
||
77 | </tr> |
||
78 | <tr> |
||
924 | dev | 79 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.domain" /></th> |
920 | dev | 80 | <td> |
81 | <html:select property="domain"> |
||
924 | dev | 82 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.domain.empty"/> |
920 | dev | 83 | <html:options collection="domains" property="id" labelProperty="name" /> |
84 | </html:select> |
||
85 | </td> |
||
86 | <td> </td> |
||
87 | <td> </td> |
||
88 | <td> </td> |
||
89 | </tr> |
||
90 | <tr> |
||
924 | dev | 91 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.owner" /></th> |
920 | dev | 92 | <td> |
93 | <html:select property="owner"> |
||
924 | dev | 94 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.owner.empty"/> |
920 | dev | 95 | <html:options collection="users" property="id" labelProperty="login" /> |
96 | </html:select> |
||
97 | </td> |
||
98 | <td> </td> |
||
99 | <td> </td> |
||
100 | <td> </td> |
||
101 | </tr> |
||
102 | <tr> |
||
924 | dev | 103 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.enabled" /></th> |
920 | dev | 104 | <td><html:checkbox property="enabled" /></td> |
105 | <td> </td> |
||
106 | <td> </td> |
||
107 | <td> </td> |
||
108 | </tr> |
||
109 | <tr> |
||
924 | dev | 110 | <th><bean:message key="ak.hostadmiral.page.mail.alias.edit.comment" /></th> |
920 | dev | 111 | <td><html:textarea property="comment" /></td> |
112 | <td> </td> |
||
113 | <td> </td> |
||
114 | <td> </td> |
||
115 | </tr> |
||
116 | |||
117 | <tr> |
||
924 | dev | 118 | <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> |
||
120 | <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> |
||
920 | dev | 122 | <th> </th> |
123 | </tr> |
||
124 | |||
924 | dev | 125 | <logic:iterate name="ak.hostadmiral.core.form.MailAliasEditForm" property="dests" id="dests" indexId="iid"> |
920 | dev | 126 | <tr> |
127 | <td> |
||
128 | <html:hidden name="dests" property="id" indexed="true" /> |
||
129 | <html:select name="dests" property="mailbox" indexed="true" onchange="mailboxChanged(this)"> |
||
924 | dev | 130 | <html:option value="" key="ak.hostadmiral.page.mail.alias.edit.external"/> |
920 | dev | 131 | <html:options collection="mailboxes" property="id" labelProperty="login" /> |
132 | </html:select> |
||
133 | </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> |
||
924 | dev | 137 | <td><html:submit property="delete.dests" indexed="true"><bean:message key="ak.hostadmiral.page.mail.alias.edit.delete" /></html:submit></td> |
920 | dev | 138 | </tr> |
139 | </logic:iterate> |
||
140 | |||
141 | <tr> |
||
924 | dev | 142 | <td colspan=5><html:submit property="add"><bean:message key="ak.hostadmiral.page.mail.alias.edit.add" /></html:submit></td> |
920 | dev | 143 | <tr> |
144 | </tr> |
||
145 | <td colspan=5> |
||
924 | dev | 146 | <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> |
||
920 | dev | 148 | </td> |
149 | </tr> |
||
150 | </table> |
||
151 | |||
152 | </html:form> |
||
153 | <script>loadForm();</script> |
||
154 | |||
155 | </body> |
||
156 | |||
157 | </html> |