Validate some undefined variables - refs #6876

1.9.x
Francis Gonzales 12 years ago
parent 95de2a6d44
commit 043c0db18a
  1. 2
      main/gradebook/gradebook_add_cat.php
  2. 3
      main/gradebook/gradebook_add_result.php
  3. 4
      main/gradebook/lib/fe/displaygradebook.php
  4. 7
      main/gradebook/lib/fe/evalform.class.php
  5. 5
      main/gradebook/lib/scoredisplay.class.php
  6. 1
      main/inc/lib/document.lib.php

@ -44,7 +44,7 @@ $(document).ready(function () {
if (skill_id) {
$.ajax({
url: "'.api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=remove_skill",
data: "gradebook_id='.$edit_cat.'&skill_id="+skill_id,
data: "gradebook_id=' . $edit_cat . '&skill_id="+skill_id,
success: function(return_value) {
if (return_value == 1 ) {
$("#skill_"+skill_id).remove();

@ -24,7 +24,8 @@ block_students();
$resultadd = new Result();
$resultadd->set_evaluation_id($_GET['selecteval']);
$evaluation = Evaluation :: load($_GET['selecteval']);
$add_result_form = new EvalForm(EvalForm :: TYPE_RESULT_ADD, $evaluation[0], $resultadd, 'add_result_form', null, api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']));
$category = !empty($_GET['selectcat']) ? $_GET['selectcat'] : "";
$add_result_form = new EvalForm(EvalForm :: TYPE_RESULT_ADD, $evaluation[0], $resultadd, 'add_result_form', null, api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']));
$table = $add_result_form->toHtml();
if ($add_result_form->validate()) {
$values = $add_result_form->exportValues();

@ -63,7 +63,7 @@ class DisplayGradebook
$scoredisplay = ScoreDisplay :: instance();
$student_score = '';
$average = "";
if (($evalobj->has_results())) { // TODO this check needed ?
$score = $evalobj->calc_score();
@ -73,7 +73,7 @@ class DisplayGradebook
$student_score = Display::tag('h3', get_lang('Score') . ': ' . $scoredisplay->display_score($student_score, SCORE_DIV_PERCENT));
}
}
$description = "";
if (!$evalobj->get_description() == '') {
$description = get_lang('Description') . ' :<b> ' . $evalobj->get_description() . '</b><br>';
}

@ -145,7 +145,7 @@ class EvalForm extends FormValidator
$renderer->setHeaderTemplate(
'<tr>
<th>' . get_lang('OfficialCode') . '</th>
<th>' . get_lang('UserName') . '</th>
<th>' . get_lang('UserName') . '</th>
<th>' . get_lang('FirstName') . '</th>
<th>' . get_lang('LastName') . '</th>
<th>' . get_lang('Qualify') . '</th>
@ -389,6 +389,7 @@ class EvalForm extends FormValidator
protected function build_editing_form()
{
$parent_cat = Category :: load($this->evaluation_object->get_category_id());
//@TODO $weight_mask is replaced?
if ($parent_cat[0]->get_parent_id() == 0) {
$weight_mask = $this->evaluation_object->get_weight();
} else {
@ -396,7 +397,7 @@ class EvalForm extends FormValidator
$global_weight = $cat[0]->get_weight();
$weight_mask = $global_weight * $this->evaluation_object->get_weight() / $parent_cat[0]->get_weight();
}
$weight_mask = $this->evaluation_object->get_weight();
$weight = $weight_mask = $this->evaluation_object->get_weight();
$this->setDefaults(array('hid_id' => $this->evaluation_object->get_id(),
'name' => $this->evaluation_object->get_name(),
@ -422,7 +423,7 @@ class EvalForm extends FormValidator
{
$form_title = get_lang('NewEvaluation');
if ($_GET['editeval'] == 1) {
if (!empty($_GET['editeval']) && $_GET['editeval'] == 1) {
$form_title = get_lang('EditEvaluation');
}

@ -118,7 +118,10 @@ class ScoreDisplay
if (!empty($displays)) {
foreach ($displays as $display) {
$data = explode('::', $display['selected_value']);
$portal_displays[$data[0]] = array('score' => $data[0], 'display' =>$data[1]);
if (empty($data[1])) {
$data[1] = "";
}
$portal_displays[$data[0]] = array('score' => $data[0], 'display' => $data[1]);
}
sort($portal_displays);
}

@ -1663,6 +1663,7 @@ class DocumentManager
$date_certificate = $info_grade_certificate['created_at'];
$date_long_certificate = '';
$date_no_time = "";
if (!empty($date_certificate)) {
$date_long_certificate = api_convert_and_format_date($date_certificate);
$date_no_time = api_convert_and_format_date($date_certificate, DATE_FORMAT_LONG_NO_DAY);

Loading…
Cancel
Save