예제 #1
0
 public function action_searchViewSave()
 {
     $packageName = isset($_REQUEST['view_package']) ? $_REQUEST['view_package'] : null;
     // Bug 56789 - Set the client from the view to ensure the proper viewdef file
     $client = MetaDataFiles::getClientByView($_REQUEST['view']);
     if (isModuleBWC($_REQUEST['view_module'])) {
         $parser = new SearchViewMetaDataParser($_REQUEST['view'], $_REQUEST['view_module'], $packageName, $client);
     } else {
         $client = empty($client) ? 'base' : $client;
         $parser = new SidecarFilterLayoutMetaDataParser($_REQUEST['view_module'], $packageName, $client);
     }
     $parser->handleSave();
     //Repair or create a custom SearchFields.php file as needed
     $module_name = $_REQUEST['view_module'];
     global $beanList;
     if (isset($beanList[$module_name]) && $beanList[$module_name] != "") {
         $objectName = BeanFactory::getObjectName($module_name);
         //Load the vardefs for the module to pass to TemplateRange
         VardefManager::loadVardef($module_name, $objectName, true);
         global $dictionary;
         $vardefs = $dictionary[$objectName]['fields'];
         TemplateRange::repairCustomSearchFields($vardefs, $module_name, $packageName);
     }
     $this->view = 'searchView';
 }