diff --git a/main/survey/reporting.php b/main/survey/reporting.php index 905351b181..1603fb79b1 100644 --- a/main/survey/reporting.php +++ b/main/survey/reporting.php @@ -20,7 +20,7 @@ * @package dokeos.survey * @author unknown, the initial survey that did not make it in 1.8 because of bad code * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts of the code -* @version $Id: reporting.php 14635 2008-03-17 21:43:24Z yannoo $ +* @version $Id: reporting.php 14636 2008-03-17 22:24:08Z yannoo $ * * @todo The question has to be more clearly indicated (same style as when filling the survey) */ @@ -37,6 +37,16 @@ require ('../inc/global.inc.php'); */ if ($_POST['export_report']) { + if($_POST['export_xls']) + { + $data = export_complete_report(); + $filename = 'fileexport.csv'; + + echo $data; + exit; + } + else + { $data = export_complete_report(); $filename = 'fileexport.csv'; @@ -62,7 +72,7 @@ if ($_POST['export_report']) echo $data; exit; - + } } // including additional libraries diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index d2afa3cfb8..079b06ffe0 100644 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -1787,11 +1787,13 @@ class score extends question } } -function db_escape_string($value) -{ - -} - +/** + * Checks whether the given survey has a pagebreak question as the first or the last question. + * If so, break the current process, displaying an error message + * @param integer Survey ID (database ID) + * @param boolean Optional. Whether to continue the current process or exit when breaking condition found. Defaults to true (do not break). + * @return void + */ function check_first_last_question($survey_id, $continue=true) { // table definitions diff --git a/main/survey/survey.php b/main/survey/survey.php index e5436f71b6..34ec836dec 100644 --- a/main/survey/survey.php +++ b/main/survey/survey.php @@ -21,7 +21,7 @@ Tel. +32 (2) 211 34 56 * @package dokeos.survey * @author unknown * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts of the code -* @version $Id: survey.php 13296 2007-09-27 02:19:40Z yannoo $ +* @version $Id: survey.php 14636 2008-03-17 22:24:08Z yannoo $ * * @todo use quickforms for the forms */ @@ -40,7 +40,7 @@ require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/ if (!api_is_allowed_to_edit()) { - Display :: display_header(); + Display :: display_header(get_lang('Survey')); Display :: display_error_message(get_lang('NotAllowed'), false); Display :: display_footer(); exit; @@ -96,6 +96,7 @@ if (isset($_GET['message'])) } } +// We exit here is the first or last question is a pagebreak (which causes errors) check_first_last_question($_GET['survey_id']); // Action links