source: trunk/LATMOS-Accounts-Web/root/html/users/mail.tt @ 2103

Last change on this file since 2103 was 1859, checked in by nanardon, 8 years ago

Fix personnalMail not set in web ui

  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1<!-- $Id$ -->
2[% IF NOT user %]
3No user [% username | html %] found.
4[% ELSE %]
5
6[% INCLUDE 'users/object_header.tt' %]
7
8<div id="objectform" class="objectform">
9
10<h2>E-mails:</h2>
11
12<form action="[% c.uri_for(user.id, 'mail') %]" method="POST">
13<input type=hidden name="usermail" value=1>
14<table border=1>
15[% IF c.model('Accounts').db.check_acl(user, 'mail', 'r') %]
16<tr><th>EMail</th>
17<td>
18[% IF c.model('Accounts').db.check_acl(user, 'mail', 'w') %]
19[% showsubmit = 1 %]
20<input type="text" name="mail" value="[% user.get_c_field('mail') | html %]">
21[% ELSE %]
22[% user.get_c_field('mail') | html %]
23[% END %]
24</td>
25</tr>
26[% END %]
27
28[% IF c.model('Accounts').db.check_acl(user, 'otherEmail', 'r') %]
29<tr><th>EMail extérieur</th>
30<td>
31[% IF c.model('Accounts').db.check_acl(user, 'otherEmail', 'w') %]
32[% showsubmit = 1 %]
33<input type="text" name="otherEmail" value="[% user.get_c_field('otherEmail') | html %]">
34[% ELSE %]
35[% user.get_c_field('otherEmail') | html %]
36[% END %]
37</td>
38</tr>
39[% END %]
40
41[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'r') %]
42<tr>
43<th>Aliases</th>
44<td>
45Existants (activé/désactivé):<br>
46[% FOREACH alias = user.get_c_field('aliases').sort %]
47[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'w') %]
48[% showsubmit = 1 %]
49[% oalias = c.model('Accounts').db.get_object('aliases', alias) %]
50<input type="text" name="aliases" value="[% alias | html %]" id="[% 'aliases' _ loop.count %]">
51<span id="[% 'aliases_span' _ loop.count %]"></span>
52
53<script>
54$( function() {
55    $( "#aliases[% loop.count %]" ).on('input', function() {
56        $.ajax({
57            method: "POST",
58            url: '[% c.uri_for('/ajax', 'objexist', 'aliases') %]',
59            data: { val: $(this).val(), attr: 'forward' },
60        }). done(function( msg ) {
61            $( "#aliases_span[% loop.count %]" ).html (msg);
62        });
63    });
64});
65</script>
66[% ELSE %]
67[% alias | html %]
68[% END %]
69
70<input type=checkbox name="expaliases" value="[% alias %]"
71[% 'checked' IF oalias.get_attributes('exported') %]>
72<br>
73
74[% END %]
75[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'w') %]
76[% showsubmit = 1 %]
77Ajouter un alias:<br>
78<input type="text" name="aliases" value="" id="aliases0">
79<span id="[% 'aliases_span' _ 0 %]"></span>
80
81<script>
82$( function() {
83    $( "#aliases0" ).on('input', function() {
84        $.ajax({
85            method: "POST",
86            url: '[% c.uri_for('/ajax', 'objexist', 'aliases') %]',
87            data: { val: $(this).val(), attr: 'forward' },
88        }). done(function( msg ) {
89            $( "#aliases_span0" ).html (msg);
90        });
91    });
92});
93</script>
94
95[% END %]
96</td>
97</tr>
98[% END %]
99
100
101[% IF c.model('Accounts').db.check_acl(user, 'forward', 'r') %]
102<tr>
103<th>Renvois</th>
104
105<td>
106[% oalias = c.model('Accounts').db.get_object('aliases', user.id) %]
107[% IF c.model('Accounts').db.check_acl(user, 'forward', 'w') %]
108[% showsubmit = 1 %]
109<input type="text" name="forward" value="[% user.get_c_field('forward').join(',') | html %]">
110[% IF oalias %]
111<input type=checkbox name="expaliases" value="[% user.id %]"
112[% 'checked' IF oalias.get_attributes('exported')  %]>
113[% END %]
114[% ELSE %]
115[% user.get_c_field('forward').join(',') | html %]
116[% END %]
117</td>
118</tr>
119[% END %]
120
121[% IF c.model('Accounts').db.check_acl(user, 'revaliases', 'r') %]
122<tr>
123<th>RevAliases</th>
124<td>
125[% IF c.model('Accounts').db.check_acl(user, 'revaliases', 'w') %]
126[% showsubmit = 1 %]
127<input type="text" name="revaliases" value="[% user.get_c_field('revaliases') | html %]">
128[% ELSE %]
129[% user.get_c_field('revaliases') | html %]
130[% END %]
131</td>
132</tr>
133[% END %]
134
135[% IF showsubmit %]
136<tr><td colspan=2>
137<input type="submit">
138</td>
139</tr>
140[% END %]
141</table>
142</form>
143
144</div>
145[% END %]
Note: See TracBrowser for help on using the repository browser.