Minor - removing libs already added using autoload

skala
Julio Montoya 13 years ago
parent 980102cf50
commit 4c4c57e351
  1. 4
      main/admin/course_list.php
  2. 4
      main/admin/resume_session.php
  3. 4
      main/admin/session_add.php
  4. 1
      main/admin/session_category_add.php
  5. 2
      main/exercice/exercice.php
  6. 2
      main/exercice/exercise_report.php
  7. 31
      main/inc/lib/sessionmanager.lib.php

@ -61,9 +61,7 @@ function get_number_of_courses() {
* Get course data to display
*/
function get_course_data($from, $number_of_items, $column, $direction) {
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$users_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT code AS col0, title AS col1, visual_code AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6,
code AS col7, visibility AS col8, directory as col9

@ -11,8 +11,6 @@ $language_file = 'admin';
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
@ -33,10 +31,8 @@ $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$table_access_url_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$table_access_url_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$id_session = (int)$_GET['id_session'];
$sql = 'SELECT name, nbr_courses, nbr_users, nbr_classes, DATE_FORMAT(date_start,"%d-%m-%Y") as date_start, DATE_FORMAT(date_end,"%d-%m-%Y") as date_end, lastname, firstname, username, session_admin_id, nb_days_access_before_beginning, nb_days_access_after_end, session_category_id, visibility

@ -15,7 +15,6 @@ $cidReset=true;
require_once '../inc/global.inc.php';
// including additional libraries
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
require_once '../inc/lib/xajax/xajax.inc.php';
$xajax = new xajax();
@ -35,7 +34,6 @@ $interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('Session
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
function search_coachs($needle) {
global $tbl_user;
@ -92,10 +90,8 @@ $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script type="text/javascript">
function fill_coach_field (username) {
document.getElementById("coach_username").value = username;
document.getElementById("ajax_list_coachs").innerHTML = "";
}
</script>';

@ -14,7 +14,6 @@ $cidReset=true;
require_once '../inc/global.inc.php';
// including additional libraries
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
require_once '../inc/lib/xajax/xajax.inc.php';
$xajax = new xajax();
$xajax -> registerFunction ('search_coachs');

@ -39,9 +39,7 @@ require_once 'testcategory.class.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
require_once 'hotpotatoes.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php'; // for group filtering
/* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true);

@ -35,9 +35,7 @@ require_once 'answer.class.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
require_once 'hotpotatoes.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH)."groupmanager.lib.php"; // for group filtering
// need functions of statsutils lib to display previous exercices scores
require_once api_get_path(LIBRARY_PATH) . 'statsUtils.lib.inc.php';

@ -34,6 +34,7 @@ class SessionManager {
if (Database::num_rows($r) != 1) { return array(); }
return Database::fetch_array($r,'ASSOC');
}
/**
* Create a session
* @author Carlos Vargas from existing code
@ -57,17 +58,18 @@ class SessionManager {
**/
public static function create_session($sname,$syear_start,$smonth_start,$sday_start,$syear_end,$smonth_end,$sday_end,$snb_days_acess_before,$snb_days_acess_after, $nolimit,$coach_username, $id_session_category,$id_visibility, $start_limit = true, $end_limit = true, $fix_name = false) {
global $_configuration;
//Check portal limits
$access_url_id = 1;
if (api_get_multiple_access_url()) {
$access_url_id = api_get_current_access_url_id();
}
if (is_array($_configuration[$access_url_id]) && isset($_configuration[$access_url_id]['hosting_limit_sessions']) && $_configuration[$access_url_id]['hosting_limit_sessions'] > 0) {
$num = self::count_sessions();
if ($num >= $_configuration[$access_url_id]['hosting_limit_sessions']) {
return get_lang('PortalSessionsLimitReached');
}
}
$access_url_id = 1;
if (api_get_multiple_access_url()) {
$access_url_id = api_get_current_access_url_id();
}
if (is_array($_configuration[$access_url_id]) && isset($_configuration[$access_url_id]['hosting_limit_sessions']) && $_configuration[$access_url_id]['hosting_limit_sessions'] > 0) {
$num = self::count_sessions();
if ($num >= $_configuration[$access_url_id]['hosting_limit_sessions']) {
return get_lang('PortalSessionsLimitReached');
}
}
$name = Database::escape_string(trim($sname));
$year_start = intval($syear_start);
@ -83,7 +85,7 @@ class SessionManager {
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
if(is_int($coach_username)) {
if (is_int($coach_username)) {
$id_coach = $coach_username;
} else {
$sql = 'SELECT user_id FROM '.$tbl_user.' WHERE username="'.Database::escape_string($coach_username).'"';
@ -149,11 +151,8 @@ class SessionManager {
Database::query($sql_insert);
$session_id = Database::insert_id();
if (!empty($session_id)) {
//Adding to the correct URL
require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
if (!empty($session_id)) {
//Adding to the correct URL
$access_url_id = api_get_current_access_url_id();
UrlManager::add_session_to_url($session_id,$access_url_id);

Loading…
Cancel
Save