Merge branch 'MDL-73964-master' of https://github.com/mickhawkins/moodle

This commit is contained in:
Ilya Tregubov 2022-11-23 14:35:02 +03:00
commit 00f66fad8f
5 changed files with 16 additions and 21 deletions

View File

@ -126,13 +126,12 @@ class page_nopermission implements renderable, templatable {
* @return \stdClass
*/
public function export_for_template(renderer_base $output) {
global $CFG;
global $OUTPUT;
$data = (object) [
'pluginbaseurl' => (new moodle_url('/admin/tool/policy'))->out(false),
'haspermissionagreedocs' => $this->haspermissionagreedocs,
'supportname' => $CFG->supportname,
'supportemail' => $CFG->supportemail ?? null,
'supportemail' => $OUTPUT->supportemail(['class' => 'font-weight-bold'])
];
// Get the messages to display.

View File

@ -98,7 +98,7 @@ $string['nopermissiontoagreedocs'] = 'No permission to agree to the policies';
$string['nopermissiontoagreedocs_desc'] = 'Sorry, you do not have the required permissions to agree to the policies.<br />You will not be able to use this site until the following policies are agreed:';
$string['nopermissiontoagreedocsbehalf'] = 'No permission to agree to the policies on behalf of this user';
$string['nopermissiontoagreedocsbehalf_desc'] = 'Sorry, you do not have the required permission to agree to the following policies on behalf of {$a}:';
$string['nopermissiontoagreedocscontact'] = 'For further assistance, please contact';
$string['nopermissiontoagreedocscontact'] = 'For further assistance:';
$string['nopermissiontoviewpolicyversion'] = 'You do not have permissions to view this policy version.';
$string['nopolicies'] = 'There are no policies for registered users with an active version.';
$string['selectpolicyandversion'] = 'Use the filter above to select policy and/or version';

View File

@ -45,7 +45,7 @@
"Policy 2"
],
"supportname": "Admin",
"supportemail": "admin@yoursite.com"
"supportemail": "moodlesite/user/contactsitesupport.php"
}
}}
@ -61,13 +61,10 @@
</ul>
</div>
<p class="mt-3">{{#str}}nopermissiontoagreedocscontact, tool_policy{{/str}}</p>
<div class="agreedoc-officer card">
<div>
<p class="mb-0">{{{supportname}}}</p>
<p class="mb-0"><a href="mailto:{{supportemail}}">{{supportemail}}</a></p>
</div>
</div>
{{#supportemail}}
<p>{{#str}}nopermissiontoagreedocscontact, tool_policy{{/str}}</p>
<p>{{{supportemail}}}</p>
{{/supportemail}}
{{/haspermissionagreedocs}}
{{#js}}

View File

@ -6391,18 +6391,19 @@ function can_send_from_real_email_address($from, $user, $unused = null) {
* @return string
*/
function generate_email_signoff() {
global $CFG;
global $CFG, $OUTPUT;
$signoff = "\n";
if (!empty($CFG->supportname)) {
$signoff .= $CFG->supportname."\n";
}
if (!empty($CFG->supportemail)) {
$signoff .= $CFG->supportemail."\n";
}
if (!empty($CFG->supportpage)) {
$signoff .= $CFG->supportpage."\n";
$supportemail = $OUTPUT->supportemail(['class' => 'font-weight-bold']);
if ($supportemail) {
$signoff .= "\n" . $supportemail . "\n";
}
return $signoff;
}

View File

@ -260,13 +260,11 @@ if ($userform->is_cancelled()) {
$tempuser = $DB->get_record('user', array('id' => $user->id), '*', MUST_EXIST);
$tempuser->email = $emailchanged;
$supportuser = core_user::get_support_user();
$a = new stdClass();
$a->url = $CFG->wwwroot . '/user/emailupdate.php?key=' . $emailchangedkey . '&id=' . $user->id;
$a->site = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID)));
$a->fullname = fullname($tempuser, true);
$a->supportemail = $supportuser->email;
$a->supportemail = $OUTPUT->supportemail();
$emailupdatemessage = get_string('emailupdatemessage', 'auth', $a);
$emailupdatetitle = get_string('emailupdatetitle', 'auth', $a);