Esempio n. 1
0
 function getRecordsListFromRequest(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/IndexAjax.php::getRecordsListFromRequest");
     $cvId = $request->get('cvid');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     if (!empty($selectedIds) && $selectedIds != 'all') {
         if (!empty($selectedIds) && count($selectedIds) > 0) {
             return $selectedIds;
         }
     }
     $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
     if ($customViewModel) {
         $searchKey = $request->get('search_key');
         $searchValue = $request->get('search_value');
         $operator = $request->get('operator');
         if (!empty($operator)) {
             $customViewModel->set('operator', $operator);
             $customViewModel->set('search_key', $searchKey);
             $customViewModel->set('search_value', $searchValue);
         }
         return $customViewModel->getRecordIds($excludedIds);
     }
 }
Esempio n. 2
0
 protected function getRecordsListFromRequest(Vtiger_Request $request)
 {
     $cvId = $request->get('viewname');
     $module = $request->get('module');
     if (!empty($cvId) && $cvId == "undefined") {
         $sourceModule = $request->get('sourceModule');
         $cvId = CustomView_Record_Model::getAllFilterByModule($sourceModule)->getId();
     }
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     if (!empty($selectedIds) && $selectedIds != 'all') {
         if (!empty($selectedIds) && count($selectedIds) > 0) {
             return $selectedIds;
         }
     }
     $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
     if ($customViewModel) {
         $searchKey = $request->get('search_key');
         $searchValue = $request->get('search_value');
         $operator = $request->get('operator');
         if (!empty($operator)) {
             $customViewModel->set('operator', $operator);
             $customViewModel->set('search_key', $searchKey);
             $customViewModel->set('search_value', $searchValue);
         }
         $customViewModel->set('search_params', $request->get('search_params'));
         return $customViewModel->getRecordIds($excludedIds, $module);
     }
 }
Esempio n. 3
0
    private function getCVModelFromRequest(Vtiger_Request $request) {
        $cvId = $request->get('cvid');

        if (!empty($cvId)) {
            $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
        } else {
            $customViewModel = CustomView_Record_Model::getCleanInstance();
            $customViewModel->setModule($request->get('source_module'));
        }

        $customViewData = array(
            'cvid' => $cvId,
            'viewname' => $customViewModel->get('viewname'),
            'setdefault' => $customViewModel->get('setdefault'),
            'setmetrics' => $customViewModel->get('setmetrics'),
            'status' => $customViewModel->get('status')
        );

        $selectedColumnsList = $request->get('columnslist');
        if (!empty($selectedColumnsList)) {
            $customViewData['columnslist'] = $selectedColumnsList;
        }

        return $customViewModel->setData($customViewData);
    }
Esempio n. 4
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["fgwbuhrxu"] = "adb";
     $symwrz = "customViewModel";
     ${${"GLOBALS"}["fgwbuhrxu"]} = PearDatabase::getInstance();
     $cerakpgxi = "recordIds";
     ${"GLOBALS"}["ydhdsoshkjcr"] = "params";
     $cwhzpepgkpy = "params";
     ${${"GLOBALS"}["ydhdsoshkjcr"]} = $request->getAll();
     ${${"GLOBALS"}["igosddeyg"]} = (int) ${$cwhzpepgkpy}["viewname"];
     ${"GLOBALS"}["eqmrcofnhqq"] = "customViewModel";
     ${$symwrz} = CustomView_Record_Model::getInstanceById(${${"GLOBALS"}["igosddeyg"]});
     if (${${"GLOBALS"}["eqmrcofnhqq"]}) {
         ${${"GLOBALS"}["virgnuvno"]} = $request->get("search_key");
         ${"GLOBALS"}["qeosukvsm"] = "searchValue";
         ${"GLOBALS"}["vrykqprgdfxc"] = "recordIds";
         ${${"GLOBALS"}["qeosukvsm"]} = $request->get("search_value");
         ${${"GLOBALS"}["mnhnltytyh"]} = $request->get("operator");
         if (!empty(${${"GLOBALS"}["mnhnltytyh"]})) {
             $customViewModel->set("operator", ${${"GLOBALS"}["mnhnltytyh"]});
             ${"GLOBALS"}["yvrscvp"] = "searchValue";
             $customViewModel->set("search_key", ${${"GLOBALS"}["virgnuvno"]});
             $customViewModel->set("search_value", ${${"GLOBALS"}["yvrscvp"]});
         }
         ${${"GLOBALS"}["vrykqprgdfxc"]} = $customViewModel->getRecordIds(array(), $customViewModel->getModule());
     }
     die(json_encode(array("ids" => ${$cerakpgxi})));
 }
Esempio n. 5
0
 public function process(Vtiger_Request $request)
 {
     $customViewModel = CustomView_Record_Model::getInstanceById($request->get('record'));
     $moduleModel = $customViewModel->getModule();
     $customViewModel->delete();
     $listViewUrl = $moduleModel->getListViewUrl();
     header("Location: {$listViewUrl}");
 }
Esempio n. 6
0
    public function handleEvent($handlerType, $entityData)
    {
        switch ($handlerType) {
            case 'vtiger.dispatch.before':
                return;
                require_once 'modules/SwVtTools/filecache.php';
                $cacheFile = vglobal('root_directory') . '/modules/SwVtTools/cache/Module.php';
                if (!file_exists($cacheFile) || $_REQUEST['clearcache'] == '1') {
                    swtools_filecache(glob(vglobal('root_directory') . '/modules/*/models/Module.php'), $cacheFile);
                }
                require_once $cacheFile;
                break;
            case 'vtiger.process.customview.editajax.view.finish':
                if (empty(self::$DATA['recordId'])) {
                    return;
                }
                $content = ob_get_contents();
                ob_end_clean();
                $customViewModel = CustomView_Record_Model::getInstanceById(self::$DATA['recordId']);
                $blocks = \SwVtTools\VtUtils::getFieldsWithBlocksForModule(self::$DATA['moduleName']);
                $html = '<h4 class="filterHeaders">Filter Sort Order:</h4><br/>';
                $html .= '<div class="contentsBackground well">';
                $html .= '
                <table cellpadding="4" cellspacing="0" width="100%" border="0">
                  <tbody><tr>
                      <td class="dvtCellInfo" width="5%" align="right">Column:
                      </td>
                      <td class="dvtCellInfo" width="20%">

                      <select name="order_col" id="order_col"  class="chzn-select">
                          <option value="">' . getTranslatedString('LBL_NONE') . '</option>';
                foreach ($blocks as $blockLabel => $fields) {
                    $html .= '<optgroup label="' . $blockLabel . '">';
                    foreach ($fields as $field) {
                        $html .= '<option ' . ($customViewModel->get('order_col') == $field->name ? 'selected="selected"' : '') . ' value="' . $field->name . '">' . $field->label . '</option>';
                    }
                    $html .= '</optgroup>';
                }
                $html .= '</select>
                    </td>
                                  <td class="dvtCellInfo" width="20%">
                                      <select name="order_dir" id="order_dir" class="small">
                                          <option value="ASC" ' . ($customViewModel->get('order_dir') == 'ASC' ? 'selected="selected"' : '') . '>&uarr; ASC Ascending</option>
                                          <option value="DESC" ' . ($customViewModel->get('order_dir') == 'DESC' ? 'selected="selected"' : '') . '>&darr; DESC Descending</option>
                                      </select>
                                  </td>
                                  <td class="dvtCellInfo" width="10%" align="right">numerische Sortierung:
                                  </td>
                                  <td class="dvtCellInfo" width="15%">
                                      <input type="checkbox" name="order_numeric_check" value="1" ' . ($customViewModel->get('order_numeric_check') > 0 ? 'checked="checked"' : '') . '>
                                      Skip Chars: <input type="text" alt="ignore the first X chars to get a numberic value" title="ignore the first X chars to get a numberic value" style="width:20px;" name="order_numeric" value="' . $customViewModel->get('order_numeric') . '">
                                  </td></tr></table>';
                $html .= '</div>';
                $content = str_replace('<div class="filterActions">', $html . '<div class="filterActions">', $content);
                echo $content;
                break;
        }
    }
Esempio n. 7
0
 public function process(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $customViewModel = CustomView_Record_Model::getInstanceById($request->get('record'));
     $moduleModel = $customViewModel->getModule();
     if ($currentUser->isAdminUser()) {
         $customViewModel->deny();
     }
     $listViewUrl = $moduleModel->getListViewUrl();
     header("Location: {$listViewUrl}");
 }
Esempio n. 8
0
 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->get('source_module');
     $module = $request->getModule();
     $record = $request->get('record');
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (!empty($record)) {
         $customViewModel = CustomView_Record_Model::getInstanceById($record);
         $viewer->assign('MODE', 'edit');
     } else {
         $customViewModel = new CustomView_Record_Model();
         $customViewModel->setModule($moduleName);
         $viewer->assign('MODE', '');
     }
     $viewer->assign('ADVANCE_CRITERIA', $customViewModel->transformToNewAdvancedFilter());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('DATE_FILTERS', Vtiger_Field_Model::getDateFilterTypes());
     if ($moduleName == 'Calendar') {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('MODULE', $module);
     $viewer->assign('SOURCE_MODULE', $moduleName);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_PRIVATE);
     $viewer->assign('CV_PENDING_VALUE', CustomView_Record_Model::CV_STATUS_PENDING);
     $viewer->assign('CV_PUBLIC_VALUE', CustomView_Record_Model::CV_STATUS_PUBLIC);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     echo $viewer->view('EditView.tpl', $module, true);
 }
 protected function getBaseModuleRecordIds(Vtiger_Request $request)
 {
     $cvId = $request->get('viewname');
     $module = $request->get('from_module');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     if (!empty($selectedIds) && $selectedIds != 'all') {
         if (!empty($selectedIds) && count($selectedIds) > 0) {
             return $selectedIds;
         }
     }
     if ($selectedIds == 'all') {
         $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
         if ($customViewModel) {
             return $customViewModel->getRecordIds($excludedIds, $module);
         }
     }
     return array();
 }
Esempio n. 10
0
 public function process(Vtiger_Request $request) {
     $viewer = $this->getViewer ($request);
     $moduleName = $request->getModule();
     $qualifiedModuleName = $request->getModule(false);
     $module = Vtiger_Functions::getModuleName($request->get("module_id"));
     
     $adb = PearDatabase::getInstance();
     $sql = "select * from  vtiger_customview where viewname = ? and entitytype = ? and status = ?";
     $result = $adb->pquery($sql, array('All', $module, 0));
     while($row = $adb->fetchByAssoc($result)){
         $record = $row['cvid'];
     }
     $customViewModel = CustomView_Record_Model::getInstanceById($record);
     $moduleModel = Vtiger_Module_Model::getInstance($module);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     $recordStructure = $recordStructureInstance->getStructure();
     
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     $viewer->assign('RECORD_STRUCTURE', $recordStructure);
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('SOURCE_MODULE', $module);
     $viewer->assign('MODULENAME', $moduleName);
     echo $viewer->view('List2.tpl', $qualifiedModuleName,true);
 }
Esempio n. 11
0
 /**
  * Function returns the record Ids selected in the current filter
  * @param Vtiger_Request $request
  * @return integer
  */
 function getRecordsListFromRequest(Vtiger_Request $request, $module = false)
 {
     $cvId = $request->get('viewname');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     if (empty($module)) {
         $module = $request->getModule();
     }
     if (!empty($selectedIds) && $selectedIds != 'all') {
         if (!empty($selectedIds) && count($selectedIds) > 0) {
             return $selectedIds;
         }
     }
     $sourceRecord = $request->get('sourceRecord');
     $sourceModule = $request->get('sourceModule');
     if ($sourceRecord && $sourceModule) {
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
         return $sourceRecordModel->getSelectedIdsList($module, $excludedIds);
     }
     $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
     if ($customViewModel) {
         $searchKey = $request->get('search_key');
         $searchValue = $request->get('search_value');
         $operator = $request->get('operator');
         if (!empty($operator)) {
             $customViewModel->set('operator', $operator);
             $customViewModel->set('search_key', $searchKey);
             $customViewModel->set('search_value', $searchValue);
         }
         $customViewModel->set('search_params', $request->get('search_params'));
         return $customViewModel->getRecordIds($excludedIds, $module);
     }
 }
Esempio n. 12
0
 function DeleteCustomview()
 {
     if (count($this->cvid) > 0) {
         foreach ($this->cvid as $cvid) {
             $customViewModel = CustomView_Record_Model::getInstanceById($cvid[0]);
             $customViewModel->delete();
         }
     }
 }
Esempio n. 13
0
 public function process(Vtiger_Request $request)
 {
     require_once "libraries/PHPExcel/PHPExcel.php";
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $module = $request->getModule(false);
     //this is the type of things in the current view
     $filter = $request->get('viewname');
     //this is the cvid of the current custom filter
     $recordIds = $this->getRecordsListFromRequest($request);
     //this handles the 'all' situation.
     //we now know what we want to render and can get a handle to the respective view, probably should use a listviewcontroller to get the data
     $selectedModule = $request->get("targetmodule");
     //set up our spreadsheet to write out to
     $workbook = new PHPExcel();
     $worksheet = $workbook->setActiveSheetIndex(0);
     $header_styles = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'E1E0F7')), 'font' => array('bold' => true));
     $row = 1;
     $col = 0;
     $generator = new QueryGenerator($selectedModule, $currentUser);
     $generator->initForCustomViewById($filter);
     $customView = CustomView_Record_Model::getInstanceById($filter);
     $listviewController = new ListViewController($db, $currentUser, $generator);
     $headers = $listviewController->getListViewHeaderFields();
     //get the column headers, they go in row 0 of the spreadsheet
     foreach ($headers as $column => $webserviceField) {
         $fieldObj = Vtiger_Field::getInstance($webserviceField->getFieldId());
         //echo $fieldObj->label;
         $fields[] = $fieldObj;
         $worksheet->setCellValueExplicitByColumnAndRow($col, $row, decode_html(vtranslate($fieldObj->label, $selectedModule)), PHPExcel_Cell_DataType::TYPE_STRING);
         $col++;
     }
     $row++;
     $targetModuleFocus = CRMEntity::getInstance($selectedModule);
     //ListViewController has lots of paging stuff and things we don't want
     //so lets just itterate across the list of IDs we have and get the field values
     foreach ($recordIds as $id) {
         $col = 0;
         $record = Vtiger_Record_Model::getInstanceById($id, $selectedModule);
         foreach ($fields as $field) {
             //depending on the uitype we might want the raw value, the display value or something else.
             //we might also want the display value sans-links so we can use strip_tags for that
             //phone numbers need to be explicit strings
             $value = $record->getDisplayValue($field->name);
             $uitype = $field->uitype;
             switch ($uitype) {
                 case 4:
                     //numbers
                 //numbers
                 case 25:
                 case 7:
                 case 71:
                     $worksheet->setCellvalueExplicitByColumnAndRow($col, $row, strip_tags($value), PHPExcel_Cell_DataType::TYPE_NUMERIC);
                     break;
                 case 6:
                     //datetimes
                 //datetimes
                 case 23:
                 case 70:
                     $worksheet->setCellvalueExplicitByColumnAndRow($col, $row, PHPExcel_Shared_Date::PHPToExcel(strtotime($value)), PHPExcel_Cell_DataType::TYPE_NUMERIC);
                     $worksheet->getStyleByColumnAndRow($col, $row)->getNumberFormat()->setFormatCode('DD/MM/YYYY HH:MM:SS');
                     //format the date to the users preference
                     break;
                 default:
                     $worksheet->setCellValueExplicitByColumnAndRow($col, $row, decode_html(strip_tags($value)), PHPExcel_Cell_DataType::TYPE_STRING);
             }
             //echo strip_tags($value);
             $col++;
         }
         //echo "<br>";
         $row++;
     }
     //having written out all the data lets have a go at getting the columns to auto-size
     $col = 0;
     $row = 1;
     foreach ($headers as $column => $webserviceField) {
         $cell = $worksheet->getCellByColumnAndRow($col, $row);
         $worksheet->getStyleByColumnAndRow($col, $row)->applyFromArray($header_styles);
         $worksheet->getColumnDimension($cell->getColumn())->setAutoSize(true);
         $col++;
     }
     $rootDirectory = vglobal('root_directory');
     $tmpDir = vglobal('tmp_dir');
     $tempFileName = tempnam($rootDirectory . $tmpDir, 'xls');
     $workbookWriter = PHPExcel_IOFactory::createWriter($workbook, 'Excel5');
     $workbookWriter->save($tempFileName);
     if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
         header('Pragma: public');
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     }
     header('Content-Type: application/x-msexcel');
     header('Content-Length: ' . @filesize($tempFileName));
     $filename = decode_html($customView->get('viewname')) . ".xls";
     header('Content-disposition: attachment; filename="' . $filename . '"');
     $fp = fopen($tempFileName, 'rb');
     fpassthru($fp);
 }
Esempio n. 14
0
 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->get('source_module');
     $module = $request->getModule();
     $record = $request->get('record');
     $duplicate = $request->get('duplicate');
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (!empty($record)) {
         $customViewModel = CustomView_Record_Model::getInstanceById($record);
         $viewer->assign('MODE', 'edit');
     } else {
         $customViewModel = new CustomView_Record_Model();
         $customViewModel->setModule($moduleName);
         $viewer->assign('MODE', '');
     }
     $viewer->assign('ADVANCE_CRITERIA', $customViewModel->transformToNewAdvancedFilter());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('DATE_FILTERS', Vtiger_Field_Model::getDateFilterTypes());
     if ($moduleName == 'Calendar') {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $recordStructure = $recordStructureInstance->getStructure();
     // for Inventory module we should now allow item details block
     if (in_array($moduleName, getInventoryModules())) {
         $itemsBlock = "LBL_ITEM_DETAILS";
         unset($recordStructure[$itemsBlock]);
     }
     $viewer->assign('RECORD_STRUCTURE', $recordStructure);
     // Added to show event module custom fields
     if ($moduleName == 'Calendar') {
         $relatedModuleName = 'Events';
         $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModuleName);
         $relatedRecordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($relatedModuleModel);
         $eventBlocksFields = $relatedRecordStructureInstance->getStructure();
         $viewer->assign('EVENT_RECORD_STRUCTURE_MODEL', $relatedRecordStructureInstance);
         $viewer->assign('EVENT_RECORD_STRUCTURE', $eventBlocksFields);
     }
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     if ($duplicate != '1') {
         $viewer->assign('RECORD_ID', $record);
     }
     $viewer->assign('MODULE', $module);
     $viewer->assign('SOURCE_MODULE', $moduleName);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     if ($customViewModel->get('viewname') == 'All') {
         $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_DEFAULT);
     } else {
         $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_PRIVATE);
     }
     $viewer->assign('CV_PENDING_VALUE', CustomView_Record_Model::CV_STATUS_PENDING);
     $viewer->assign('CV_PUBLIC_VALUE', CustomView_Record_Model::CV_STATUS_PUBLIC);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     echo $viewer->view('EditView.tpl', $module, true);
 }
Esempio n. 15
0
 public function process(Vtiger_Request $request)
 {
     $customViewModel = CustomView_Record_Model::getInstanceById($request->get('record'));
     $customViewModel->delete();
 }
Esempio n. 16
0
 public function getRecordsListFromRequest(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/ComposeEmail.php::getRecordsListFromRequest");
     $cvId = $request->get('viewname');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     if (!empty($selectedIds) && $selectedIds != 'all') {
         if (!empty($selectedIds) && count($selectedIds) > 0) {
             return $selectedIds;
         }
     }
     $sourceRecord = $request->get('sourceRecord');
     $sourceModule = $request->get('sourceModule');
     if ($sourceRecord && $sourceModule) {
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
         return $sourceRecordModel->getSelectedIdsList($request->get('parentModule'), $excludedIds);
     }
     $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
     if ($customViewModel) {
         $searchKey = $request->get('search_key');
         $searchValue = $request->get('search_value');
         $operator = $request->get('operator');
         if (!empty($operator)) {
             $customViewModel->set('operator', $operator);
             $customViewModel->set('search_key', $searchKey);
             $customViewModel->set('search_value', $searchValue);
         }
         $customViewModel->set('search_params', $request->get('search_params'));
         return $customViewModel->getRecordIds($excludedIds);
     }
     return array();
 }