Should fix bug when saving a LP see #5395

skala
Yoselyn Castillo 12 years ago
parent e253c8ce34
commit 18676d33de
  1. 13
      main/newscorm/learnpath.class.php
  2. 6
      main/newscorm/lp_controller.php
  3. 5
      main/newscorm/lp_edit_item_prereq.php

@ -7762,12 +7762,13 @@ class learnpath {
//$preq_max = $row['max_score']; //$preq_max = $row['max_score'];
$return = $this->display_manipulate($item_id, TOOL_DOCUMENT); $return = $this->display_manipulate($item_id, TOOL_DOCUMENT);
$return .= '<div class="sectioncomment">';
$return .= '<form method="POST">';
$return = '<legend>'; $return = '<legend>';
$return .= get_lang('AddEditPrerequisites'); $return .= get_lang('AddEditPrerequisites');
$return .= '</legend>'; $return .= '</legend>';
$return .= '<div class="sectioncomment">';
$return .= '<form method="POST">';
$return .= '<table class="data_table" style="width:650px">'; $return .= '<table class="data_table" style="width:650px">';
$return .= '<tr>'; $return .= '<tr>';
@ -7853,10 +7854,10 @@ class learnpath {
$return .= '</tr>'; $return .= '</tr>';
$return .= '</table>'; $return .= '</table>';
$return .= '<div style="padding-top:3px;">'; $return .= '<div style="padding-top:3px;">';
$return .= '<button class="save" name="submit_button" type="submit">' . get_lang('ModifyPrerequisites') . ' </button></td>'; $return .= '<button class="save" name="submit_button" type="submit">' . get_lang('ModifyPrerequisites') . '</button>';
$return .= '</div>'; $return .= '</div>';
$return .= '</form>'; $return .= '</form>';
$return .= '</div>'; // $return .= '</div>';
return $return; return $return;
} }
@ -9295,4 +9296,4 @@ if (!function_exists('trim_value')) {
function trim_value(& $value) { function trim_value(& $value) {
$value = trim($value); $value = trim($value);
} }
} }

@ -430,7 +430,9 @@ switch ($action) {
$_SESSION['oLP']->set_modified_on(); $_SESSION['oLP']->set_modified_on();
$_SESSION['refresh'] = 1; $_SESSION['refresh'] = 1;
$_SESSION['oLP']->edit_item_prereq($_GET['id'], $_POST['prerequisites'], $_POST['min_' . $_POST['prerequisites']], $_POST['max_' . $_POST['prerequisites']]); if ($_SESSION['oLP']->edit_item_prereq($_GET['id'], $_POST['prerequisites'], $_POST['min_' . $_POST['prerequisites']], $_POST['max_' . $_POST['prerequisites']])) {
$is_success = true;
}
} }
require 'lp_edit_item_prereq.php'; require 'lp_edit_item_prereq.php';
} }
@ -947,4 +949,4 @@ switch ($action) {
if (!empty($_SESSION['oLP'])) { if (!empty($_SESSION['oLP'])) {
$_SESSION['lpobject'] = serialize($_SESSION['oLP']); $_SESSION['lpobject'] = serialize($_SESSION['oLP']);
if ($debug > 0) error_log('New LP - lpobject is serialized in session', 0); if ($debug > 0) error_log('New LP - lpobject is serialized in session', 0);
} }

@ -113,8 +113,9 @@ echo '<div class="span3">';
echo '</div>'; echo '</div>';
echo '<div class="span9">'; echo '<div class="span9">';
if (isset($is_success) && $is_success === true) { if (isset($is_success) && $is_success == true) {
echo '<div class="lp_message" style="margin:3px 10px;">'; echo $_SESSION['oLP']->display_manipulate($_GET['id'], null);
echo '<div class="normal-message" style="margin:3px 10px;">';
echo get_lang("PrerequisitesAdded"); echo get_lang("PrerequisitesAdded");
echo '</div>'; echo '</div>';
} else { } else {

Loading…
Cancel
Save