Skip to content

Commit

Permalink
MDL-40669 tool_uploaduser: allow emailstop to be set during upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Sep 15, 2019
1 parent 1c3efe4 commit c4e79fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/tool/uploaduser/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);

// array of all valid fields for validation
$STD_FIELDS = array('id', 'username', 'email',
$STD_FIELDS = array('id', 'username', 'email', 'emailstop',
'city', 'country', 'lang', 'timezone', 'mailformat',
'maildisplay', 'maildigest', 'htmleditor', 'autosubscribe',
'institution', 'department', 'idnumber', 'skype',
Expand Down
5 changes: 5 additions & 0 deletions admin/tool/uploaduser/user_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ function definition () {
$mform->setDefault('maildisplay', core_user::get_property_default('maildisplay'));
$mform->addHelpButton('maildisplay', 'emaildisplay');

$choices = array(0 => get_string('emailenable'), 1 => get_string('emaildisable'));
$mform->addElement('select', 'emailstop', get_string('emailstop'), $choices);
$mform->setDefault('emailstop', core_user::get_property_default('emailstop'));
$mform->setAdvanced('emailstop');

$choices = array(0 => get_string('textformat'), 1 => get_string('htmlformat'));
$mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
$mform->setDefault('mailformat', core_user::get_property_default('mailformat'));
Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
$string['emailresetconfirmsent'] = 'An email has been sent to your address at <b>{$a}</b>.
<br />It contains easy instructions to confirm and complete this password change.
If you continue to have difficulty, contact the site administrator.';
$string['emailstop'] = 'Email stop';
$string['emailtoprivatefiles'] = 'You can also e-mail files as attachments straight to your private files space. Simply attach your files to an e-mail and send it to {$a}';
$string['emailtoprivatefilesdenied'] = 'Your administrator has disabled the option to upload your own private files.';
$string['emailvia'] = '{$a->name} (via {$a->siteshortname})';
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ protected static function fill_properties_cache() {
$fields['lastname'] = array('type' => PARAM_NOTAGS, 'null' => NULL_NOT_ALLOWED);
$fields['surname'] = array('type' => PARAM_NOTAGS, 'null' => NULL_NOT_ALLOWED);
$fields['email'] = array('type' => PARAM_RAW_TRIMMED, 'null' => NULL_NOT_ALLOWED);
$fields['emailstop'] = array('type' => PARAM_INT, 'null' => NULL_NOT_ALLOWED);
$fields['emailstop'] = array('type' => PARAM_INT, 'null' => NULL_NOT_ALLOWED, 'default' => 0);
$fields['icq'] = array('type' => PARAM_NOTAGS, 'null' => NULL_NOT_ALLOWED);
$fields['skype'] = array('type' => PARAM_NOTAGS, 'null' => NULL_ALLOWED);
$fields['aim'] = array('type' => PARAM_NOTAGS, 'null' => NULL_NOT_ALLOWED);
Expand Down

0 comments on commit c4e79fc

Please sign in to comment.