Allow add additional thematic plans - refs BT#12440

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent 96cbe6a002
commit 3649e6af59
  1. 23
      main/course_progress/thematic_controller.php
  2. 5
      main/course_progress/thematic_plan.php

@ -324,12 +324,29 @@ class ThematicController
); );
$thematic->thematic_plan_save(); $thematic->thematic_plan_save();
} }
unset($_SESSION['thematic_plan_token']);
$data['message'] = 'ok';
$saveRedirect = api_get_path(WEB_PATH) . 'main/course_progress/index.php?'; $saveRedirect = api_get_path(WEB_PATH) . 'main/course_progress/index.php?';
$saveRedirect.= api_get_cidreq() . '&'; $saveRedirect.= api_get_cidreq() . '&';
$saveRedirect.= 'thematic_plan_save_message=ok';
if (isset($_REQUEST['add_item'])) {
$thematic->set_thematic_plan_attributes(
$_REQUEST['thematic_id'],
'',
'',
$i
);
$thematic->thematic_plan_save();
$saveRedirect .= http_build_query([
'action' => 'thematic_plan_list',
'thematic_id' => $_REQUEST['thematic_id']
]);
} else {
$saveRedirect.= 'thematic_plan_save_message=ok';
unset($_SESSION['thematic_plan_token']);
$data['message'] = 'ok';
}
header("Location: $saveRedirect"); header("Location: $saveRedirect");
exit; exit;

@ -72,7 +72,10 @@ if ($action === 'thematic_plan_list') {
} }
$form->setDefaults($default); $form->setDefaults($default);
} }
$form->addButtonSave(get_lang('Save')); $form->addGroup([
$form->addButton('add_item', get_lang('SaveAndAddNewItem'), 'plus', 'info', 'default', null, [], true),
$form->addButtonSave(get_lang('Save'), 'submit', true)
]);
$form->display(); $form->display();
} elseif ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') { } elseif ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
if ($description_type >= ADD_THEMATIC_PLAN) { if ($description_type >= ADD_THEMATIC_PLAN) {

Loading…
Cancel
Save