Rev 905 | Rev 915 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
899 | dev | 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
913 | dev | 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" %> |
||
899 | dev | 7 | <html> |
8 | |||
9 | <head> |
||
10 | <meta http-equiv="expires" content="0"> |
||
905 | dev | 11 | <title><bean:message key="ak.hostcaptain.page.mail.alias.edit.title" /></title> |
899 | 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 | |||
905 | dev | 62 | <h1><bean:message key="ak.hostcaptain.page.mail.alias.edit.title" /></h1> |
899 | 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 | <p> |
||
905 | dev | 71 | <bean:message key="ak.hostcaptain.page.mail.alias.edit.address" />: |
899 | dev | 72 | <html:text property="address" /> |
73 | <br> |
||
74 | |||
905 | dev | 75 | <bean:message key="ak.hostcaptain.page.mail.alias.edit.domain" />: |
899 | dev | 76 | <html:select property="domain"> |
905 | dev | 77 | <html:option value="" key="ak.hostcaptain.page.mail.alias.edit.domain.empty"/> |
899 | dev | 78 | <html:options collection="domains" property="id" labelProperty="name" /> |
79 | </html:select> |
||
80 | <br> |
||
81 | |||
905 | dev | 82 | <bean:message key="ak.hostcaptain.page.mail.alias.edit.owner" />: |
899 | dev | 83 | <html:select property="owner"> |
905 | dev | 84 | <html:option value="" key="ak.hostcaptain.page.mail.alias.edit.owner.empty"/> |
899 | dev | 85 | <html:options collection="users" property="id" labelProperty="login" /> |
86 | </html:select> |
||
87 | <br> |
||
913 | dev | 88 | |
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> |
||
899 | dev | 96 | </p> |
97 | |||
98 | <table> |
||
99 | <tr> |
||
905 | dev | 100 | <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> |
||
899 | dev | 102 | <th> </th> |
103 | </tr> |
||
104 | |||
905 | dev | 105 | <logic:iterate name="ak.hostcaptain.core.form.MailAliasEditForm" property="dests" id="dests" indexId="iid"> |
899 | dev | 106 | <tr> |
107 | <td> |
||
108 | <html:hidden name="dests" property="id" indexed="true" /> |
||
109 | <html:select name="dests" property="mailbox" indexed="true" onchange="mailboxChanged(this)"> |
||
905 | dev | 110 | <html:option value="" key="ak.hostcaptain.page.mail.alias.edit.external"/> |
899 | dev | 111 | <html:options collection="mailboxes" property="id" labelProperty="login" /> |
112 | </html:select> |
||
113 | </td> |
||
114 | <td><html:text name="dests" property="email" indexed="true" /></td> |
||
905 | dev | 115 | <td><html:submit property="delete.dests" indexed="true"><bean:message key="ak.hostcaptain.page.mail.alias.edit.delete" /></html:submit></td> |
899 | dev | 116 | </tr> |
117 | </logic:iterate> |
||
118 | |||
119 | <tr> |
||
905 | dev | 120 | <td colspan=3><html:submit property="add"><bean:message key="ak.hostcaptain.page.mail.alias.edit.add" /></html:submit></td> |
899 | dev | 121 | <tr> |
122 | </tr> |
||
123 | <td colspan=3> |
||
905 | dev | 124 | <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> |
||
899 | dev | 126 | </td> |
127 | </tr> |
||
128 | </table> |
||
129 | |||
130 | </html:form> |
||
131 | <script>loadForm();</script> |
||
132 | |||
133 | </body> |
||
134 | |||
135 | </html> |