Skip to content

Commit

Permalink
small refactoring: move simple "from"/"to" strings into booking (has …
Browse files Browse the repository at this point in the history
…been removed in Moodle 4.4)
  • Loading branch information
semteacher committed Jul 18, 2024
1 parent da8f99f commit 729ad8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/booking_rules/actions/send_copy_of_mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public function set_actiondata_from_json(string $json) {

$userfrom = singleton_service::get_instance_of_user((int) $datafromevent['userid']);
$userfromformatted = "$userfrom->firstname $userfrom->lastname <$userfrom->email>";
$userfromformatted = "<b>" . get_string('fromsender') . "</b>: $userfromformatted<br>";
$userfromformatted = "<b>" . get_string('from', 'mod_booking') . "</b>: $userfromformatted<br>";

$usertoformatted = '';
if (!empty($datafromevent['relateduserid'])) {
$userto = singleton_service::get_instance_of_user((int) $datafromevent['relateduserid']);
$usertoformatted .= "$userto->firstname $userto->lastname &lt;$userto->email&gt;";
$usertoformatted = "<b>" . get_string('torecipient') . "</b>: $usertoformatted<br>";
$usertoformatted = "<b>" . get_string('to', 'mod_booking') . "</b>: $usertoformatted<br>";
}

$this->subject = $actiondata->subjectprefix . ": " . $datafromevent['other']->subject;
Expand Down
2 changes: 2 additions & 0 deletions lang/en/booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,8 @@
$string['messagesubject'] = 'Subject';
$string['messagetext'] = 'Message';
$string['sendmessage'] = 'Send message';
$string['from'] = 'From';
$string['to'] = 'To';

// Teachers_handler.php.
$string['teachersforoption'] = 'Teachers';
Expand Down

0 comments on commit 729ad8c

Please sign in to comment.