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
RevLine 
[374]1<!-- $Id$ -->
2[% IF NOT user %]
3No user [% username | html %] found.
4[% ELSE %]
[527]5
[1081]6[% INCLUDE 'users/object_header.tt' %]
[374]7
[1162]8<div id="objectform" class="objectform">
[374]9
[1211]10<h2>E-mails:</h2>
11
[497]12<form action="[% c.uri_for(user.id, 'mail') %]" method="POST">
13<input type=hidden name="usermail" value=1>
14<table border=1>
[527]15[% IF c.model('Accounts').db.check_acl(user, 'mail', 'r') %]
[497]16<tr><th>EMail</th>
17<td>
[527]18[% IF c.model('Accounts').db.check_acl(user, 'mail', 'w') %]
19[% showsubmit = 1 %]
[497]20<input type="text" name="mail" value="[% user.get_c_field('mail') | html %]">
[527]21[% ELSE %]
22[% user.get_c_field('mail') | html %]
23[% END %]
[497]24</td>
25</tr>
[527]26[% END %]
[374]27
[1847]28[% IF c.model('Accounts').db.check_acl(user, 'otherEmail', 'r') %]
[1849]29<tr><th>EMail extérieur</th>
[1842]30<td>
[1847]31[% IF c.model('Accounts').db.check_acl(user, 'otherEmail', 'w') %]
[1842]32[% showsubmit = 1 %]
[1859]33<input type="text" name="otherEmail" value="[% user.get_c_field('otherEmail') | html %]">
[1842]34[% ELSE %]
[1847]35[% user.get_c_field('otherEmail') | html %]
[1842]36[% END %]
37</td>
38</tr>
39[% END %]
40
[527]41[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'r') %]
[497]42<tr>
43<th>Aliases</th>
44<td>
[1473]45Existants (activé/désactivé):<br>
[1666]46[% FOREACH alias = user.get_c_field('aliases').sort %]
[527]47[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'w') %]
48[% showsubmit = 1 %]
[497]49[% oalias = c.model('Accounts').db.get_object('aliases', alias) %]
[527]50<input type="text" name="aliases" value="[% alias | html %]" id="[% 'aliases' _ loop.count %]">
[1469]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>
[527]66[% ELSE %]
[1469]67[% alias | html %]
[374]68[% END %]
[1469]69
70<input type=checkbox name="expaliases" value="[% alias %]"
71[% 'checked' IF oalias.get_attributes('exported') %]>
72<br>
73
[528]74[% END %]
[527]75[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'w') %]
76[% showsubmit = 1 %]
[1473]77Ajouter un alias:<br>
[1469]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
[527]95[% END %]
[497]96</td>
97</tr>
[527]98[% END %]
[374]99
[527]100
101[% IF c.model('Accounts').db.check_acl(user, 'forward', 'r') %]
[497]102<tr>
103<th>Renvois</th>
[374]104
[497]105<td>
[1469]106[% oalias = c.model('Accounts').db.get_object('aliases', user.id) %]
[527]107[% IF c.model('Accounts').db.check_acl(user, 'forward', 'w') %]
108[% showsubmit = 1 %]
[530]109<input type="text" name="forward" value="[% user.get_c_field('forward').join(',') | html %]">
[1469]110[% IF oalias %]
111<input type=checkbox name="expaliases" value="[% user.id %]"
112[% 'checked' IF oalias.get_attributes('exported')  %]>
113[% END %]
[527]114[% ELSE %]
[530]115[% user.get_c_field('forward').join(',') | html %]
[527]116[% END %]
[497]117</td>
118</tr>
[527]119[% END %]
[374]120
[527]121[% IF c.model('Accounts').db.check_acl(user, 'revaliases', 'r') %]
[497]122<tr>
123<th>RevAliases</th>
124<td>
[527]125[% IF c.model('Accounts').db.check_acl(user, 'revaliases', 'w') %]
126[% showsubmit = 1 %]
[497]127<input type="text" name="revaliases" value="[% user.get_c_field('revaliases') | html %]">
[527]128[% ELSE %]
129[% user.get_c_field('revaliases') | html %]
130[% END %]
[497]131</td>
132</tr>
[527]133[% END %]
134
135[% IF showsubmit %]
[497]136<tr><td colspan=2>
137<input type="submit">
138</td>
139</tr>
[527]140[% END %]
[497]141</table>
142</form>
143
[374]144</div>
145[% END %]
Note: See TracBrowser for help on using the repository browser.