예제 #1
0
 public function process(Vtiger_Request $request)
 {
     $this->preProcess($request);
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $srcRecord = $request->get('src_record');
     $srcModule = $request->get('src_module');
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $treeCategoryModel = Vtiger_TreeCategoryModal_Model::getInstance($moduleModel);
     $treeCategoryModel->set('srcRecord', $srcRecord);
     $treeCategoryModel->set('srcModule', $srcModule);
     $this->relationType = $treeCategoryModel->getRelationType();
     $viewer->assign('TREE', Zend_Json::encode($treeCategoryModel->getTreeData()));
     $viewer->assign('SRC_RECORD', $srcRecord);
     $viewer->assign('SRC_MODULE', $srcModule);
     $viewer->assign('TEMPLATE', $treeCategoryModel->getTemplate());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SELECTABLE_CATEGORY', AppConfig::relation('SELECTABLE_CATEGORY') ? 1 : 0);
     $viewer->assign('RELATION_TYPE', $this->relationType);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->view('TreeCategoryModal.tpl', $moduleName);
     $this->postProcess($request);
 }
 public function getTreeViewModel()
 {
     return Vtiger_TreeCategoryModal_Model::getInstance($this->getRelatedModuleModel());
 }