Commit 80887202 authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review
Browse files

Merge "Display locked email as uneditable on Edit profile page (bug #917935)"

parents 17d64420 61c9b6eb
...@@ -134,6 +134,9 @@ foreach ( $element_list as $element => $type ) { ...@@ -134,6 +134,9 @@ foreach ( $element_list as $element => $type ) {
if (isset($lockedfields[$element]) && !$USER->get('admin')) { if (isset($lockedfields[$element]) && !$USER->get('admin')) {
$items[$element]['disabled'] = true; $items[$element]['disabled'] = true;
if ($element == 'email') {
$items[$element]['help'] = false;
}
} }
} }
......
...@@ -71,6 +71,7 @@ function pieform_element_emaillist(Pieform $form, $element) { ...@@ -71,6 +71,7 @@ function pieform_element_emaillist(Pieform $form, $element) {
$smarty->assign('name', $element['name']); $smarty->assign('name', $element['name']);
$smarty->assign('addbuttonstr', get_string('addbutton', 'artefact.internal')); $smarty->assign('addbuttonstr', get_string('addbutton', 'artefact.internal'));
$smarty->assign('validationemailstr', json_encode(get_string('validationemailwillbesent', 'artefact.internal'))); $smarty->assign('validationemailstr', json_encode(get_string('validationemailwillbesent', 'artefact.internal')));
$smarty->assign('disabled', !empty($element['disabled']));
return $smarty->fetch('form/emaillist.tpl'); return $smarty->fetch('form/emaillist.tpl');
} }
......
{{if $disabled}}
{{foreach from=$validated item=email}}
<div class="validated">
<label>
<input disabled {{if $email == $default}} checked{{/if}} type="radio" name="{{$name}}_locked" value="{{$email}}">
{{$email}}
</label>
</div>
<input type="hidden" name="{{$name}}_valid[]" value="{{$email}}">
{{if $email == $default}}<input type="hidden" name="{{$name}}_selected" value="{{$email}}">{{/if}}
{{/foreach}}
{{foreach from=$unvalidated item=email}}
<div class="unvalidated">{{$email}}</div>
<input type="hidden" name="{{$name}}_invalid[]" value="{{$email}}">
{{/foreach}}
{{else}}
<script type="text/javascript"> <script type="text/javascript">
var {{$name}}_newrefinput = null; var {{$name}}_newrefinput = null;
var {{$name}}_newref = null; var {{$name}}_newref = null;
...@@ -79,3 +95,4 @@ ...@@ -79,3 +95,4 @@
{{/foreach}} {{/foreach}}
</div> </div>
<a href="" onclick="{{$name}}_new(); return false;">{{str tag="addemail"}}</a> <a href="" onclick="{{$name}}_new(); return false;">{{str tag="addemail"}}</a>
{{/if}}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment