From: Janusz Dobrowolski Date: Fri, 17 Sep 2010 12:10:41 +0000 (+0000) Subject: Fixed custom reports includes issue. X-Git-Tag: v2.4.2~19^2~621 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=492a9e795d7e0bb32a50449c60d3f9e40e81c79c;p=fa-stable.git Fixed custom reports includes issue. --- diff --git a/includes/main.inc b/includes/main.inc index fd4aa977..55a97b2b 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -312,10 +312,10 @@ function find_custom_file($rep) // customized per company version $path = company_path(); - $file = $path.'/'.$rep; + $file = $path.$rep; if (file_exists($file)) { // add local include path - set_include_path($path.PATH_SEPARATOR.get_include_path()); + set_include_path(dirname($file).PATH_SEPARATOR.get_include_path()); return $file; } // file added by active extension modules @@ -340,5 +340,4 @@ function find_custom_file($rep) return null; } - ?> \ No newline at end of file diff --git a/reporting/prn_redirect.php b/reporting/prn_redirect.php index a9f4d336..ce525ea1 100644 --- a/reporting/prn_redirect.php +++ b/reporting/prn_redirect.php @@ -58,8 +58,7 @@ $rep = $_POST['REP_ID']; $rep_file = find_custom_file("/reporting/rep$rep.php"); if ($rep_file) { - chdir(dirname($rep_file)); - require(basename($rep_file)); + require($rep_file); } else display_error("Cannot find report file '$rep'"); exit();