Skip to content

Commit

Permalink
Announcements: fix tags error. uncheck (by default) `send mail to a…
Browse files Browse the repository at this point in the history
…ll users` option while editing an announcement.

--HG--
branch : 3.11
  • Loading branch information
jexi committed May 24, 2021
1 parent c3c3fb4 commit 2db0143
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/announcements/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ class : 'form-control input-sm',
} else {
$is_visible = 0;
}

$antitle = $_POST['antitle'];
$newContent = purify($_POST['newContent']);
$send_mail = isset($_POST['recipients']) && (count($_POST['recipients'])>0);
Expand Down Expand Up @@ -463,9 +462,8 @@ class : 'form-control input-sm',
$newContent, $antitle, $start_display, $stop_display, $is_visible, $id);
$log_type = LOG_MODIFY;
$message = "<div class='alert alert-success'>$langAnnModify</div>";

if (isset($_POST['tags'])) {
$tagsArray = explode(',', $_POST['tags']);
$tagsArray = $_POST['tags'];
$moduleTag = new ModuleElement($id);
$moduleTag->syncTags($tagsArray);
}
Expand Down Expand Up @@ -689,8 +687,12 @@ class : 'form-control input-sm',
WHERE cu.course_id = ?d
AND u.email<>''
AND u.email IS NOT NULL ORDER BY u.surname, u.givenname", $course_id);

$tool_content .= "<option value='-1' selected><h2>$langAllUsers</h2></option>";
if (isset($_GET['addAnnounce'])) {
$selected = 'selected';
} else {
$selected = '';
}
$tool_content .= "<option value='-1' $selected><h2>$langAllUsers</h2></option>";
foreach($course_users as $cu) {
$tool_content .= "<option value='" . q($cu->user_id) . "'>" . q($cu->name) . " (" . q($cu->email) . ")</option>";
}
Expand Down

0 comments on commit 2db0143

Please sign in to comment.