fix error notice in course progrress

pull/2487/head
Alex Aragon 8 years ago
parent 2da8effbaa
commit 9f2cf5d77e
  1. 18
      main/course_progress/thematic.php
  2. 1
      main/template/default/course_progress/progress.tpl

@ -175,6 +175,7 @@ if ($action == 'thematic_list') {
$tpl->assign('data', $listThematic); $tpl->assign('data', $listThematic);
} //End for } //End for
} }
$thematicLayout = $tpl->get_template('course_progress/progress.tpl');
} elseif ($action == 'thematic_add' || $action == 'thematic_edit') { } elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
// Display form // Display form
$form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq()); $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq());
@ -213,7 +214,8 @@ if ($action == 'thematic_list') {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
} }
if ($show_form) { if ($show_form) {
$form->display(); $html = $form->return_form();
} }
} elseif ($action == 'thematic_import_select') { } elseif ($action == 'thematic_import_select') {
// Create form to upload csv file. // Create form to upload csv file.
@ -222,11 +224,15 @@ if ($action == 'thematic_list') {
$form->addElement('file', 'file'); $form->addElement('file', 'file');
$form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic')); $form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic'));
$form->addButtonImport(get_lang('Import'), 'SubmitImport'); $form->addButtonImport(get_lang('Import'), 'SubmitImport');
$form->display(); $html = $form->return_form();
} }
$tpl->assign('actions', $toolbar); $tpl->assign('actions', $toolbar);
$tpl->assign('message', $message); if (!empty($html)) {
$tpl->assign('score_progress', $total_average_of_advances); $tpl->assign('content', $html);
$thematicLayout = $tpl->get_template('course_progress/progress.tpl'); $thematicLayout = $tpl->get_template('course_progress/layout.tpl');
}
if (!empty($message) && !empty($total_average_of_advances)) {
$tpl->assign('message', $message);
$tpl->assign('score_progress', $total_average_of_advances);
}
$tpl->display($thematicLayout); $tpl->display($thematicLayout);

@ -118,5 +118,6 @@
</div> </div>
</div> </div>
{% else %} {% else %}
{{ content }}
<div class="alert alert-info" role="alert">{{ 'ThereIsNoAThematicSection' | get_lang }}</div> <div class="alert alert-info" role="alert">{{ 'ThereIsNoAThematicSection' | get_lang }}</div>
{% endif %} {% endif %}
Loading…
Cancel
Save