Updated language template, added spanish install wizard translation.
[fa-stable.git] / reporting / prn_redirect.php
index 3e362a23b3a027961dfcc1df7f6bd1247daef042..8a64ea397e65dc13c98720d5bd63ae42adfc1cb7 100644 (file)
@@ -17,11 +17,20 @@ $path_to_root = "..";
 $page_security = 'SA_OPEN';    // this level is later overriden in rep file
 include_once($path_to_root . "/includes/session.inc");
 
+if (isset($save_report_selections) && $save_report_selections > 0 && isset($_POST['REP_ID'])) {        // save parameters from Report Center
+       for($i=0; $i<10; $i++) { // 2010-10-06 Joe Hunt
+               if (isset($_POST['PARAM_'.$i]) && !is_array($_POST['PARAM_'.$i])) {
+                       $rep = $_POST['REP_ID'];
+                       setcookie("select[$rep][$i]", $_POST['PARAM_'.$i], time()+60*60*24*$save_report_selections); // days from $save_report_selections
+               }       
+       }
+}      
+
 if (isset($_GET['xls']))
 {
        $filename = $_GET['filename'];
        $unique_name = $_GET['unique'];
-       $path =  $comp_path.'/'.user_company(). '/pdf_files/';
+       $path =  company_path(). '/pdf_files/';
        header("Content-type: application/vnd.ms-excel");
        header("Content-Disposition: attachment; filename=$filename" );
        header("Expires: 0");
@@ -34,7 +43,7 @@ elseif (isset($_GET['xml']))
 {
        $filename = $_GET['filename'];
        $unique_name = $_GET['unique'];
-       $path =  $comp_path.'/'.user_company(). '/pdf_files/';
+       $path =  company_path(). '/pdf_files/';
        header("content-type: text/xml");
        header("Content-Disposition: attachment; filename=$filename");
        header("Expires: 0");
@@ -52,14 +61,13 @@ if (!isset($_POST['REP_ID'])) {     // print link clicked
                        ? $_GET['PARAM_'.$i] : $def_pars[$i];
        }
 }
-
 $rep = $_POST['REP_ID'];
 
 $rep_file = find_custom_file("/reporting/rep$rep.php");
 
-if ($rep_file)
+if ($rep_file) {
        require($rep_file);
-else
+else
        display_error("Cannot find report file '$rep'");
 exit();