X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Freports_classes.inc;h=9de492e2df6294b619aa44688c11bef542d146fc;hb=d9b4de9d7e9d3ba77f6ece752fd6cc988effd8f1;hp=97bfa0f6e2845a4b5aba147316831815a8d48968;hpb=303eb17e9cdd9702eee9fdfcaee51e654a1da541;p=fa-stable.git diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index 97bfa0f6..9de492e2 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -9,9 +9,20 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ + +// Standard report classess +define('RC_CUSTOMER', 0); +define('RC_SUPPLIER', 1); +define('RC_INVENTORY', 2); +define('RC_MANUFACTURE', 3); +define('RC_DIMENSIONS', 4); +define('RC_BANKING', 5); +define('RC_GL', 6); + class BoxReports { - var $ar_classes; + var $ar_classes; // report class names + var $ar_reports; var $ctrl_handlers = array(); function ReportClasses() @@ -19,50 +30,54 @@ class BoxReports $this->ar_classes = array(); } - function addReportClass($class_name) + function addReportClass($class_name, $class_id=null) { - $this->ar_classes[$class_name] = array(); + if (!$class_id) + $class_id = count($this->ar_classes); + $this->ar_classes[$class_id] = $class_name; + + return $class_id; } - function addReport($class_name, $id, $rep_name, $params=null) + function addReport($class, $id, $rep_name, $params=null) { - unset($this->ar_classes[$class_name][$id]); // unset std report if any - $this->ar_classes[$class_name][$id] = new Report($id, $rep_name, $params); + unset($this->ar_reports[$class][$id]); // unset std report if any + $this->ar_reports[$class][$id] = new Report($id, $rep_name, $params); } function getDisplay($class=null) { - global $table_style, $comp_path, $path_to_root, $pdf_debug, $Ajax; + global $path_to_root, $pdf_debug, $Ajax; $temp = array_values($this->ar_classes); $display_class = $class==null ? $temp[0] : $this->ar_classes[$class]; - $class_counter = 0; - $rep_counter = 0; $st_reports = ""; $st_params = ""; $st_classes = "" . _("Report Classes:") . "
"; - foreach($this->ar_classes as $key=>$value) + foreach($this->ar_classes as $class_id => $name) { - $style = $class_counter==$_REQUEST['Class'] ? '' : "style='display:none'"; - $acc = access_string($key); + $style = $class_id==$_REQUEST['Class'] ? '' : "style='display:none'"; +// $cname = access_string($key, true); +// $style = $_REQUEST['Class']==$cname ? '' : "style='display:none'"; + $acc = access_string($name); $st_classes .= "$acc[0]
"; - $st_reports .= "\n"; - foreach($value as $report) + ." onclick='return showClass(\"$class_id\");'$acc[1]>$acc[0]
"; + $st_reports .= "
" . _("Reports For Class: ") . " $key
\n"; + foreach($this->ar_reports[$class_id] as $rep_id => $report) { $acc = access_string($report->name); $st_reports .= "
" . _("Reports For Class: ") . " $name
id'" + .$_SERVER['PHP_SELF']."?Class=$class_id&rep_id=$report->id'" ." id='".default_focus()."'" ."$acc[1]>$acc[0]
\n"; if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) { $action = $path_to_root.'/reporting/prn_redirect.php'; - $st_params = "
\n" + $st_params = "
\n" . "
\n"; $st_params .= submit('Rep'.$report->id, _("Display: ") . access_string($report->name, true), @@ -74,7 +89,6 @@ class BoxReports } } $st_reports .= "
"; - $class_counter++; } $st_params = "
". @@ -83,9 +97,11 @@ class BoxReports $st = " "; - $st .= ""; + $st .= "
"; $st .= ""; - $st .= ""; + $st .= ""; $st .= ""; $st .= "
$st_classes$st_reports$st_reports$st_params

"; @@ -429,23 +445,25 @@ function gl_systypes_list($name, $value=null, $spec_opt=false) ) ); } - +/* + Add extension/custom reports to report manager. +*/ function add_custom_reports(&$reports) { - global $installed_extensions, $path_to_root, $comp_path; + global $installed_extensions, $path_to_root; // include reports installed inside extension modules if (count($installed_extensions) > 0) { $extensions = $installed_extensions; foreach ($extensions as $ext) - if (($ext['active'] && $ext['type'] == 'module')) { + if (($ext['active'] && $ext['type'] == 'extension')) { $file = $path_to_root.'/'.$ext['path']."/reporting/reports_custom.php"; if (file_exists($file)) include_once($file); } } - $file = $comp_path.'/'.user_company()."/reporting/reports_custom.php"; + $file = company_path()."/reporting/reports_custom.php"; if (file_exists($file)) include_once($file); }