Fixes gradebook form link.

1.9.x
Julio Montoya 11 years ago
parent 7a8b001c77
commit a4a4118afb
  1. 14
      main/gradebook/gradebook_add_link.php

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Script * Script
* @package chamilo.gradebook * @package chamilo.gradebook
@ -35,14 +36,23 @@ if ($session_id == 0) {
} }
$category = Category :: load($_GET['selectcat']); $category = Category :: load($_GET['selectcat']);
$url = api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&newtypeselected='.$typeSelected.'&course_code='.api_get_course_id().'&'.api_get_cidreq(); $url = api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&newtypeselected='.$typeSelected.'&course_code='.api_get_course_id().'&'.api_get_cidreq();
$typeform = new LinkForm(LinkForm :: TYPE_CREATE, $category[0], null, 'create_link', null, $url, $typeSelected); $typeform = new LinkForm(
LinkForm :: TYPE_CREATE,
$category[0],
null,
'create_link',
null,
$url,
$typeSelected
);
// if user selected a link type // if user selected a link type
if ($typeform->validate() && isset($_GET['newtypeselected'])) { if ($typeform->validate() && isset($_GET['newtypeselected'])) {
// reload page, this time with a parameter indicating the selected type // reload page, this time with a parameter indicating the selected type
header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat'])
.'&typeselected='.$typeform->exportValue('select_link') .'&typeselected='.$typeform->exportValue('select_link')
.'&course_code='.Security::remove_XSS($_GET['course_code'])).'&'.api_get_cidreq(); .'&course_code='.Security::remove_XSS($_GET['course_code']).'&'.api_get_cidreq()
);
exit; exit;
} }

Loading…
Cancel
Save