function __construct()
 {
     parent::__construct();
     $this->exposeMethod('restoreRecords');
     $this->exposeMethod('emptyRecycleBin');
     $this->exposeMethod('deleteRecords');
 }
 function process(Vtiger_Request $request)
 {
     $log = vglobal('log');
     $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '() method ...');
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $view = $request->get('fromview');
     $viewer = $this->getViewer($request);
     $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'MappedFields', $moduleName);
     $mfModel = new $handlerClass();
     if ($view == 'List') {
         $allRecords = Vtiger_Mass_Action::getRecordsListFromRequest($request);
         $templates = $mfModel->getActiveTemplatesForModule($moduleName, $view);
         $viewer->assign('ALL_RECORDS', $allRecords);
     } else {
         $templates = $mfModel->getActiveTemplatesForRecord($recordId, $view, $moduleName);
         $viewer->assign('RECORD', $recordId);
     }
     $viewer->assign('TEMPLATES', $templates);
     $viewer->assign('VIEW', $view);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('BASE_MODULE_NAME', 'Vtiger');
     $this->preProcess($request);
     $viewer->view('GenerateModal.tpl', $qualifiedModule);
     $this->postProcess($request);
     $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
 }
Exemple #3
0
 function process(Vtiger_Request $request)
 {
     $this->preProcess($request);
     $moduleName = $request->getModule();
     $allRecords = [];
     $recordId = $request->get('record');
     $view = $request->get('fromview');
     $allRecords = Vtiger_Mass_Action::getRecordsListFromRequest($request);
     $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleName);
     $pdfModel = new $handlerClass();
     $viewer = $this->getViewer($request);
     if ($view === 'Detail') {
         $viewer->assign('TEMPLATES', $pdfModel->getActiveTemplatesForRecord($recordId, $view, $moduleName));
     } elseif ($view === 'List') {
         $viewer->assign('TEMPLATES', $pdfModel->getActiveTemplatesForModule($moduleName, $view));
     }
     $exportValues = '&record=' . $recordId . '&fromview=' . $view;
     $viewer->assign('ALL_RECORDS', $allRecords);
     $viewer->assign('EXPORT_VARS', $exportValues);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->view('ExportPDF.tpl', $moduleName);
     $this->postProcess($request);
 }