diff --git a/main/course_progress/index.php b/main/course_progress/index.php index 28a016610b..776e8af38c 100755 --- a/main/course_progress/index.php +++ b/main/course_progress/index.php @@ -43,7 +43,8 @@ $actions = array( 'thematic_advance_list', 'thematic_advance_add', 'thematic_advance_edit', - 'thematic_advance_delete' + 'thematic_advance_delete', + 'export_single_thematic' ); $action = 'thematic_details'; @@ -269,6 +270,7 @@ switch ($action) { case 'thematic_export': case 'thematic_export_pdf': case 'thematic_details': + case 'export_single_thematic': $thematic_controller->thematic($action); break; case 'thematic_plan_add': diff --git a/main/course_progress/thematic.php b/main/course_progress/thematic.php index bcbbf6a29c..635984e6f1 100755 --- a/main/course_progress/thematic.php +++ b/main/course_progress/thematic.php @@ -132,6 +132,13 @@ if ($action == 'thematic_list') { } } if (api_get_session_id() == $thematic['session_id']) { + $actions_first_col .= Display::url( + Display::return_icon('pdf.png'), + api_get_self().'?'.api_get_cidreq()."$url_token&".http_build_query([ + 'action' => 'export_single_thematic', + 'thematic_id' => $my_thematic_id + ]) + ); $actions_first_col .= '' .Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).''; diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php index 7329ec4ebe..77ffb7a4f9 100755 --- a/main/course_progress/thematic_controller.php +++ b/main/course_progress/thematic_controller.php @@ -236,6 +236,44 @@ class ThematicController ); Export::export_table_pdf($table, $params); break; + case 'export_single_thematic': + $theme = $thematic->get_thematic_list($thematic_id); + $table = array(); + $table[] = array( + get_lang('Thematic'), + get_lang('ThematicPlan'), + get_lang('ThematicAdvance') + ); + $data = $thematic->get_thematic_plan_data($theme['id']); + $plan_html = null; + if (!empty($data)) { + foreach ($data as $plan) { + if (empty($plan['description'])) { + continue; + } + + $plan_html .= '