コード例 #1
0
ファイル: Sqlreports.inc.php プロジェクト: cin-system/cinrepo
        vimport('~~/modules/SQLReports/ReportRunSQL.php');
        /**
         * @var $reportRun \ReportRunSQL
         */
        $reportRun = \ReportRunSQL::getInstance($reportId);
        $reportRun->writeReportToExcelFile($tmpFile, false);
    }
    protected function _getAvailableFiles($moduleName)
    {
        $return = array();
        if (!$this->isModuleActive()) {
            return $return;
        }
        $adb = \PearDatabase::getInstance();
        $sql = 'SELECT * FROM vtiger_sqlreports ORDER BY reportname';
        $result = $adb->query($sql);
        $reports = array();
        while ($row = $adb->fetchByAssoc($result)) {
            $return['pdf#' . $row['sqlreportsid']] = 'SQLReport - ' . $row["reportname"] . ' PDF';
            $return['xls#' . $row['sqlreportsid']] = 'SQLReport - ' . $row["reportname"] . ' XLS';
            $return['csv#' . $row['sqlreportsid']] = 'SQLReport - ' . $row["reportname"] . ' CSV';
        }
        return $return;
    }
    public function isModuleActive()
    {
        return getTabid('SQLReports') && vtlib_isModuleActive('SQLReports');
    }
}
\Workflow\InterfaceFiles::register('sqlreport', '\\Workflow\\Plugins\\InterfaceFiles\\SQLReports');
コード例 #2
0
ファイル: Pdfmaker.inc.php プロジェクト: cin-system/cinrepo
        vglobal('current_user', $oldUser);
        $filetype = "application/pdf";
        //$_REQUEST = $request;
        return array('path' => $tmpFilename, 'name' => $name, 'type' => $filetype);
    }
    protected function _getAvailableFiles($moduleName)
    {
        $return = array();
        if (!$this->isModuleActive()) {
            return $return;
        }
        /**
         * @var $PDFMaker PDFMaker_PDFMaker_Model
         */
        \Vtiger_Loader::autoLoad('PDFMaker_PDFMaker_Model');
        $PDFMaker = new \PDFMaker_PDFMaker_Model();
        if (method_exists($PDFMaker, "GetAvailableTemplates")) {
            $templates = $PDFMaker->GetAvailableTemplates($moduleName);
            foreach ($templates as $index => $value) {
                $return[$index] = 'PDFMaker - ' . $value["templatename"];
            }
        }
        return $return;
    }
    public function isModuleActive()
    {
        return getTabid('PDFMaker') && vtlib_isModuleActive('PDFMaker');
    }
}
\Workflow\InterfaceFiles::register('pdfmaker', '\\Workflow\\Plugins\\InterfaceFiles\\PDFMaker');