|
|
|
@ -1,33 +1,28 @@ |
|
|
|
|
<?php // $Id: course_list.php 21855 2009-07-07 18:26:10Z juliomontoya $
|
|
|
|
|
/* For licensing terms, see /dokeos_license.txt */ |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
* This script shows a list of courses and allows searching for courses codes |
|
|
|
|
* and names |
|
|
|
|
* @package dokeos.admin |
|
|
|
|
* @package chamilo.admin |
|
|
|
|
*/ |
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
INIT SECTION |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
/* INIT SECTION */ |
|
|
|
|
|
|
|
|
|
// name of the language file that needs to be included |
|
|
|
|
$language_file = array('admin','courses'); |
|
|
|
|
$cidReset = true; |
|
|
|
|
require ('../inc/global.inc.php'); |
|
|
|
|
require_once '../inc/global.inc.php'; |
|
|
|
|
$this_section = SECTION_PLATFORM_ADMIN; |
|
|
|
|
|
|
|
|
|
api_protect_admin_script(); |
|
|
|
|
require_once (api_get_path(LIBRARY_PATH).'course.lib.php'); |
|
|
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); |
|
|
|
|
require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php'); |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'course.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php'; |
|
|
|
|
require_once '../gradebook/lib/be/gradebookitem.class.php'; |
|
|
|
|
require_once '../gradebook/lib/be/category.class.php'; |
|
|
|
|
/** |
|
|
|
|
* Get the number of courses which will be displayed |
|
|
|
|
*/ |
|
|
|
|
function get_number_of_courses() |
|
|
|
|
{ |
|
|
|
|
function get_number_of_courses() { |
|
|
|
|
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
|
|
|
$sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table"; |
|
|
|
|
|
|
|
|
@ -37,13 +32,10 @@ function get_number_of_courses() |
|
|
|
|
$sql.= " INNER JOIN $access_url_rel_course_table url_rel_course ON (code=url_rel_course.course_code)"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset ($_GET['keyword'])) |
|
|
|
|
{ |
|
|
|
|
if (isset ($_GET['keyword'])) { |
|
|
|
|
$keyword = Database::escape_string(trim($_GET['keyword'])); |
|
|
|
|
$sql .= " WHERE title LIKE '%".$keyword."%' OR code LIKE '%".$keyword."%' OR visual_code LIKE '%".$keyword."%'"; |
|
|
|
|
} |
|
|
|
|
elseif (isset ($_GET['keyword_code'])) |
|
|
|
|
{ |
|
|
|
|
} elseif (isset ($_GET['keyword_code'])) { |
|
|
|
|
$keyword_code = Database::escape_string($_GET['keyword_code']); |
|
|
|
|
$keyword_title = Database::escape_string($_GET['keyword_title']); |
|
|
|
|
$keyword_category = Database::escape_string($_GET['keyword_category']); |
|
|
|
@ -180,8 +172,8 @@ if (isset ($_POST['action'])) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (isset ($_GET['search']) && $_GET['search'] == 'advanced') |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (isset ($_GET['search']) && $_GET['search'] == 'advanced') { |
|
|
|
|
// Get all course categories |
|
|
|
|
$table_course_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); |
|
|
|
|
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
|
|
@ -267,26 +259,27 @@ else |
|
|
|
|
if (isset ($_GET['keyword'])) { |
|
|
|
|
$parameters = array ('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
|
|
|
} elseif (isset ($_GET['keyword_code'])) { |
|
|
|
|
$parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); |
|
|
|
|
$parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); |
|
|
|
|
$parameters['keyword_category'] = Security::remove_XSS($_GET['keyword_category']); |
|
|
|
|
$parameters['keyword_language'] = Security::remove_XSS($_GET['keyword_language']); |
|
|
|
|
$parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']); |
|
|
|
|
$parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']); |
|
|
|
|
$parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']); |
|
|
|
|
$parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); |
|
|
|
|
$parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); |
|
|
|
|
$parameters['keyword_category'] = Security::remove_XSS($_GET['keyword_category']); |
|
|
|
|
$parameters['keyword_language'] = Security::remove_XSS($_GET['keyword_language']); |
|
|
|
|
$parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']); |
|
|
|
|
$parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']); |
|
|
|
|
$parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$table->set_additional_parameters($parameters); |
|
|
|
|
$table->set_header(0, '', false); |
|
|
|
|
|
|
|
|
|
$table->set_header(0, '', false, 'width="8px"'); |
|
|
|
|
$table->set_header(1, get_lang('Code')); |
|
|
|
|
$table->set_header(2, get_lang('Title')); |
|
|
|
|
$table->set_header(3, get_lang('Language')); |
|
|
|
|
$table->set_header(3, get_lang('Language'), true, 'width="70px"'); |
|
|
|
|
$table->set_header(4, get_lang('Category')); |
|
|
|
|
$table->set_header(5, get_lang('SubscriptionAllowed')); |
|
|
|
|
$table->set_header(5, get_lang('SubscriptionAllowed'), true,'width="60px"'); |
|
|
|
|
$table->set_header(6, get_lang('UnsubscriptionAllowed'),false,'width="50px"'); |
|
|
|
|
//$table->set_header(7, get_lang('IsVirtualCourse')); |
|
|
|
|
$table->set_header(7, get_lang('Teacher')); |
|
|
|
|
$table->set_header(8, get_lang('Action'), false,'width="130px"'); |
|
|
|
|
$table->set_header(8, get_lang('Action'), false,'width="145px"'); |
|
|
|
|
$table->set_column_filter(8,'modify_filter'); |
|
|
|
|
$table->set_form_actions(array ('delete_courses' => get_lang('DeleteCourse')),'course'); |
|
|
|
|
$table->display(); |
|
|
|
|