Hide announcement "sent to" label see BT#14365

Setting: "hide_announcement_sent_to_users_info
pull/2484/merge
jmontoyaa 8 years ago
parent eaec2d3ec5
commit 76040c66b3
  1. 7
      main/announcements/announcements.php
  2. 5
      main/inc/lib/AnnouncementManager.php
  3. 3
      main/install/configuration.dist.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);

@ -438,8 +438,6 @@ class AnnouncementManager
$html .= "<tr><th style='text-align:right'>$modify_icons</th></tr>";
}
//$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 .= "</td></tr>";
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(

@ -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

Loading…
Cancel
Save