Minor - Adding messages

skala
Julio Montoya 12 years ago
parent 531f5e71cc
commit 42434e8edc
  1. 7
      main/newscorm/learnpath.class.php
  2. 11
      main/newscorm/lp_add_item.php
  3. 10
      main/newscorm/lp_controller.php

@ -4042,7 +4042,6 @@ class learnpath {
} else {
return false;
}
}
/**
@ -4367,7 +4366,7 @@ class learnpath {
if ($this->debug > 2) {
error_log('New LP - lp updated with new expired_on : ' . $this->modified_on, 0);
}
$res = Database::query($sql);
Database::query($sql);
return true;
}
@ -5310,7 +5309,7 @@ class learnpath {
$buttons = array(
array(
'title' => get_lang('SetPrerequisiteFoEachItem'),
'title' => get_lang('SetPrerequisiteForEachItem'),
'href' => 'lp_controller.php?'.api_get_cidreq().'&action=set_previous_step_as_prerequisite&lp_id=' . $_SESSION['oLP']->lp_id,
),
array(
@ -9244,7 +9243,7 @@ EOD;
$sql = "UPDATE $tbl_lp_item SET prerequisite = ''
WHERE c_id = ".$course_id." AND lp_id = '$lp_id'";
Database::query($sql);
//Cleaning mastery score for exercises
$sql = "UPDATE $tbl_lp_item SET mastery_score = ''
WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND item_type = 'quiz'";

@ -248,10 +248,14 @@ echo '<div id="lp_sidebar" class="span4">';
echo $_SESSION['oLP']->return_new_tree(null, true);
$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
// Show the template list.
if ($type == 'document' && !isset($_GET['file'])) {
// Show the template list.
echo '<div id="frmModel" style="display:block; height:890px;width:100px; position:relative;"></div>';}
echo '<div id="frmModel" style="display:block; height:890px;width:100px; position:relative;"></div>';
}
echo '</div>';
//hide bar div
@ -261,6 +265,11 @@ if ($action == 'add_item' && $type == 'document' && !isset($_GET['file'])) {
echo '<div id="doc_form" class="span8">';
//@todo use session flash messages
if (in_array($message, array('ItemUpdated'))) {
echo Display::return_message(get_lang($message));
}
if (isset($new_item_id) && is_numeric($new_item_id)) {
switch ($type) {
case 'chapter':

@ -100,6 +100,7 @@ $lpfound = false;
$myrefresh = 0;
$myrefresh_id = 0;
if (!empty($_SESSION['refresh']) && $_SESSION['refresh'] == 1) {
// Check if we should do a refresh of the oLP object (for example after editing the LP).
// If refresh is set, we regenerate the oLP object from the database (kind of flush).
@ -223,8 +224,6 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') {
}
}
$action = (!empty($_REQUEST['action']) ? $_REQUEST['action'] : '');
switch ($action) {
@ -965,7 +964,7 @@ switch ($action) {
require 'lp_list.php';
} else {
if ($debug > 0) {error_log('New LP - Trying to impress this LP item to ' . $_REQUEST['item_id'], 0); }
if ( !empty($_REQUEST['item_id']) ) {
if (!empty($_REQUEST['item_id']) ) {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}
require 'lp_impress.php';
@ -973,17 +972,16 @@ switch ($action) {
break;
case 'set_previous_step_as_prerequisite':
$_SESSION['oLP']->set_previous_step_as_prerequisite_for_all_items();
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id);
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id)."&message=ItemUpdated";
header('Location: '.$url);
break;
case 'clear_prerequisites':
$_SESSION['oLP']->clear_prerequisites();
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id);
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id)."&message=ItemUpdated";
header('Location: '.$url);
break;
default:
if ($debug > 0) error_log('New LP - default action triggered', 0);
//$_SESSION['refresh'] = 1;
require 'lp_list.php';
break;
}

Loading…
Cancel
Save