');
+ }
+
+ $form->addElement('datepicker', 'custom_start_date', get_lang('StartDate'), array('form_name'=>'thematic_advance'));
+ $form->addElement('html', '
');
+
+ if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) {
+ $form->addElement('html', '
');
+ } else {
+ $form->addElement('html', '
');
+ }
+
+ if (count($attendance_select) > 1) {
+ $form->addElement('select', 'attendance_select', get_lang('Attendances'), $attendance_select, array('id' => 'id_attendance_select', 'onchange' => 'datetime_by_attendance(this.value)'));
+ } else {
+ $form->addElement('html', '
'.get_lang('Attendances').'
'.get_lang('ThereAreNoAttendancesInsideCourse').'
');
+ }
+
+ $form->addElement('html', '
');
+ if (!empty($calendar_select)) {
+ $form->addElement('select', 'start_date_by_attendance', get_lang('StartDate'), $calendar_select);
+ }
+ $form->addElement('html', '
');
+
+ $form->addElement('html', '
');
+
+ $form->add_textfield('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3'));
+
+ $form->add_html_editor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));
+ $form->addElement('html','
');
+ $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+
+ $default['start_date_type'] = 1;
+ $default['custom_start_date'] = date('d-F-Y 00:00');
+ if (!empty($thematic_advance_data)) {
+
+ // set default values
+ $default['content'] = $thematic_advance_data['content'];
+ $default['duration_in_hours'] = $thematic_advance_data['duration'];
+ if (empty($thematic_advance_data['attendance_id'])) {
+ $default['start_date_type'] = 2;
+ $default['custom_start_date'] = date('d-F-Y H:i', api_strtotime(api_get_local_time($thematic_advance_data['start_date'])));
+ } else {
+ $default['start_date_type'] = 1;
+ if (!empty($calendar_select)) {
+ $default['start_date_by_attendance'] = $thematic_advance_data['start_date'];
+ }
+ $default['attendance_select'] = $thematic_advance_data['attendance_id'];
+ }
+ }
+ $form->setDefaults($default);
+
+ // error messages
+ $msg_error = '';
+ if ($start_date_error) {
+ $msg_error .= get_lang('YouMustSelectAtleastAStartDate').'
';
+ }
+ if ($duration_error) {
+ $msg_error .= get_lang('DurationInHoursMustBeNumeric');
+ }
+
+ if (!empty($msg_error)) {
+ Display::display_error_message($msg_error,false);
+ }
+
+ $form->display();
+
+} else if ($action == 'thematic_advance_list') {
+
+ if (api_is_allowed_to_edit(null, true)) {
+ echo '
';
+ }
+
+ // thematic advance list
+ $table = new SortableTable('thematic_advance_list', array('Thematic', 'get_number_of_thematic_advances'), array('Thematic', 'get_thematic_advance_data'));
+ $table->set_additional_parameters($parameters);
+ $table->set_header(0, '', false, array('style'=>'width:20px;'));
+ $table->set_header(1, get_lang('StartDate'), true );
+ $table->set_header(2, get_lang('DurationInHours'), true, array('style'=>'width:80px;'));
+ $table->set_header(3, get_lang('Content'), true);
+
+ if (api_is_allowed_to_edit(null, true)) {
+ $table->set_header(4, get_lang('Actions'), false,array('style'=>'text-align:center'));
+ }
+
+ $table->display();
+}
+
+?>
\ No newline at end of file
diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php
new file mode 100755
index 0000000000..2c9f3e449c
--- /dev/null
+++ b/main/course_progress/thematic_controller.php
@@ -0,0 +1,327 @@
+
+ * @package chamilo.course_progress
+ */
+
+/**
+ * Thematic Controller script. Prepares the common background variables to give to the scripts corresponding to
+ * the requested action
+ * @package chamilo.course_progress
+ */
+
+class ThematicController
+{
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ $this->toolname = 'course_progress';
+ $this->view = new View($this->toolname);
+ }
+
+ /**
+ * This method is used for thematic control (update, insert or listing)
+ * @param string Action
+ * render to thematic.php
+ */
+ public function thematic($action) {
+
+ $thematic= new Thematic();
+ $data = array();
+ $error = false;
+
+ // insert or update a thematic
+ if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
+ if (isset($_POST['action']) && ($_POST['action'] == 'thematic_add' || $_POST['action'] == 'thematic_edit')) {
+ if (!empty($_POST['title'])) {
+ if ($_POST['thematic_token'] == $_SESSION['thematic_token']) {
+ $id = $_POST['thematic_id'];
+ $title = $_POST['title'];
+ $content = $_POST['content'];
+ $session_id = api_get_session_id();
+ $thematic->set_thematic_attributes($id, $title, $content, $session_id);
+ $affected_rows = $thematic->thematic_save();
+ $action = 'thematic_list';
+ unset($_SESSION['thematic_token']);
+ }
+ } else {
+ $error = true;
+ $data['error'] = $error;
+ $data['action'] = $_POST['action'];
+ $data['thematic_id'] = $_POST['thematic_id'];
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic');
+ $this->view->render();
+ }
+ }
+ }
+
+ // delete many thematics
+ if ($action == 'thematic_delete_select') {
+ if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
+ $thematic_ids = $_POST['id'];
+ $affected_rows = $thematic->thematic_destroy($thematic_ids);
+ $action = 'thematic_list';
+ }
+ }
+
+ $thematic_id = isset($_GET['thematic_id'])?intval($_GET['thematic_id']):null;
+
+ if (isset($thematic_id)) {
+
+ // delete a thematic
+ if ($action == 'thematic_delete') {
+ $affected_rows = $thematic->thematic_destroy($thematic_id);
+ $action = 'thematic_list';
+ }
+
+ // move thematic
+ if ($action == 'moveup') {
+ $thematic->move_thematic('up', $thematic_id);
+ $action = 'thematic_list';
+ } else if ($action == 'movedown') {
+ $thematic->move_thematic('down', $thematic_id);
+ $action = 'thematic_list';
+ }
+
+ $data['thematic_data'] = $thematic->get_thematic_list($thematic_id);
+ $data['thematic_id'] = $thematic_id;
+ }
+
+ if ($action == 'thematic_details') {
+
+ if (isset($thematic_id)) {
+ $thematic_data[$thematic_id] = $thematic->get_thematic_list($thematic_id);
+ $data['total_average_of_advances'] = $thematic->get_average_of_advances_by_thematic($thematic_id);
+ } else {
+ $thematic_data = $thematic->get_thematic_list();
+ $data['last_done_thematic_advance'] = $thematic->get_last_done_thematic_advance();
+ $data['total_average_of_advances'] = $thematic->get_total_average_of_thematic_advances();
+ }
+
+ $thematic_plan_data = $thematic->get_thematic_plan_data();
+ $thematic_advance_data = $thematic->get_thematic_advance_list();
+ $data['thematic_plan_data'] = $thematic_plan_data;
+ $data['thematic_advance_data'] = $thematic_advance_data;
+ $data['thematic_data'] = $thematic_data;
+ }
+
+ $data['action'] = $action;
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic');
+ $this->view->render();
+
+ }
+
+ /**
+ * This method is used for thematic plan control (update, insert or listing)
+ * @param string Action
+ * render to thematic_plan.php
+ */
+ public function thematic_plan($action) {
+ $thematic= new Thematic();
+ $data = array();
+ $error = false;
+
+ if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
+ if (isset($_POST['action']) && ($_POST['action'] == 'thematic_plan_add' || $_POST['action'] == 'thematic_plan_edit')) {
+ if (!empty($_POST['title'])) {
+ if ($_POST['thematic_plan_token'] == $_SESSION['thematic_plan_token']) {
+ $thematic_id = $_POST['thematic_id'];
+ $title = $_POST['title'];
+ $description = $_POST['description'];
+ $description_type = $_POST['description_type'];
+ $thematic->set_thematic_plan_attributes($thematic_id, $title, $description, $description_type);
+ $affected_rows = $thematic->thematic_plan_save();
+ unset($_SESSION['thematic_plan_token']);
+ $action = 'thematic_plan_list';
+ }
+ } else {
+ $error = true;
+ $action = $_POST['action'];
+ $data['error'] = $error;
+ $data['thematic_plan_data'] = $thematic->get_thematic_plan_data($_POST['thematic_id'], $_POST['description_type']);
+ $data['thematic_id'] = $_POST['thematic_id'];
+ $data['description_type'] = $_POST['description_type'];
+ $data['action'] = $action;
+ $data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title();
+ $data['default_thematic_plan_icon'] = $thematic->get_default_thematic_plan_icon();
+ $data['default_thematic_plan_question'] = $thematic->get_default_question();
+ $data['next_description_type'] = $thematic->get_next_description_type($_POST['thematic_id']);
+
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic_plan');
+ $this->view->render();
+ }
+ }
+ }
+
+ if ($action == 'thematic_plan_list') {
+ $data['thematic_plan_data'] = $thematic->get_thematic_plan_data($thematic_id);
+ }
+
+ $thematic_id = intval($_GET['thematic_id']);
+ $description_type = intval($_GET['description_type']);
+
+ if (!empty($thematic_id) && !empty($description_type)) {
+ if ($action == 'thematic_plan_delete') {
+ $affected_rows = $thematic->thematic_plan_destroy($thematic_id, $description_type);
+ $data['thematic_plan_data'] = $thematic->get_thematic_plan_data($thematic_id);
+ $action = 'thematic_plan_list';
+ } else {
+ $data['thematic_plan_data'] = $thematic->get_thematic_plan_data($thematic_id, $description_type);
+ }
+ $data['thematic_id'] = $thematic_id;
+ $data['description_type'] = $description_type;
+ } else if (!empty($thematic_id) && $action == 'thematic_plan_list') {
+ $data['thematic_plan_data'] = $thematic->get_thematic_plan_data($thematic_id);
+ $data['thematic_id'] = $thematic_id;
+ }
+
+ $data['thematic_id'] = $thematic_id;
+ $data['action'] = $action;
+ $data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title();
+ $data['default_thematic_plan_icon'] = $thematic->get_default_thematic_plan_icon();
+ $data['next_description_type'] = $thematic->get_next_description_type($thematic_id);
+ $data['default_thematic_plan_question'] = $thematic->get_default_question();
+
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic_plan');
+ $this->view->render();
+ }
+
+ /**
+ * This method is used for thematic advance control (update, insert or listing)
+ * @param string Action
+ * render to thematic_advance.php
+ */
+ public function thematic_advance($action) {
+
+ $thematic= new Thematic();
+ $attendance = new Attendance();
+ $data = array();
+
+ // get data for attendance input select
+ $attendance_list = $attendance->get_attendances_list();
+ $attendance_select = array();
+ $attendance_select[0] = get_lang('SelectAnAttendance');
+ foreach ($attendance_list as $attendance_id => $attendance_data) {
+ $attendance_select[$attendance_id] = $attendance_data['name'];
+ }
+
+ if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
+ if (isset($_POST['action']) && ($_POST['action'] == 'thematic_advance_add' || $_POST['action'] == 'thematic_advance_edit')) {
+ if (($_POST['start_date_type'] == 1 && empty($_POST['start_date_by_attendance'])) || (!empty($_POST['duration_in_hours']) && !is_numeric($_POST['duration_in_hours'])) ) {
+
+ if ($_POST['start_date_type'] == 1 && empty($_POST['start_date_by_attendance'])) {
+ $start_date_error = true;
+ $data['start_date_error'] = $start_date_error;
+ }
+
+ if (!empty($_POST['duration_in_hours']) && !is_numeric($_POST['duration_in_hours'])) {
+ $duration_error = true;
+ $data['duration_error'] = $duration_error;
+ }
+
+ $data['action'] = $_POST['action'];
+ $data['thematic_id'] = $_POST['thematic_id'];
+ $data['attendance_select'] = $attendance_select;
+ if (isset($_POST['thematic_advance_id'])) {
+ $data['thematic_advance_id'] = $_POST['thematic_advance_id'];
+ $thematic_advance_data = $thematic->get_thematic_advance_list($_POST['thematic_advance_id']);
+ $data['thematic_advance_data'] = $thematic_advance_data;
+ }
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic_advance');
+ $this->view->render();
+ } else {
+ if ($_POST['thematic_advance_token'] == $_SESSION['thematic_advance_token']) {
+ $thematic_advance_id = $_POST['thematic_advance_id'];
+ $thematic_id = $_POST['thematic_id'];
+ $content = $_POST['content'];
+ $duration = $_POST['duration_in_hours'];
+ if (isset($_POST['start_date_type']) && $_POST['start_date_type'] == 2) {
+ $start_date = $thematic->build_datetime_from_array($_POST['custom_start_date']);
+ $attendance_id = 0;
+ } else {
+ $start_date = $_POST['start_date_by_attendance'];
+ $attendance_id = $_POST['attendance_select'];
+ }
+ $thematic->set_thematic_advance_attributes($thematic_advance_id, $thematic_id, $attendance_id, $content, $start_date, $duration);
+ $affected_rows = $thematic->thematic_advance_save();
+ if ($affected_rows) {
+ // get last done thematic advance before move thematic list
+ $last_done_thematic_advance = $thematic->get_last_done_thematic_advance();
+ // update done advances with de current thematic list
+ if (!empty($last_done_thematic_advance)) {
+ $update_done_advances = $thematic->update_done_thematic_advances($last_done_thematic_advance);
+ }
+ }
+ unset($_SESSION['thematic_advance_token']);
+ $action = 'thematic_advance_list';
+ }
+ }
+ }
+ }
+
+ $thematic_id = intval($_GET['thematic_id']);
+ $thematic_advance_id = intval($_GET['thematic_advance_id']);
+ $thematic_advance_data = array();
+ if (!empty($thematic_advance_id)) {
+ if ($action == 'thematic_advance_delete') {
+ $affected_rows = $thematic->thematic_advance_destroy($thematic_advance_id);
+ $action = 'thematic_advance_list';
+ } else {
+ $thematic_advance_data = $thematic->get_thematic_advance_list($thematic_advance_id);
+ }
+ }
+
+ // get calendar select by attendance id
+ $calendar_select = array();
+ if (!empty($thematic_advance_data)) {
+ if (!empty($thematic_advance_data['attendance_id'])) {
+ $attendance_calendar = $attendance->get_attendance_calendar($thematic_advance_data['attendance_id']);
+ if (!empty($attendance_calendar)) {
+ foreach ($attendance_calendar as $calendar) {
+ $calendar_select[$calendar['date_time']] = $calendar['date_time'];
+ }
+ }
+ }
+ }
+
+ $data['action'] = $action;
+ $data['thematic_id'] = $thematic_id;
+ $data['thematic_advance_id'] = $thematic_advance_id;
+ $data['attendance_select'] = $attendance_select;
+ $data['thematic_advance_data'] = $thematic_advance_data;
+ $data['calendar_select'] = $calendar_select;
+
+ // render to the view
+ $this->view->set_data($data);
+ $this->view->set_layout('layout');
+ $this->view->set_template('thematic_advance');
+ $this->view->render();
+
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/main/course_progress/thematic_plan.php b/main/course_progress/thematic_plan.php
new file mode 100755
index 0000000000..27330e7fa7
--- /dev/null
+++ b/main/course_progress/thematic_plan.php
@@ -0,0 +1,108 @@
+
+* @package chamilo.course_progress
+*/
+
+// actions menu
+$categories = array ();
+foreach ($default_thematic_plan_title as $id => $title) {
+ $categories[$id] = $title;
+}
+$categories[ADD_THEMATIC_PLAN] = get_lang('NewBloc');
+
+$i=1;
+echo '
';
+
+if ($action == 'thematic_plan_list') {
+
+ if (isset($thematic_plan_data) && count($thematic_plan_data) > 0) {
+ foreach ($thematic_plan_data as $thematic_plan) {
+ echo '
';
+ echo '';
+ }
+ } else {
+ echo '
'.get_lang('ThisCourseDescriptionIsEmpty').'';
+ }
+
+} else if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
+
+ if ($description_type >= ADD_THEMATIC_PLAN) {
+ $header_form = get_lang('NewBloc');
+ } else {
+ $header_form = $default_thematic_plan_title[$description_type];
+ }
+ if (!$error) {
+ $token = md5(uniqid(rand(),TRUE));
+ $_SESSION['thematic_plan_token'] = $token;
+ }
+
+ // display form
+ $form = new FormValidator('thematic_plan_add','POST','index.php?action=thematic_plan_list&thematic_id='.$thematic_id.'&'.api_get_cidreq().$param_gradebook,'','style="width: 100%;"');
+ $form->addElement('header', '', $header_form);
+ $form->addElement('hidden', 'action', $action);
+ $form->addElement('hidden', 'thematic_plan_token', $token);
+
+ if (!empty($thematic_id)) {
+ $form->addElement('hidden', 'thematic_id', $thematic_id);
+ }
+ if (!empty($description_type)) {
+ $form->addElement('hidden', 'description_type', $description_type);
+ }
+
+ $form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
+ $form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
+ $form->addElement('html','
');
+ $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+
+ if ($description_type < ADD_THEMATIC_PLAN) {
+ $default['title'] = $default_thematic_plan_title[$description_type];
+ }
+ if (!empty($thematic_plan_data)) {
+ // set default values
+ $default['title'] = $thematic_plan_data[0]['title'];
+ $default['description'] = $thematic_plan_data[0]['description'];
+ }
+ $form->setDefaults($default);
+
+ if (isset($default_thematic_plan_question[$description_type])) {
+ $message = '
'.get_lang('QuestionPlan').'';
+ $message .= $default_thematic_plan_question[$description_type];
+ Display::display_normal_message($message, false);
+ }
+
+ // error messages
+ if ($error) {
+ Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
+ }
+
+ $form->display();
+}
+
+?>
\ No newline at end of file
diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php
index aa9074b166..fce3428abd 100755
--- a/main/inc/introductionSection.inc.php
+++ b/main/inc/introductionSection.inc.php
@@ -159,12 +159,12 @@ $thematic_description_html = '';
if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
- $thematic = new Thematic();
- if (api_get_course_setting('display_info_advance_inside_homecourse')) {
+ $thematic = new Thematic();
+ if (api_get_course_setting('display_info_advance_inside_homecourse') == '1') {
$information_title = get_lang('InfoAboutLastDoneAdvance');
$last_done_advance = $thematic->get_last_done_thematic_advance();
$thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
- } else {
+ } else if(api_get_course_setting('display_info_advance_inside_homecourse') == '2') {
$information_title = get_lang('InfoAboutNextAdvanceNotDone');
$next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
$thematic_advance_info = $thematic->get_thematic_advance_list($next_advance_not_done);
@@ -185,7 +185,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_description_html .= '
'.$thematic_advance.'
';
$thematic_description_html .= '
'.$information_title.'
';
$thematic_description_html .= '
'.$thematic_info['title'].'
';
- $thematic_description_html .= '
'.api_get_local_time($thematic_advance_info['start_date']).'
';
+ $thematic_description_html .= '
'.api_convert_and_format_date($thematic_advance_info['start_date'], DATE_TIME_FORMAT_LONG, date_default_timezone_get()).'
';
$thematic_description_html .= '
'.$thematic_advance_info['content'].'
';
$thematic_description_html .= '
'.get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].'
';
$thematic_description_html .= '
';
diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php
index 88169b10cb..594e7c275f 100755
--- a/main/inc/lib/add_course.lib.inc.php
+++ b/main/inc/lib/add_course.lib.inc.php
@@ -2163,6 +2163,8 @@ function fill_Db_course($courseDbName, $courseRepository, $language,$default_doc
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_GLOSSARY."','glossary/index.php','glossary.gif','".string2binary(api_get_setting('course_create_active_tools', 'glossary')). "','0','squaregrey.gif','NO','_self','authoring','0')");
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_NOTEBOOK."','notebook/index.php','notebook.gif','".string2binary(api_get_setting('course_create_active_tools', 'notebook'))."','0','squaregrey.gif','NO','_self','interaction','0')");
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_ATTENDANCE."','attendance/index.php','attendance.gif','".string2binary(api_get_setting('course_create_active_tools', 'attendances'))."','0','squaregrey.gif','NO','_self','authoring','0')");
+ Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_COURSE_PROGRESS."','course_progress/index.php','course_progress.gif','".string2binary(api_get_setting('course_create_active_tools', 'course_progress'))."','0','squaregrey.gif','NO','_self','authoring','0')");
+
if(api_get_setting('service_visio','active')=='true')
{
$mycheck = api_get_setting('service_visio','visio_host');
diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php
index 5de79e9fa2..2e72c85f44 100755
--- a/main/inc/lib/main_api.lib.php
+++ b/main/inc/lib/main_api.lib.php
@@ -97,6 +97,7 @@ define('TOOL_GLOSSARY','glossary');
define('TOOL_GRADEBOOK','gradebook');
define('TOOL_NOTEBOOK','notebook');
define('TOOL_ATTENDANCE','attendance');
+define('TOOL_COURSE_PROGRESS','course_progress');
// CONSTANTS defining Chamilo interface sections
define('SECTION_CAMPUS', 'mycampus');
@@ -4184,15 +4185,15 @@ function api_calculate_image_size($image_width, $image_height, $target_width, $t
*/
function api_get_tools_lists($my_tool = null) {
$tools_list = array(
- TOOL_DOCUMENT,TOOL_THUMBNAIL,TOOL_HOTPOTATOES,
- TOOL_CALENDAR_EVENT,TOOL_LINK,TOOL_COURSE_DESCRIPTION,TOOL_SEARCH,
- TOOL_LEARNPATH,TOOL_ANNOUNCEMENT,TOOL_FORUM,TOOL_THREAD,TOOL_POST,
- TOOL_DROPBOX,TOOL_QUIZ,TOOL_USER,TOOL_GROUP,TOOL_BLOGS,TOOL_CHAT,
- TOOL_CONFERENCE,TOOL_STUDENTPUBLICATION,TOOL_TRACKING,TOOL_HOMEPAGE_LINK,
- TOOL_COURSE_SETTING,TOOL_BACKUP,TOOL_COPY_COURSE_CONTENT,TOOL_RECYCLE_COURSE,
- TOOL_COURSE_HOMEPAGE,TOOL_COURSE_RIGHTS_OVERVIEW,TOOL_UPLOAD,TOOL_COURSE_MAINTENANCE,
- TOOL_VISIO,TOOL_VISIO_CONFERENCE,TOOL_VISIO_CLASSROOM,TOOL_SURVEY,TOOL_WIKI,
- TOOL_GLOSSARY,TOOL_GRADEBOOK,TOOL_NOTEBOOK,TOOL_ATTENDANCE
+ TOOL_DOCUMENT, TOOL_THUMBNAIL, TOOL_HOTPOTATOES,
+ TOOL_CALENDAR_EVENT, TOOL_LINK, TOOL_COURSE_DESCRIPTION, TOOL_SEARCH,
+ TOOL_LEARNPATH, TOOL_ANNOUNCEMENT, TOOL_FORUM, TOOL_THREAD, TOOL_POST,
+ TOOL_DROPBOX, TOOL_QUIZ, TOOL_USER, TOOL_GROUP, TOOL_BLOGS, TOOL_CHAT,
+ TOOL_CONFERENCE, TOOL_STUDENTPUBLICATION, TOOL_TRACKING, TOOL_HOMEPAGE_LINK,
+ TOOL_COURSE_SETTING, TOOL_BACKUP, TOOL_COPY_COURSE_CONTENT, TOOL_RECYCLE_COURSE,
+ TOOL_COURSE_HOMEPAGE, TOOL_COURSE_RIGHTS_OVERVIEW, TOOL_UPLOAD, TOOL_COURSE_MAINTENANCE,
+ TOOL_VISIO, TOOL_VISIO_CONFERENCE, TOOL_VISIO_CLASSROOM, TOOL_SURVEY, TOOL_WIKI,
+ TOOL_GLOSSARY, TOOL_GRADEBOOK, TOOL_NOTEBOOK, TOOL_ATTENDANCE, TOOL_COURSE_PROGRESS
);
if (empty($my_tool)) {
return $tools_list;
diff --git a/main/install/db_main.sql b/main/install/db_main.sql
index 7dd00278b1..a399eb9408 100644
--- a/main/install/db_main.sql
+++ b/main/install/db_main.sql
@@ -288,7 +288,8 @@ INSERT INTO course_module VALUES
(26,'gradebook','gradebook/index.php','gradebook.gif',2,2,'basic'),
(27,'glossary','glossary/index.php','glossary.gif',2,1,'basic'),
(28,'notebook','notebook/index.php','notebook.gif',2,1,'basic'),
-(29,'attendance','attendance/index.php','attendance.gif',2,1,'basic');
+(29,'attendance','attendance/index.php','attendance.gif',2,1,'basic'),
+(30,'course_progress','course_progress/index.php','course_progress.gif',2,1,'basic');
UNLOCK TABLES;
/*!40000 ALTER TABLE course_module ENABLE KEYS */;
@@ -724,7 +725,8 @@ VALUES
('course_create_active_tools','survey','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Survey', 0),
('course_create_active_tools','glossary','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Glossary', 0),
('course_create_active_tools','notebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Notebook', 0),
-('course_create_active_tools','attendances','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Attendances', 0),
+('course_create_active_tools','attendances','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Attendances', 0),
+('course_create_active_tools','course_progress','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseProgress', 0),
('advanced_filemanager',NULL,'radio','Editor','false','AdvancedFileManagerTitle','AdvancedFileManagerComment',NULL,NULL, 0),
('allow_reservation', NULL, 'radio', 'Tools', 'false', 'AllowReservationTitle', 'AllowReservationComment', NULL, NULL, 0),
('profile','apikeys','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'ApiKeys', 0),
@@ -757,7 +759,7 @@ VALUES
('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1),
('use_users_timezone', 'timezones', 'radio', 'Timezones', 'true', 'UseUsersTimezoneTitle','UseUsersTimezoneComment',NULL,'Timezones', 1),
('timezone_value', 'timezones', 'select', 'Timezones', '', 'TimezoneValueTitle','TimezoneValueComment',NULL,'Timezones', 1),
-('dokeos_database_version', NULL, 'textfield', NULL,'1.8.7.11140','DokeosDatabaseVersion','',NULL,NULL,0);
+('dokeos_database_version', NULL, 'textfield', NULL,'1.8.7.11182','DokeosDatabaseVersion','',NULL,NULL,0);
UNLOCK TABLES;
diff --git a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql
index a7b8b11b05..37a772c781 100755
--- a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql
+++ b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql
@@ -63,16 +63,18 @@ ALTER TABLE gradebook_result_log CHANGE date_log created_at DATETIME NOT NULL de
INSERT INTO user_field(field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES(11, 'timezone', 'Timezone', 0, 0);
-INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('course_create_active_tools','attendances','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Attendances', 0);
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('course_create_active_tools','attendances','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Attendances', 0);
ALTER TABLE user_field_values CHANGE id id BIGINT NOT NULL AUTO_INCREMENT;
ALTER TABLE user_field_values ADD INDEX (user_id, field_id);
-UPDATE settings_current SET selected_value = '1.8.7.11140' WHERE variable = 'dokeos_database_version';
+UPDATE settings_current SET selected_value = '1.8.7.11182' WHERE variable = 'dokeos_database_version';
ALTER TABLE course_rel_user DROP PRIMARY KEY, ADD PRIMARY KEY (course_code, user_id, relation_type);
ALTER TABLE session_rel_user DROP PRIMARY KEY, ADD PRIMARY KEY (id_session, id_user, relation_type);
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('course_create_active_tools','course_progress','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseProgress', 0);
+
-- xxSTATSxx
CREATE TABLE track_e_item_property(id int NOT NULL auto_increment PRIMARY KEY, course_id int NOT NULL, item_property_id int NOT NULL, title varchar(255), content text, progress int NOT NULL default 0, lastedit_date datetime NOT NULL default '0000-00-00 00:00:00', lastedit_user_id int NOT NULL, session_id int NOT NULL default 0);
ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id);
@@ -124,4 +126,5 @@ CREATE TABLE thematic_plan (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, thematic
ALTER TABLE thematic_plan ADD INDEX (thematic_id, description_type);
CREATE TABLE thematic_advance (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, thematic_id INT NOT NULL, attendance_id INT NOT NULL DEFAULT 0, content TEXT NOT NULL, start_date DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', duration INT NOT NULL DEFAULT 0, done_advance tinyint NOT NULL DEFAULT 0);
ALTER TABLE thematic_advance ADD INDEX (thematic_id);
-INSERT INTO course_setting (variable,value,category) VALUES ('display_info_advance_inside_homecourse',1,'thematic_advance');
\ No newline at end of file
+INSERT INTO course_setting (variable,value,category) VALUES ('display_info_advance_inside_homecourse',1,'thematic_advance');
+INSERT INTO tool(name, link, image, visibility, admin, address, added_tool, target, category) VALUES ('course_progress','course_progress/index.php','course_progress.gif',0,'0','squaregrey.gif',0,'_self','authoring');
\ No newline at end of file