Fix function params see #8144

ofaj
jmontoya 9 years ago
parent c220189ee8
commit 7aa819cf0e
  1. 14
      main/announcements/announcements.php
  2. 4
      main/inc/lib/AnnouncementManager.php
  3. 1
      main/inc/lib/agenda.lib.php

@ -51,6 +51,7 @@ $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$course_id = api_get_course_int_id();
$_course = api_get_course_info_by_id($course_id);
$group_id = api_get_group_id();
$sessionId = api_get_session_id();
api_protect_course_group(GroupManager::GROUP_TOOL_ANNOUNCEMENT);
@ -142,7 +143,7 @@ switch ($action) {
);
$searchForm->addElement('text', 'keyword', get_lang('Title'));
$users = CourseManager::get_user_list_from_course_code(api_get_course_id(), api_get_session_id());
$users = CourseManager::get_user_list_from_course_code(api_get_course_id(), $sessionId);
$userList = array('' => '');
if (!empty($users)) {
foreach ($users as $user) {
@ -270,7 +271,7 @@ switch ($action) {
case 'delete':
/* Delete announcement */
$id = intval($_GET['id']);
if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
if ($sessionId != 0 && api_is_allowed_to_session_edit(false, true) == false) {
api_not_allowed();
}
@ -302,7 +303,7 @@ switch ($action) {
case 'showhide':
if (!isset($_GET['isStudentView']) || $_GET['isStudentView'] != 'false') {
if (isset($_GET['id']) && $_GET['id']) {
if (api_get_session_id() != 0 &&
if ($sessionId != 0 &&
api_is_allowed_to_session_edit(false, true) == false
) {
api_not_allowed();
@ -326,7 +327,7 @@ switch ($action) {
break;
case 'add':
case 'modify':
if (api_get_session_id() != 0 &&
if ($sessionId != 0 &&
api_is_allowed_to_session_edit(false, true) == false
) {
api_not_allowed(true);
@ -371,7 +372,7 @@ switch ($action) {
$to = Tracking:: getInactiveStudentsInCourse(
api_get_course_int_id(),
$since,
api_get_session_id()
$sessionId
);
// setting the variables for the form elements: the users who need to receive the message
foreach ($to as &$user) {
@ -473,7 +474,7 @@ switch ($action) {
$form->addElement('textarea', 'file_comment', get_lang('FileComment'));
$form->addElement('hidden', 'sec_token', $stok);
if (api_get_session_id() == 0) {
if (empty($sessionId)) {
$form->addCheckBox('send_to_users_in_session', null, get_lang('SendToUsersInSessions'));
}
@ -533,6 +534,7 @@ switch ($action) {
$data['users'],
$file,
$file_comment,
null,
$sendToUsersInSession
);
} else {

@ -386,7 +386,6 @@ class AnnouncementManager
if (empty($last_id)) {
return false;
} else {
$sql = "UPDATE $tbl_announcement SET id = iid WHERE iid = $last_id";
Database::query($sql);
@ -399,7 +398,6 @@ class AnnouncementManager
}
// store in item_property (first the groups, then the users
if (empty($sentTo) || !empty($sentTo) &&
isset($sentTo[0]) && $sentTo[0] == 'everyone'
) {
@ -460,6 +458,8 @@ class AnnouncementManager
* @param $to_users
* @param array $file
* @param string $file_comment
* @param bool $sendToUsersInSession
*
* @return bool|int
*/
public static function add_group_announcement(

@ -2150,7 +2150,6 @@ class Agenda
);
}
if ($id) {
$form->addButtonUpdate(get_lang('ModifyEvent'));
} else {

Loading…
Cancel
Save