예제 #1
0
 function importBasicStep(Vtiger_Request $request)
 {
     global $upload_maxsize;
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $moduleMeta = $moduleModel->getModuleMeta();
     $viewer->assign('FOR_MODULE', $moduleName);
     $viewer->assign('MODULE', 'Import');
     $viewer->assign('SUPPORTED_FILE_TYPES', Import_Utils_Helper::getSupportedFileExtensions());
     $viewer->assign('SUPPORTED_FILE_ENCODING', Import_Utils_Helper::getSupportedFileEncoding());
     $viewer->assign('SUPPORTED_DELIMITERS', Import_Utils_Helper::getSupportedDelimiters());
     $viewer->assign('AUTO_MERGE_TYPES', Import_Utils_Helper::getAutoMergeTypes());
     //Duplicate records handling not supported for inventory moduels
     $duplicateHandlingNotSupportedModules = getInventoryModules();
     if (in_array($moduleName, $duplicateHandlingNotSupportedModules)) {
         $viewer->assign('DUPLICATE_HANDLING_NOT_SUPPORTED', true);
     }
     //End
     $viewer->assign('AVAILABLE_FIELDS', $moduleMeta->getMergableFields());
     $viewer->assign('ENTITY_FIELDS', $moduleMeta->getEntityFields());
     $viewer->assign('ERROR_MESSAGE', $request->get('error_message'));
     $viewer->assign('IMPORT_UPLOAD_SIZE', $upload_maxsize);
     $viewer->assign('IMPORT_UPLOAD_SIZE_MB', round($upload_maxsize / 1024 / 1024, 2));
     return $viewer->view('ImportBasicStep.tpl', 'Import');
 }
 function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $source_module = $request->getModule();
     $viewId = $request->get('viewname');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     $page = $request->get('page');
     $viewer->assign('SELECTED_IDS', $selectedIds);
     $viewer->assign('EXCLUDED_IDS', $excludedIds);
     $viewer->assign('VIEWID', $viewId);
     $viewer->assign('PAGE', $page);
     $viewer->assign('SOURCE_MODULE', $source_module);
     $viewer->assign('MODULE', 'Export');
     //SalesPlatform.ru add encoding and delimiter support
     $viewer->assign('SUPPORTED_FILE_ENCODING', Import_Utils_Helper::getSupportedFileEncoding());
     $viewer->assign('SUPPORTED_DELIMITERS', Import_Utils_Helper::getSupportedDelimiters());
     //SalesPlatform.ru end
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $operator = $request->get('operator');
     if (!empty($operator)) {
         $viewer->assign('OPERATOR', $operator);
         $viewer->assign('ALPHABET_VALUE', $searchValue);
         $viewer->assign('SEARCH_KEY', $searchKey);
     }
     $viewer->assign('SEARCH_PARAMS', $request->get('search_params'));
     $viewer->view('Export.tpl', $source_module);
 }