diff --git a/main/announcements/announcements.inc.php b/main/announcements/announcements.inc.php index d7ce1f31b0..eb846bdc48 100644 --- a/main/announcements/announcements.inc.php +++ b/main/announcements/announcements.inc.php @@ -60,11 +60,12 @@ class AnnouncementManager { $sql="SELECT DISTINCT announcement.id, announcement.title, announcement.content FROM $tbl_announcement announcement, $tbl_item_property toolitemproperties - WHERE announcement.id = toolitemproperties.ref - AND toolitemproperties.tool='announcement' - AND announcement.session_id = '$session_id' AND - c_id = $course_id - ORDER BY display_order DESC"; + WHERE announcement.id = toolitemproperties.ref AND + toolitemproperties.tool='announcement' AND + announcement.session_id = '$session_id' AND + announcement.c_id = $course_id AND + toolitemproperties.c_id = $course_id + ORDER BY display_order DESC"; $rs = Database::query($sql); $num_rows = Database::num_rows($rs); $result = array(); @@ -111,6 +112,7 @@ class AnnouncementManager { */ public static function delete_all_announcements($_course) { $announcements = self::get_all_annoucement_by_course($_course, api_get_session_id()); + foreach ($announcements as $annon) { api_item_property_update($_course, TOOL_ANNOUNCEMENT, $annon['id'], 'delete', api_get_user_id()); @@ -569,8 +571,7 @@ class AnnouncementManager { foreach ($group_users as $user){ echo ''; } - echo ''; - + echo ''; echo ""; // the buttons for adding or removing groups/users diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index b497322800..ceddafd9c6 100644 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -779,12 +779,13 @@ if ($display_form) { if ($announcement_to_modify=='') { ($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked=''; echo '
-
- +
-
'. - get_lang('EmailOption').': '.get_lang('MyGroup').'  '.get_lang('ModifyRecipientList').''; - AnnouncementManager::show_to_form_group($_SESSION['toolgroup']); +
+ + '.get_lang('EmailOption').': '.get_lang('MyGroup').'   + '.get_lang('ModifyRecipientList').''; + AnnouncementManager::show_to_form_group($_SESSION['toolgroup']); echo '
'; } @@ -832,10 +833,11 @@ if ($display_form) { //File attachment echo '
-
-  '.get_lang('AddAnAttachment').' +
+  '.get_lang('AddAnAttachment').' +