diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index f04483afad..aa4e39b0b4 100755 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -83,12 +83,11 @@ if (!empty($group_id)) { } } -/* Tracking */ +/* Tracking */ Event::event_access_tool(TOOL_ANNOUNCEMENT); $announcement_id = isset($_GET['id']) ? intval($_GET['id']) : null; $action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'list'; - $announcement_number = AnnouncementManager::getNumberAnnouncements(); $homeUrl = api_get_self().'?action=list&'.api_get_cidreq(); @@ -97,7 +96,6 @@ $searchFormToString = ''; switch ($action) { case 'move': - if (!$allowToEdit) { api_not_allowed(true); } @@ -119,7 +117,6 @@ switch ($action) { } $announcementInfo = AnnouncementManager::get_by_id($courseId, $thisAnnouncementId); - $sql = "SELECT DISTINCT announcement.id, announcement.display_order FROM $tbl_announcement announcement, $tbl_item_property itemproperty @@ -143,7 +140,6 @@ switch ($action) { Database::query($sql); $sql = "UPDATE $tbl_announcement SET display_order = '$thisAnnouncementOrder' WHERE c_id = $courseId AND id = $nextAnnouncementId"; - Database::query($sql); break; } @@ -479,7 +475,6 @@ switch ($action) { } $announcementInfo = AnnouncementManager::get_by_id($courseId, $id); - if (isset($announcementInfo) && !empty($announcementInfo)) { $to = AnnouncementManager::load_edit_users('announcement', $id); diff --git a/main/inc/lib/AnnouncementManager.php b/main/inc/lib/AnnouncementManager.php index 7b5cca4fe3..6061234e02 100755 --- a/main/inc/lib/AnnouncementManager.php +++ b/main/inc/lib/AnnouncementManager.php @@ -438,8 +438,6 @@ class AnnouncementManager $html .= "$modify_icons"; } - //$toUser = $itemProperty->getToUser(); - //$toUserId = !empty($toUser) ? $toUser->getId() : 0; // The user id is always the current one. $toUserId = api_get_user_id(); $content = self::parseContent( @@ -456,7 +454,8 @@ class AnnouncementManager $html .= Display::dateToStringAgoAndLongDate($lastEdit); $html .= ""; - if (api_is_allowed_to_edit(false, true)) { + $allow = !api_get_configuration_value('hide_announcement_sent_to_users_info'); + if (api_is_allowed_to_edit(false, true) && $allow) { $sent_to = self::sent_to('announcement', $id); $sent_to_form = self::sent_to_form($sent_to); $html .= Display::tag( diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index a64c00cc56..f82f20eda0 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -849,6 +849,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1, // Allow SCORM packages when importing a course // $_configuration['allow_import_scorm_package_in_course_builder'] = false; +// Hide announcement "sent to" label +// $_configuration['hide_announcement_sent_to_users_info'] = false; + // ------ Custom DB changes (keep this at the end) // Add user activation by confirmation email // This option prevents the new user to login in the platform if your account is not confirmed via email