Revision: 2322
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2322&view=rev
Author:   cimorrison
Date:     2012-07-09 09:44:24 +0000 (Mon, 09 Jul 2012)
Log Message:
-----------
Restructured code slightly

Modified Paths:
--------------
    mrbs/trunk/web/report.php
    mrbs/trunk/web/systemdefaults.inc.php

Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php   2012-07-08 15:45:14 UTC (rev 2321)
+++ mrbs/trunk/web/report.php   2012-07-09 09:44:24 UTC (rev 2322)
@@ -1051,22 +1051,29 @@
 {
   print_header($day, $month, $year, $area, isset($room) ? $room : "");
 }
-elseif ($output_format == OUTPUT_CSV)
+else
 {
   $filename = ($output == REPORT) ? $report_filename : $summary_filename;
-  header("Content-Type: text/csv; charset=" . get_csv_charset());
+  switch ($output_format)
+  {
+    case OUTPUT_CSV:
+      $filename .= '.csv';
+      $content_type = "text/csv; charset=" . get_csv_charset();
+      break;
+    default:
+      require_once "functions_ical.inc";
+      $filename .= '.ics';
+      $content_type = "application/ics; charset=" . get_charset() . "; 
name=\"$filename\"";
+      break;
+  }
+  header("Content-Type: $content_type");
   header("Content-Disposition: attachment; filename=\"$filename\"");
-  if ($csv_bom)
+
+  if (($output_format == OUTPUT_CSV) && $csv_bom)
   {
     echo get_bom(get_csv_charset());
   }
 }
-else // Assumed to be output_as_ical
-{
-  require_once "functions_ical.inc";
-  header("Content-Type: application/ics;  charset=" . get_charset(). "; 
name=\"" . $mail_settings['ics_filename'] . ".ics\"");
-  header("Content-Disposition: attachment; filename=\"" . 
$mail_settings['ics_filename'] . ".ics\"");
-}
 
 
 // Upper part: The form.

Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php       2012-07-08 15:45:14 UTC (rev 
2321)
+++ mrbs/trunk/web/systemdefaults.inc.php       2012-07-09 09:44:24 UTC (rev 
2322)
@@ -913,10 +913,6 @@
 // fields are set)
 $mail_settings['treat_cc_as_to'] = FALSE;
 
-// The filename to be used for iCalendar attachments.   Will always have the
-// extension '.ics'
-$mail_settings['ics_filename'] = "booking";
-
 // Set this to TRUE if you want MRBS to output debug information to the browser
 // when you are sending email.   If you are not getting emails it can be 
helpful
 // by telling you (a) whether the mail functions are being called in the first 
place
@@ -978,9 +974,9 @@
  * Reports
  *************/
  
-// Default CSV file names
-$report_filename  = "report.csv";
-$summary_filename = "summary.csv";
+// Default file names
+$report_filename  = "report";
+$summary_filename = "summary";
 
 // CSV format
 $csv_row_sep = "\n";  // Separator between rows/records

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to