diff --git a/main/admin/calendar.lib.php b/main/admin/calendar.lib.php index 92e7f76ef7..a78bdb7e63 100644 --- a/main/admin/calendar.lib.php +++ b/main/admin/calendar.lib.php @@ -1637,9 +1637,7 @@ function get_agendaitems($month, $year) //databases of the courses $TABLEAGENDA = Database :: get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); - //$TABLE_ITEMPROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY); - //$group_memberships = GroupManager :: get_group_ids(Database::get_current_course_database(), $_user['user_id']); // if the user is administrator of that course we show all the agenda items //if (api_is_allowed_to_edit()) //{ diff --git a/main/admin/special_exports.php b/main/admin/special_exports.php index a61fd9f699..fca6e4d9ec 100644 --- a/main/admin/special_exports.php +++ b/main/admin/special_exports.php @@ -68,7 +68,7 @@ if ((isset ($_POST['action']) && $_POST['action'] == 'course_select_form') || (i $Resource = $_POST['resource']; foreach ($Resource as $Code_course => $Sessions) { - $_course = Database::get_course_info($Code_course); + $_course = api_get_course_info($Code_course); $tbl_document = Database::get_course_table(TABLE_DOCUMENT); $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); $course_id = $_course['real_id']; @@ -103,10 +103,11 @@ if ((isset ($_POST['action']) && $_POST['action'] == 'course_select_form') || (i AND props.to_group_id= $to_group_id AND docs.c_id = $course_id AND props.c_id = $course_id"; $query_session_doc = Database::query($sql_session_doc); while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) { - $zip_folder->add($FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'], - PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$ListSession[$session_id], - PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE'] - ); + $zip_folder->add( + $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'], + PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$ListSession[$session_id], + PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE'] + ); } } } @@ -209,7 +210,7 @@ function fullexportspecial(){ $code_course = ''; $list_course = array(); $zip_folder = new PclZip($FileZip['TEMP_FILE_ZIP']); - $list_course = Database::get_course_list(); + $list_course = CourseManager::get_course_list(); $tbl_document = Database::get_course_table(TABLE_DOCUMENT); $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index 239d8a1ac7..2c4cacf034 100644 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -34,7 +34,7 @@ $(function() { } else { url = String(window.location)+temp; window.location.replace(url); - } + } }); }); '; @@ -289,7 +289,7 @@ function get_calendar_items($select_month, $select_year, $select_day = false) //Check my personal calendar items if (api_get_setting('allow_personal_agenda') == 'true' && empty($_SESSION['user']) && empty($_SESSION['group'])) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // 1. creating the SQL statement for getting the personal agenda items in MONTH view $sql = "SELECT id, title, text as content , date as start_date, enddate as end_date, parent_event_id FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ".$show_all_current_personal; @@ -1120,7 +1120,7 @@ function construct_to_select_form($group_list = null, $user_list = null, $filter } $result .= ""; } - + // adding the individual users to the select form if (!empty($user_list)) { $result .= ''; diff --git a/main/calendar/agenda.lib.php b/main/calendar/agenda.lib.php index 5229b6f154..853a217a33 100644 --- a/main/calendar/agenda.lib.php +++ b/main/calendar/agenda.lib.php @@ -14,7 +14,7 @@ class Agenda { //Table definitions $this->tbl_global_agenda = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); - $this->tbl_personal_agenda = Database::get_user_personal_table(TABLE_PERSONAL_AGENDA); + $this->tbl_personal_agenda = Database::get_main_table(TABLE_PERSONAL_AGENDA); $this->tbl_course_agenda = Database::get_course_table(TABLE_AGENDA); //Setting the course object if we are in a course diff --git a/main/calendar/myagenda.inc.php b/main/calendar/myagenda.inc.php index c12dc46a95..8bc5a515e0 100644 --- a/main/calendar/myagenda.inc.php +++ b/main/calendar/myagenda.inc.php @@ -327,7 +327,7 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) { function show_new_personal_item_form($id = "") { global $year, $MonthsLong; - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // we construct the default time and date data (used if we are not editing a personal agenda item) //$today = getdate(); @@ -517,7 +517,7 @@ function show_new_personal_item_form($id = "") { */ function store_personal_item($day, $month, $year, $hour, $minute, $title, $content, $id = "") { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); //constructing the date $date = $year."-".$month."-".$day." ".$hour.":".$minute.":00"; @@ -598,7 +598,7 @@ function get_courses_of_user() { * This function retrieves all the personal agenda items and add them to the agenda items found by the other functions. */ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); $user_id = intval($user_id); // 1. creating the SQL statement for getting the personal agenda items in MONTH view @@ -700,7 +700,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = " * @return array The results of the database query, or null if not found */ function get_personal_agenda_item($id) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); $id = Database::escape_string($id); // make sure events of the personal agenda can only be seen by the user himself $user = api_get_user_id(); @@ -720,7 +720,7 @@ function get_personal_agenda_item($id) { function show_personal_agenda() { global $MonthsLong, $charset; - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // The SQL statement that retrieves all the personal agenda items of this user $sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ORDER BY date DESC"; @@ -824,7 +824,7 @@ function show_personal_agenda() { function show_simple_personal_agenda($user_id) { global $MonthsLong, $charset; - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // The SQL statement that retrieves all the personal agenda items of this user $sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' ORDER BY date DESC"; @@ -885,7 +885,7 @@ function show_simple_personal_agenda($user_id) { * does not belong to him/her */ function delete_personal_agenda($id) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); if ($id != strval(intval($id))) { return false; //potential SQL injection diff --git a/main/calendar/myagenda.php b/main/calendar/myagenda.php index 335a66383d..80d5d90f2b 100644 --- a/main/calendar/myagenda.php +++ b/main/calendar/myagenda.php @@ -31,11 +31,11 @@ if (!empty ($course_path)) { $htmlHeadXtra[] = to_javascript(); $htmlHeadXtra[] = ""; $htmlHeadXtra[] = "