Bladeren bron

Feature #2099 - Additional source files have been added.

Ivan Tcholakov 14 jaren geleden
bovenliggende
commit
b4ebb04c64

+ 116 - 0
main/admin/course_request_accepted.php

@@ -0,0 +1,116 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ * A list containig the accepted course requests
+ * @package chamilo.admin
+ * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
+ * @author Bruno Rubio Gayo <brubio@cesga.es>, 2010
+ * Centro de Supercomputacion de Galicia (CESGA)
+ *
+ * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
+ */
+
+/* INIT SECTION */
+
+// Language files that need to be included.
+$language_file = array('admin', 'create_course');
+
+$cidReset = true;
+
+require '../inc/global.inc.php';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
+require_once api_get_path(CONFIGURATION_PATH).'course_info.conf.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course_request.lib.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
+
+// Including a configuration file.
+require api_get_path(CONFIGURATION_PATH).'add_course.conf.php';
+
+// Include additional libraries
+require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
+
+
+/**
+ * Get the number of courses which will be displayed
+ */
+function get_number_of_courses() {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table WHERE status = ".COURSE_REQUEST_ACCEPTED;
+    $res = Database :: query($sql);
+    $obj = Database :: fetch_object($res);
+    return $obj->total_number_of_items;
+}
+
+/**
+ * Get course data to display
+ */
+function get_course_data($from, $number_of_items, $column, $direction) {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $users_table = Database :: get_main_table(TABLE_MAIN_USER);
+    $course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
+
+    $sql = "SELECT code AS col0,
+
+                   title AS col1,
+                   category_code AS col2,
+                   tutor_name AS col3,
+                   request_date AS col4,
+                   id AS col5
+                   FROM $course_table WHERE status = ".COURSE_REQUEST_ACCEPTED;
+
+    $sql .= " ORDER BY col$column $direction ";
+    $sql .= " LIMIT $from,$number_of_items";
+    $res = Database :: query($sql);
+    $courses = array();
+
+    while ($course = Database :: fetch_row($res)) {
+        $courses[] = $course;
+    }
+
+    return $courses;
+}
+
+/**
+ * Actions in the list: edit.
+ */
+function modify_filter($id) {
+    return
+        '<a href="editar_curso.php?id='.$id.'"><img src="../img/edit.gif" border="0" style="vertical-align: middle" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>&nbsp;';
+}
+
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$tool_name = get_lang('cesga_AdminCursosValid');
+Display :: display_header($tool_name);
+
+//api_display_tool_title($tool_name);
+if (isset ($_GET['delete_course'])) {
+    CourseManager :: delete_course($_GET['delete_course']);
+}
+
+// Create a sortable table with the course data
+$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2);
+$table->set_additional_parameters($parameters);
+//$table->set_header(0, '', false);
+$table->set_header(0, get_lang('Code'));
+$table->set_header(1, get_lang('Title'));
+$table->set_header(2, get_lang('Category'));
+//$table->set_header(3, get_lang('Teacher'), false);
+//$table->set_header(4, get_lang('cesga_AdminFechaSolic'), false);
+$table->set_header(3, get_lang('Teacher'));
+$table->set_header(4, get_lang('cesga_AdminFechaSolic'));
+$table->set_header(5, '', false);
+$table->set_column_filter(5, 'modify_filter');
+//$table->set_form_actions(array('delete_courses' => get_lang('DeleteCourse')), 'course');
+$table->display();
+
+/* FOOTER */
+
+Display :: display_footer();

+ 164 - 0
main/admin/course_request_rejected.php

@@ -0,0 +1,164 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ * A list containig the rejected course requests
+ * @package chamilo.admin
+ * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
+ * @author Bruno Rubio Gayo <brubio@cesga.es>, 2010
+ * Centro de Supercomputacion de Galicia (CESGA)
+ *
+ * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
+ */
+
+/* INIT SECTION */
+
+// Language files that need to be included.
+$language_file = array('admin', 'create_course');
+
+$cidReset = true;
+
+require '../inc/global.inc.php';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
+require_once api_get_path(CONFIGURATION_PATH).'course_info.conf.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course_request.lib.php';
+require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
+
+// Including a configuration file.
+require api_get_path(CONFIGURATION_PATH).'add_course.conf.php';
+
+// Including additional libraries.
+require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
+
+
+/**
+ * Acceptance and creation of the requested course.
+ */
+if (isset($_GET['accept_course']) && $_GET['accept_course'] != '') { // TODO: Secure $_GET['accept_course'].
+    //Constulta de los datos del curso
+    $sql = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE id LIKE '".$_GET['accept_course']."'"; // TODO: Why "SELECT ... id LIKE x"? Why not "SELECT ... id = x"?
+    $result = Database :: query($sql);
+    $curso_alta = Database :: fetch_array($result);
+
+    //Creación del curso
+
+    $wanted_code = $curso_alta['code'];
+    $tutor_name = $curso_alta['tutor_name'];
+    $category_code = $curso_alta['category_code'];
+    $title = $curso_alta['title'];
+    $course_language = $curso_alta['course_language'];
+    $keys = define_course_keys($wanted_code, '', $_configuration['db_prefix']);
+
+    if (sizeof($keys)) {
+        $visual_code = $keys['currentCourseCode'];
+        $code = $keys['currentCourseId'];
+        $db_name = $keys['currentCourseDbName'];
+        $directory = $keys['currentCourseRepository'];
+        $expiration_date = time() + $firstExpirationDelay;
+        prepare_course_repository($directory, $code);
+        update_Db_course($db_name);
+        $pictures_array = fill_course_repository($directory);
+        fill_Db_course($db_name, $directory, $course_language,$pictures_array);
+        register_course($code, $visual_code, $directory, $db_name, $tutor_name, $category_code, $title, $course_language, $curso_alta['user_id'], $expiration_date);
+    }
+
+
+    // TODO: Sent the e-mail.
+
+
+
+    //Una vez creado el curso, cambiamos su estado en la tabla temporal
+    $sql_temp = "UPDATE ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." SET status = 1 WHERE id LIKE '".$_GET['accept_course']."'";
+
+    //$sql_temp = "DELETE FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE id LIKE '".$_GET['accept_course']."'";
+    $result = api_sql_query($sql_temp);
+
+    unset ($_GET['accept_course']);
+}
+
+/**
+ * Get the number of courses which will be displayed
+ */
+function get_number_of_courses() {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table WHERE status = ".COURSE_REQUEST_REJECTED;
+    $res = Database :: query($sql);
+    $obj = Database :: fetch_object($res);
+    return $obj->total_number_of_items;
+}
+
+/**
+ * Get course data to display
+ */
+function get_course_data($from, $number_of_items, $column, $direction) {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $users_table = Database :: get_main_table(TABLE_MAIN_USER);
+    $course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
+
+    $sql = "SELECT code AS col0,
+
+                   title AS col1,
+                   category_code AS col2,
+                   tutor_name AS col3,
+                   request_date AS col4,
+                   id  AS col5
+                   FROM $course_table WHERE status = ".COURSE_REQUEST_REJECTED;
+
+    $sql .= " ORDER BY col$column $direction ";
+    $sql .= " LIMIT $from,$number_of_items";
+    $res = Database :: query($sql);
+    $courses = array();
+
+    while ($course = Database :: fetch_row($res)) {
+        $courses[] = $course;
+    }
+
+    return $courses;
+}
+
+/**
+ * Actions in the list: edit.
+ */
+
+function modify_filter($id) {
+    return
+        '<a href="editar_curso.php?id='.$id.'"><img src="../img/edit.gif" border="0" style="vertical-align: middle" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>&nbsp;'.' '.
+        '<a href="?accept_course='.$id.'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertCrear'), ENT_QUOTES))."'".')) return false;"><img src="../img/right.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminValidar').'" alt="'.get_lang('cesga_AdminValidar').'"/></a>';
+}
+
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$tool_name = get_lang('cesga_AdminCursosRexeit'); //nombre que aparece en la barra de navegación
+Display :: display_header($tool_name);
+
+//api_display_tool_title($tool_name);
+if (isset($_GET['delete_course'])) {
+    CourseManager :: delete_course($_GET['delete_course']);
+}
+
+// Create a sortable table with the course data
+$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2);
+$table->set_additional_parameters($parameters);
+//$table->set_header(0, '', false);
+$table->set_header(0, get_lang('Code'));
+$table->set_header(1, get_lang('Title'));
+$table->set_header(2, get_lang('Category'));
+//$table->set_header(3, get_lang('Teacher'), false);
+//$table->set_header(4, get_lang('cesga_AdminFechaSolic'), false);
+$table->set_header(3, get_lang('Teacher'));
+$table->set_header(4, get_lang('cesga_AdminFechaSolic'));
+$table->set_header(5, '', false);
+$table->set_column_filter(5, 'modify_filter');
+//$table->set_form_actions(array('delete_courses' => get_lang('DeleteCourse')), 'course');
+$table->display();
+
+/* FOOTER */
+
+Display :: display_footer();

+ 215 - 0
main/admin/course_request_review.php

@@ -0,0 +1,215 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ * Con este archivo se editan, se validan, se rechazan o se solicita mas informacion de los cursos que se solicitaron por parte de los profesores y que estan añadidos en la tabla temporal.
+ * A list containig the pending course requests
+ * @package chamilo.admin
+ * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
+ * Centro de Supercomputacion de Galicia (CESGA)
+ *
+ * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
+ */
+
+/* INIT SECTION */
+
+// Language files that need to be included.
+$language_file = array('admin', 'create_course');
+
+$cidReset = true;
+require '../inc/global.inc.php';
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
+require_once api_get_path(CONFIGURATION_PATH).'course_info.conf.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course_request.lib.php';
+require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.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).'usermanager.lib.php';
+
+// Including a configuration file.
+require_once api_get_path(CONFIGURATION_PATH).'add_course.conf.php';
+
+// Including additional libraries.
+require_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
+
+// Information about the helpdesk.
+$emailto_rt = "helpdesk_elearning@cesga.es";
+$emailbody_rt = "Owner: e-learning\nStatus: resolved\n\n";
+$email_send_rt = get_setting('administratorName').' '.get_setting('administratorSurname');
+$email_send2_rt = get_setting('emailAdministrator');
+
+/*
+ * Sending to the teacher a request for additional information about the proposed course.
+ */
+
+if (isset($_GET['request_info']) && $_GET['request_info'] != '') {
+
+    // TODO: Sent the e-mail.
+
+    // Marking the fact, that additional information has been requested.
+    $sql_info = "UPDATE ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." SET info = 1 WHERE id LIKE '".$_GET['request_info']."'";
+    $result_info = Database::query($sql_info);
+
+    unset ($_GET['request_info']);
+}
+
+/**
+ * Course rejection
+ */
+
+if (isset($_GET['reject_course']) && $_GET['reject_course'] != '') {
+
+    // TODO: Send the e-mail.
+
+    //Una vez notificado al profesor, cambiamos el estado del curso en la tabla temporal
+    $sql_borrar = "UPDATE ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." SET status = ".COURSE_REQUEST_REJECTED." WHERE id LIKE '".$_GET['reject_course']."'";
+    $result_borrar = Database::query($sql_borrar);
+
+    unset ($_GET['reject_course']);
+}
+
+/**
+ * Coutse acceptance and creation.
+ */
+
+if (isset($_GET['accept_course']) && $_GET['accept_course'] != '') {
+
+    // TODO: Filter $_GET['accept_course']
+    $course_id = CourseRequestManager::accept_course_request($_GET['accept_course']);
+
+    if ($course_id) {
+        // TODO: Prepare a confirmation message.
+    } else {
+        // Prepare an error message.
+    }
+
+    // TODO: Send the e-mail.
+
+    unset ($_GET['accept_course']);
+}
+
+/**
+ * Funcion feita por nos para saber o numero de cursos na taboa temporal sen validar
+ */
+function get_number_of_courses() {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table WHERE status = ".COURSE_REQUEST_PENDING;
+    $res = Database::query($sql);
+    $obj = Database::fetch_object($res);
+    return $obj->total_number_of_items;
+}
+
+/**
+ * Get course data to display
+ */
+function get_course_data($from, $number_of_items, $column, $direction) {
+    $course_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
+    $users_table = Database :: get_main_table(TABLE_MAIN_USER);
+    $course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
+
+    $sql = "SELECT code AS col0,
+                   code AS col1,
+                   title AS col2,
+                   category_code AS col3,
+                   tutor_name AS col4,
+                   request_date AS col5,
+                   id  AS col6
+                   FROM $course_table WHERE status = ".COURSE_REQUEST_PENDING;
+
+    $sql .= " ORDER BY col$column $direction ";
+    $sql .= " LIMIT $from,$number_of_items";
+    $res = Database::query($sql);
+    $courses = array();
+
+    while ($course = Database::fetch_row($res)) {
+        $courses[] = $course;
+    }
+
+    return $courses;
+}
+
+/**
+ * Enlace a la ficha del profesor
+ */
+function email_filter($teacher) {
+    $sql = "SELECT user_id FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE tutor_name LIKE '".$teacher."'";
+    $res = Database::query($sql);
+    $info = Database::fetch_array($res);
+    return '<a href="./user_information.php?user_id='.$info[0].'">'.$teacher.'</a>';
+}
+
+/**
+ * Actions in the list: edit, accept, reject, request additional information.
+ */
+
+function modify_filter($id) {
+    /*
+    return
+    '<a href="editar_curso.php?id='.$id.'"><img src="../img/edit.gif" border="0" style="vertical-align: middle" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>&nbsp;'.' '.'<a href="?reject_course='.$id.'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><img src="../img/delete.gif" border="0" style="vertical-align: middle" title="'.get_lang('Delete').'" alt="'.get_lang('Delete').'"/></a>'.'  '.'<a href="?request_info='.$id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertInfo'), ENT_QUOTES))."'".')) return false;"><img src="../img/cesga_question.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminPedirInfo').'" alt="'.get_lang('cesga_AdminPedirInfo').'"/></a>&nbsp;'.'  '.'<a href="?accept_course='.$id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertCrear'), ENT_QUOTES))."'".')) return false;"><img src="../img/right.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminValidar').'" alt="'.get_lang('cesga_AdminValidar').'"/></a>&nbsp;';
+    */
+    $sql_request_info = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE (id = ".$id." AND info = 1 )";
+    $res_request_info = Database::query($sql_request_info);
+
+    if (Database::num_rows($res_request_info) > 0) { //Si ya se le ha pedido información, no se muestra esa opción
+
+        return
+            '<a href="editar_curso.php?id='.$id.'"><img src="../img/edit.gif" border="0" style="vertical-align: middle" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>&nbsp;'.' '.'<a href="?reject_course='.$id.'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><img src="../img/delete.gif" border="0" style="vertical-align: middle" title="'.get_lang('Delete').'" alt="'.get_lang('Delete').'"/></a>'.'  '.'<a href="?accept_course='.$id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertCrear'), ENT_QUOTES))."'".')) return false;"><img src="../img/right.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminValidar').'" alt="'.get_lang('cesga_AdminValidar').'"/></a>&nbsp;';
+
+    } else {
+
+        return
+            '<a href="editar_curso.php?id='.$id.'"><img src="../img/edit.gif" border="0" style="vertical-align: middle" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>&nbsp;'.'  '.'<a href="?reject_course='.$id.'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><img src="../img/delete.gif" border="0" style="vertical-align: middle" title="'.get_lang('Delete').'" alt="'.get_lang('Delete').'"/></a>'.'  '.'<a href="?accept_course='.$id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertCrear'), ENT_QUOTES))."'".')) return false;"><img src="../img/right.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminValidar').'" alt="'.get_lang('cesga_AdminValidar').'"/></a>'.'  '.'<a href="?request_info='.$id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('cesga_AdminAlertInfo'), ENT_QUOTES))."'".')) return false;"><img src="../img/cesga_question.gif" border="0" style="vertical-align: middle" title="'.get_lang('cesga_AdminPedirInfo').'" alt="'.get_lang('cesga_AdminPedirInfo').'"/></a>&nbsp;&nbsp;';
+    }
+}
+
+if (isset ($_POST['action'])) {
+    switch ($_POST['action']) {
+        // Delete selected courses
+        case 'delete_courses' :
+            $course_codes = $_POST['course'];
+            if (count($course_codes) > 0) {
+                foreach ($course_codes as $index => $course_code) {
+                    //CourseManager :: delete_course($course_code);
+                    $sql = "DELETE FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE code LIKE '".$course_code."'";
+                    //echo $sql;
+                    $result = Database::query($sql);
+                }
+            }
+            break;
+    }
+}
+
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$tool_name = get_lang('cesga_AdminValidCursos'); //nombre que aparece en la barra de navegación
+Display :: display_header($tool_name);
+
+//api_display_tool_title($tool_name);
+if (isset ($_GET['delete_course'])) {
+    CourseManager :: delete_course($_GET['delete_course']);
+}
+
+// Create a sortable table with the course data
+$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2);
+$table->set_additional_parameters($parameters);
+$table->set_header(0, '', false);
+$table->set_header(1, get_lang('Code'));
+$table->set_header(2, get_lang('Title'));
+$table->set_header(3, get_lang('Category'));
+//$table->set_header(4, get_lang('Teacher'), false);
+//$table->set_header(5, get_lang('cesga_AdminFechaSolic'), false);
+$table->set_header(4, get_lang('Teacher'));
+$table->set_header(5, get_lang('cesga_AdminFechaSolic'));
+$table->set_header(6, '', false);
+$table->set_column_filter(4,'email_filter');
+$table->set_column_filter(6,'modify_filter');
+$table->set_form_actions(array('delete_courses' => get_lang('DeleteCourse')), 'course');
+$table->display();
+
+/* FOOTER */
+
+Display :: display_footer();

+ 8 - 1
main/admin/index.php

@@ -7,7 +7,7 @@
  */
 
 // Language files that need to be included.
-$language_file = array('admin', 'tracking');
+$language_file = array('admin', 'tracking', 'cesga');
 
 // Resetting the course id.
 $cidReset = true;
@@ -103,13 +103,20 @@ if (api_is_platform_admin()) { ?>
     </div>
     <ul>
         <li><a href="course_list.php"><?php echo get_lang('CourseList'); ?></a></li>
+    <?php if (api_get_setting('course_validation') != 'true') { ?>
         <li><a href="course_add.php"><?php echo get_lang('AddCourse'); ?></a></li>
+    <?php } ?>
         <li><a href="course_export.php"><?php echo get_lang('ExportCourses'); ?></a></li>
         <li><a href="course_import.php"><?php echo get_lang('ImportCourses'); ?></a></li>
         <!-- <li><a href="course_virtual.php"><?php //echo get_lang('AdminManageVirtualCourses'); ?></a></li> -->
         <li><a href="course_category.php"><?php echo get_lang('AdminCategories'); ?></a></li>
         <li><a href="subscribe_user2course.php"><?php echo get_lang('AddUsersToACourse'); ?></a></li>
         <li><a href="course_user_import.php"><?php echo get_lang('ImportUsersToACourse'); ?></a></li>
+    <?php if (api_get_setting('course_validation') == 'true') { ?>
+        <li><a href="course_request_rejected.php"><?php echo get_lang('cesga_AdminCursosRexeit'); ?></a></li>
+        <li><a href="course_request_accepted.php"><?php echo get_lang('cesga_AdminCursosValid'); ?></a></li>
+        <li><a href="course_request_review.php"><?php echo get_lang('cesga_AdminValidCursos'); ?></a></li>
+    <?php } ?>
     <?php if (api_get_setting('search_enabled') == 'true') { ?>
         <li><a href="specific_fields.php"><?php echo get_lang('SpecificSearchFields'); ?></a></li>
     <?php }

+ 1 - 2
main/create_course/add_course.php

@@ -174,6 +174,7 @@ if ($form->validate()) {
         $target_audience = Security::remove_XSS($course_values['target_audience']);
         $status = '0';
 
+        // TODO: Why escaping quotes is needed here?
         $description = str_replace('"', '', $description);
         $objetives = str_replace('"', '', $objetives);
         $target_audience = str_replace('"', '', $target_audience);
@@ -250,8 +251,6 @@ if ($form->validate()) {
 
             if ($request_id) {
 
-                // TODO: Prepare and send notification e-mail messages.
-
                 $course_request_info = CourseRequestManager::get_course_request_info($request_id);
                 $visual_code = is_array($course_request_info) ? $course_request_info['visual_code'] : '';
                 $message = get_lang('CourseRequestCreated');