diff --git a/main/course_progress/index.php b/main/course_progress/index.php index 1899bb52d9..7c933a0d88 100755 --- a/main/course_progress/index.php +++ b/main/course_progress/index.php @@ -81,6 +81,7 @@ if (!empty($thematic_id)) { $thematic_data = $thematic->get_thematic_list($thematic_id); } + // get default thematic plan title $default_thematic_plan_title = $thematic->get_default_thematic_plan_title(); diff --git a/main/course_progress/thematic.php b/main/course_progress/thematic.php index 6b18c0db74..f7186c8e3c 100755 --- a/main/course_progress/thematic.php +++ b/main/course_progress/thematic.php @@ -96,7 +96,7 @@ if ($action == 'thematic_list') { $message = Display::return_message($text,'info', false); } - + $list = []; // Display thematic data if (!empty($thematic_data)) { // display progress @@ -104,6 +104,15 @@ if ($action == 'thematic_list') { echo '
'.get_lang('Thematic').' | '.get_lang('ThematicPlan').' | '.get_lang('ThematicAdvance').' | |||||||
---|---|---|---|---|---|---|---|---|---|
';
- //if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) {
- if (api_is_allowed_to_edit(null, true)) {
- echo ' '; - } if (empty($thematic_plan_div[$thematic['id']])) { - echo Display::div('', array('id' => "thematic_plan_".$thematic['id'])); + $list['thematic_plan'] = null; } else { - echo $thematic_plan_div[$thematic['id']]; + $list['thematic_plan'] = $thematic_plan_div[$thematic['id']]; } echo ' | ';
// Display 3rd column - thematic advance data
echo '';
- //if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) {
- if (api_is_allowed_to_edit(null, true)) {
- echo '';
- }
//if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) {
if (!empty($thematic_advance_data[$thematic['id']])) {
+
+ $list['thematic_advance'] = $thematic_advance_data[$thematic['id']];
+
echo ' '.get_lang('ThereIsNoAThematicSection').' ';
@@ -310,8 +319,9 @@ if ($action == 'thematic_list') {
$tpl->assign('actions', $toolbar);
$tpl->assign('message', $message);
-$tpl->assign('data',$data);
-$tpl->assign('score_progress', $score);
+$tpl->assign('data',$listThematic);
+$tpl->assign('session_star',$session_star);
+$tpl->assign('score_progress', $total_average_of_advances);
$tpl->assign('thamatic', $thematic);
$thematicLayout = $tpl->get_template('course_progress/progress.tpl');
$tpl->display($thematicLayout);
\ No newline at end of file
diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php
index 5c775d3a72..8711597b61 100755
--- a/main/course_progress/thematic_controller.php
+++ b/main/course_progress/thematic_controller.php
@@ -315,7 +315,7 @@ class ThematicController
// Third column
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
- $data['thematic_plan_div'] = $thematic->get_thematic_plan_div($thematic_plan_data);
+ $data['thematic_plan_div'] = $thematic->get_thematic_plan_array($thematic_plan_data);
$data['thematic_advance_div'] = $thematic->get_thematic_advance_div($thematic_advance_data);
$data['thematic_plan_data'] = $thematic_plan_data;
$data['thematic_advance_data'] = $thematic_advance_data;
@@ -328,7 +328,6 @@ class ThematicController
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
// render to the view
-
$this->view->set_data($data);
$this->view->set_layout($layoutName);
$this->view->set_template('thematic');
diff --git a/main/img/icons/16/cd.png b/main/img/icons/16/cd.png
new file mode 100644
index 0000000000..1e8e16a891
Binary files /dev/null and b/main/img/icons/16/cd.png differ
diff --git a/main/img/icons/16/delete.png b/main/img/icons/16/delete.png
index f26e2636e3..fa43cbf840 100755
Binary files a/main/img/icons/16/delete.png and b/main/img/icons/16/delete.png differ
diff --git a/main/img/icons/16/down.png b/main/img/icons/16/down.png
new file mode 100644
index 0000000000..f49028fd62
Binary files /dev/null and b/main/img/icons/16/down.png differ
diff --git a/main/img/icons/16/down_na.png b/main/img/icons/16/down_na.png
new file mode 100644
index 0000000000..513babe08e
Binary files /dev/null and b/main/img/icons/16/down_na.png differ
diff --git a/main/img/icons/16/pdf.png b/main/img/icons/16/pdf.png
new file mode 100644
index 0000000000..54d20aec30
Binary files /dev/null and b/main/img/icons/16/pdf.png differ
diff --git a/main/img/icons/16/up.png b/main/img/icons/16/up.png
new file mode 100644
index 0000000000..e06c1cab13
Binary files /dev/null and b/main/img/icons/16/up.png differ
diff --git a/main/img/icons/16/up_na.png b/main/img/icons/16/up_na.png
new file mode 100644
index 0000000000..3e18c99970
Binary files /dev/null and b/main/img/icons/16/up_na.png differ
diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php
index aefe8d81e6..0ad48ae5e8 100755
--- a/main/inc/lib/template.lib.php
+++ b/main/inc/lib/template.lib.php
@@ -136,6 +136,7 @@ class Template
$this->twig->addFilter('icon', new Twig_Filter_Function('Template::get_icon_path'));
$this->twig->addFilter('img', new Twig_Filter_Function('Template::get_image'));
$this->twig->addFilter('format_date', new Twig_Filter_Function('Template::format_date'));
+ $this->twig->addFilter('isAllowedToEdit', new Twig_Filter_Function('Template::isAllowedToEdit'));
$this->twig->addFilter('api_get_local_time', new Twig_Filter_Function('api_get_local_time'));
// a combination of the two previous functions
$this->twig->addFilter('local_format_date', new Twig_Filter_Function('api_convert_and_format_date'));
@@ -236,7 +237,18 @@ class Template
{
return api_format_date($timestamp, $format);
}
-
+
+ /**
+ * @param string $image
+ * @param int $size
+ * @param string $name
+ * @return string
+ */
+ public static function isAllowedToEdit($tutor= false, $coach = false, $session_coach = false, $check_student_view = true)
+ {
+ return api_is_allowed_to_edit($tutor, $coach,$session_coach, $check_student_view);
+ }
+
/**
* Return the item's url key:
*
diff --git a/main/inc/lib/thematic.lib.php b/main/inc/lib/thematic.lib.php
index 30b19ca9ee..4ff9d12454 100755
--- a/main/inc/lib/thematic.lib.php
+++ b/main/inc/lib/thematic.lib.php
@@ -614,7 +614,7 @@ class Thematic
* @param array $data
* @return array
*/
- public function get_thematic_plan_div($data)
+ public function get_thematic_plan_array($data)
{
$final_return = array();
$uinfo = api_get_user_info();
@@ -632,10 +632,10 @@ class Thematic
}
}
- $no_data = true;
$session_star = '';
- $return = '';
+ $return = array();
if (!empty($default_thematic_plan_title)) {
+
foreach ($default_thematic_plan_title as $id=>$title) {
//avoid others
if ($title == 'Others' && empty($data[$thematic_id][$id]['description'])) {
@@ -647,17 +647,18 @@ class Thematic
$session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
}
}
- $return .= Display::tag('h3', Security::remove_XSS($data[$thematic_id][$id]['title'], STUDENT).$session_star);
- $return .= Security::remove_XSS($data[$thematic_id][$id]['description'], STUDENT);
- $no_data = false;
+
+ $return[$id]['title'] = Security::remove_XSS($data[$thematic_id][$id]['title'], STUDENT).$session_star;
+ $return[$id]['description'] = Security::remove_XSS($data[$thematic_id][$id]['description'], STUDENT);
}
}
}
+ $final_return[$thematic_id] = $return;
+ /*
if ($no_data) {
$return .= ' ';
- $final_return[$thematic_id] = $return;
+ */
}
return $final_return;
diff --git a/main/template/default/course_progress/progress.tpl b/main/template/default/course_progress/progress.tpl
index 55174873e9..67640bb81e 100644
--- a/main/template/default/course_progress/progress.tpl
+++ b/main/template/default/course_progress/progress.tpl
@@ -1,13 +1,105 @@
{% extends template ~ "/layout/layout_1_col.tpl" %}
{% block content %}
-{{ data | var_dump }}
+{% set tutor = false | isAllowedToEdit(true) %}
'.get_lang('StillDoNotHaveAThematicPlan').' ';
}
- $return .= '{{ 'Progress' | get_lang }}: {{ score_progress }} %
+
|