Added using per company customized report files.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 24 Apr 2008 11:11:09 +0000 (11:11 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 24 Apr 2008 11:11:09 +0000 (11:11 +0000)
admin/create_coy.php
reporting/includes/reports_classes.inc

index e8cd72225bcbf9a7730849bd51e85aed66167c39..af3cffd299cf1c696e594baef0f5b0875a32d666 100644 (file)
@@ -11,7 +11,7 @@ include_once($path_to_root . "/includes/ui.inc");
 
 page(_("Create/Update Company"));
 
-$comp_subdirs = array('images', 'pdf_files', 'backup','js_cache');
+$comp_subdirs = array('images', 'pdf_files', 'backup','js_cache', 'reporting');
 
 //---------------------------------------------------------------------------------------------
 
index 761ef43cb922364f0e28d5740e9ad38a9b5b70af..995a39d73c7a535481c3678fd155ecb1e765958a 100644 (file)
@@ -85,7 +85,13 @@ class Report
        }
        function getDisplay() 
        {
-               global $path_to_root, $use_date_picker;
+               global $comp_path, $path_to_root, $use_date_picker;
+
+               $rep_file = $comp_path.'/'.user_company().
+                    "/reporting/rep".$this->id.".php";  
+               if (!file_exists($rep_file))
+                   $rep_file = $path_to_root ."/reporting/rep".$this->id.".php";
+                   
                $st = "
 <script language='javascript'>
        function displayReport_" . $this->id . "() {
@@ -98,7 +104,7 @@ class Report
 
                window.open('','REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
                document.forms[0].target='REP_WINDOW';
-               document.forms[0].action= '" . $path_to_root . "/reporting/rep" . $this->id . ".php';
+               document.forms[0].action= '$rep_file';
                document.forms[0].submit();
        }
        function checkDate(pObj) {