From 394ce7dc01f59afc69b93302e60500a3744a3374 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 26 Apr 2011 15:48:19 +0200 Subject: [PATCH] Avoiding warning message in gradebook --- main/gradebook/gradebook_flatview.php | 2 +- main/gradebook/gradebook_view_result.php | 11 ++++------- main/gradebook/lib/fe/dataform.class.php | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/main/gradebook/gradebook_flatview.php b/main/gradebook/gradebook_flatview.php index 196e78882a..1ec2a64099 100755 --- a/main/gradebook/gradebook_flatview.php +++ b/main/gradebook/gradebook_flatview.php @@ -94,7 +94,7 @@ if (isset ($_GET['exportpdf'])) { 'name' => get_lang('FlatView') ); - $export_pdf_form = new DataForm(DataForm :: TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self().'?exportpdf=&offset='.$_GET['offset'].'&selectcat='.$_GET['selectcat'], '_blank'); + $export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self().'?exportpdf=&offset='.intval($_GET['offset']).'&selectcat='.intval($_GET['selectcat']), '_blank', ''); if ($export_pdf_form->validate()) { diff --git a/main/gradebook/gradebook_view_result.php b/main/gradebook/gradebook_view_result.php index f7ab6606d6..9abd2612a7 100755 --- a/main/gradebook/gradebook_view_result.php +++ b/main/gradebook/gradebook_view_result.php @@ -84,11 +84,8 @@ if (isset ($_GET['editres'])) { } } if (isset ($_GET['import'])) { - $interbreadcrumb[]= array ( - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), - 'name' => get_lang('ViewResult' - )); - $import_result_form = new DataForm(DataForm :: TYPE_IMPORT, 'import_result_form', null, api_get_self() . '?import=&selecteval=' . Security::remove_XSS($_GET['selecteval'])); + $interbreadcrumb[]= array ('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult')); + $import_result_form = new DataForm(DataForm :: TYPE_IMPORT, 'import_result_form', null, api_get_self() . '?import=&selecteval=' . Security::remove_XSS($_GET['selecteval']), '_blank', ''); if (!$import_result_form->validate()) { Display :: display_header(get_lang('Import')); } @@ -177,8 +174,8 @@ if (isset ($_GET['import'])) { } if (isset ($_GET['export'])) { $interbreadcrumb[]= array ('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']),'name' => get_lang('ViewResult')); - - $export_result_form= new DataForm(DataForm :: TYPE_EXPORT, 'export_result_form', null, api_get_self() . '?export=&selecteval=' . $_GET['selecteval'], '_blank'); + $locked_status = $eval[0]->get_locked(); + $export_result_form= new DataForm(DataForm :: TYPE_EXPORT, 'export_result_form', null, api_get_self() . '?export=&selecteval=' . $_GET['selecteval'], '_blank', $locked_status); if (!$export_result_form->validate()) { Display :: display_header(get_lang('Export')); } diff --git a/main/gradebook/lib/fe/dataform.class.php b/main/gradebook/lib/fe/dataform.class.php index 7593178460..ed7949eb79 100755 --- a/main/gradebook/lib/fe/dataform.class.php +++ b/main/gradebook/lib/fe/dataform.class.php @@ -27,7 +27,7 @@ class DataForm extends FormValidator { * @param method * @param action */ - function DataForm($form_type, $form_name, $method = 'post', $action = null,$target='', $locked_status) { + function DataForm($form_type, $form_name, $method = 'post', $action = null, $target='', $locked_status) { parent :: __construct($form_name, $method, $action,$target); $this->form_type = $form_type; if ($this->form_type == self :: TYPE_IMPORT) {