<?php

global $vtiger_current_version;
if (version_compare($vtiger_current_version, '7.0.0', '>=')) {

class AdvancedReports_Debug_View extends AdvancedReports_Report_View
{
    public function process(Vtiger_Request $request)
    {
        $moduleName = $request->getModule();
        $smarty = $this->getViewer($request);

        include "modules/AdvancedReports/controller.php";
        $controller = new AdvancedReportsController();
        $controller->action_debug();

        foreach($controller->view_object_map as $key => $value) {
            $smarty->assign($key, $value);
        }

        $smarty->view('ReportViewer/report.tpl', $moduleName);
    }
}

} else {

class AdvancedReports_Debug_View extends AdvancedReports_Report_View
{
    public function process(Vtiger_Request $request) {
        $moduleName = $request->getModule();
        $smarty = $this->getViewer($request);

        include "modules/AdvancedReports/controller.php";
        $controller = new AdvancedReportsController();
        $controller->action_debug();

        foreach($controller->view_object_map as $key => $value) {
            $smarty->assign($key, $value);
        }

        $smarty->view('ReportViewer/report.tpl', $moduleName);
    }
}

}