Index: mod/scheduler/downloads.php
===================================================================
--- mod/scheduler/downloads.php	(revision 270)
+++ mod/scheduler/downloads.php	(revision 271)
@@ -145,15 +145,31 @@
 }
 /********************************************* csv generator : get parms ************************************/
 if ($action == 'dodownloadcsv'){
-    print_header_simple($scheduler->name, '',
-        "<a href=\"index.php?id={$course->id}\">{$strschedulers}</a> -> 
-        <a href=\"view.php?id={$cm->id}&amp;page={$page}\">".format_string($scheduler->name)."</a> -> ".get_string('csvparms', 'scheduler'), 
-        '', '', true, update_module_button($cm->id, $course->id, $strscheduler), 
-        navmenu($course, $cm));
-    
-    echo '<link rel="stylesheet" href="'.$CFG->wwwroot.'/mod/scheduler/scheduler.css" type="text/css" />';
-    echo '<link rel="stylesheet" href="'.$CFG->themewww.'/standard/scheduler.css" type="text/css" />';
-    echo '<link rel="stylesheet" href="'.$CFG->themewww.'/'.current_theme().'/scheduler.css" type="text/css" />';
+//    
+//    // Replacing deprecated function
+////    print_header_simple($scheduler->name, '',
+////                 "<a href=\"index.php?id={$course->id}\">{$strschedulers}</a> ->
+////                  <a href=\"view.php?id={$cm->id}&amp;page={$page}\">".format_string($scheduler->name)."</a> -> ".get_string('csvparms', 'scheduler'),
+////                  '', '', true, update_module_button($cm->id, $course->id, $strscheduler),
+////                  navmenu($course, $cm));
+//    $strschedulers = get_string('modulenameplural', 'scheduler');
+//    $strscheduler  = get_string('modulename', 'scheduler');
+//
+//    $navigation = build_navigation('', $cm);
+//    print_header_simple($scheduler->name, '',
+//        $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscheduler),
+//        navmenu($course, $cm));
+//    // end
+//
+//    echo '<link rel="stylesheet" href="'.$CFG->wwwroot.'/mod/scheduler/scheduler.css" type="text/css" />';
+//
+//    // CMDL-1733 Scheduler Export Errors (INC0041083)
+////    echo '<link rel="stylesheet" href="'.$CFG->themewww.'/standard/scheduler.css" type="text/css" />';
+////    echo '<link rel="stylesheet" href="'.$CFG->themewww.'/'.current_theme().'/scheduler.css" type="text/css" />';
+//    echo '<link rel="stylesheet" href="'.$CFG->theme.'/standard/scheduler.css" type="text/css" />';
+//    echo '<link rel="stylesheet" href="'.$CFG->theme.'/'.current_theme().'/scheduler.css" type="text/css" />';
+//    // end CMDL-1733
+//
     ?>
 <center>
 <?php 
@@ -226,7 +242,7 @@
 </form>
 <?php 
 echo $OUTPUT->box_end();
-print_footer($course);
+echo $OUTPUT->footer($course);
 exit;
 }
 /********************************************* csv generator : generate **********************************/
@@ -236,12 +252,22 @@
     $csvrecordseparator = $ENDLINES[required_param('csvrecordseparator', PARAM_TEXT)];
     $csvfieldseparator = required_param('csvfieldseparator', PARAM_TEXT);
     if ($csvfieldseparator == 'TAB'){
-        $csvfieldseparator = "  ";
+		// CMDL-1733 Scheduler Export Errors (INC0041083)
+		$csvfieldseparator = "	";
+        $csvfieldseparator = "\t";
+		// end CMDL-1733
     }
     $csvencoding = required_param('csvencoding', PARAM_CLEAN);
+    // CMDL-1733 Scheduler Export Errors (INC0041083)
+    /// Calculate file name
+    $downloadfilename = clean_filename(shorten_text("{$course->shortname}_{$scheduler->name}", 20).".csv");
+    // end CMDL-1733
     
     /// sending headers
     header("Content-Type:text/csv\n\n");
+    // CMDL-1733 Scheduler Export Errors (INC0041083)
+    header("Content-Disposition: attachment; filename=$downloadfilename");
+    // end CMDL-1733
     
     /// Prepare data
     $sql = "
@@ -299,8 +325,13 @@
                         $strattended = ($appointment->attended) ? ' (A) ': '';
                         $appointedlist[] = fullname($user). " $strattended";
                     }
-                    $stream .= implode(',', $appointedlist) . $csvrecordseparator;
+                
+                // CMDL-1733 Scheduler Export Errors (INC0041083)
+//                    $stream .= implode(',', $appointedlist) . $csvrecordseparator;
+                    $stream .= implode(',', $appointedlist);
                 }
+                $stream .= $csvrecordseparator;
+                // end CMDL-1733
             }
         }
     }
@@ -462,4 +493,4 @@
 </center>
 <?php
 }
-?>
\ No newline at end of file
+?>
Index: mod/scheduler/view.php
===================================================================
--- mod/scheduler/view.php	(revision 270)
+++ mod/scheduler/view.php	(revision 271)
@@ -66,7 +66,12 @@
 /// This is a pre-header selector for downloded documents generation
 
     if (has_capability('mod/scheduler:manage', $context) || has_capability('mod/scheduler:attend', $context)) {
-        if (preg_match("/downloadexcel|downloadcsv|downloadods|dodownloadcsv/", $action)){
+
+        // CMDL-1733 Scheduler Export Errors (INC0041083)
+        //if (preg_match("/downloadexcel|downloadcsv|downloadods|dodownloadcsv/", $action)){
+        if (preg_match("/downloadexcel|^downloadcsv|downloadods/", $action)){
+        // end CMDL-1733
+
             include($CFG->dirroot.'/mod/scheduler/downloads.php');
         }
     }
@@ -103,7 +108,12 @@
     elseif ($action == 'viewstudent'){
         include $CFG->dirroot.'/mod/scheduler/viewstudent.php';
     }
-    elseif ($action == 'downloads'){
+
+    // CMDL-1733 Scheduler Export Errors (INC0041083
+    //elseif ($action == 'downloads'){
+    elseif ($action == 'downloads' or $action == 'dodownloadcsv'){
+    // end CMDL-1733
+
         include $CFG->dirroot.'/mod/scheduler/downloads.php';
     }
     elseif ($action == 'datelist'){
