• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Vtiger_ListView_Model类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Vtiger_ListView_Model的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_ListView_Model类的具体用法?PHP Vtiger_ListView_Model怎么用?PHP Vtiger_ListView_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Vtiger_ListView_Model类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: process

 function process(Vtiger_Request $request)
 {
     $branches = $request->get('branches');
     $filter = $request->get('filter');
     if (empty($branches)) {
         return;
     }
     $moduleName = $request->getModule();
     $viewer = $this->getViewer($request);
     $baseModuleName = 'Accounts';
     $multiReferenceFirld = Vtiger_MultiReferenceValue_UIType::getFieldsByModules($baseModuleName, $moduleName);
     if (count($multiReferenceFirld) === 0) {
         return;
     }
     $multiReferenceFirld = reset($multiReferenceFirld);
     $searchParams = [['columns' => [['columnname' => $multiReferenceFirld['tablename'] . ':' . $multiReferenceFirld['columnname'] . ':' . $multiReferenceFirld['fieldname'], 'value' => implode(',', $branches), 'column_condition' => '', 'comparator' => 'c']]]];
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('limit', 'no_limit');
     $listViewModel = Vtiger_ListView_Model::getInstance($baseModuleName, $filter);
     $listViewModel->set('search_key', $multiReferenceFirld['fieldname']);
     $listViewModel->set('search_params', $searchParams);
     $listEntries = $listViewModel->getListViewEntries($pagingModel, true);
     if (count($listEntries) === 0) {
         return;
     }
     $listHeaders = $listViewModel->getListViewHeaders();
     $viewer->assign('ENTRIES', $listEntries);
     $viewer->assign('HEADERS', $listHeaders);
     $viewer->assign('MODULE', $baseModuleName);
     $viewer->view('TreeRecords.tpl', $moduleName);
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:31,代码来源:TreeRecords.php


示例2: process

 function process(Vtiger_Request $request)
 {
     $branches = $request->get('branches');
     $filter = $request->get('filter');
     if (empty($branches)) {
         return;
     }
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $treeViewModel = Vtiger_TreeView_Model::getInstance($moduleModel);
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('limit', 'no_limit');
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $filter);
     $listViewModel->set('search_params', $treeViewModel->getSearchParams($branches));
     $listEntries = $listViewModel->getListViewEntries($pagingModel, true);
     if (count($listEntries) === 0) {
         return;
     }
     $listHeaders = $listViewModel->getListViewHeaders();
     $viewer->assign('ENTRIES', $listEntries);
     $viewer->assign('HEADERS', $listHeaders);
     $viewer->assign('MODULE', $moduleName);
     $viewer->view('TreeRecords.tpl', $moduleName);
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:25,代码来源:TreeRecords.php


示例3: getPagination

 public function getPagination(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $pageNumber = $request->get('page');
     $searchResult = $request->get('searchResult');
     $moduleName = $request->getModule();
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     $pagingModel->set('viewid', $request->get('viewname'));
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $operator = $request->get('operator');
     if (!empty($operator)) {
         $listViewModel->set('operator', $operator);
         $viewer->assign('OPERATOR', $operator);
         $viewer->assign('ALPHABET_VALUE', $searchValue);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     $searchParmams = $request->get('search_params');
     if (empty($searchParmams) || !is_array($searchParmams)) {
         $searchParmams = [];
     }
     $transformedSearchParams = $this->transferListSearchParamsToFilterCondition($searchParmams, $listViewModel->getModule());
     $listViewModel->set('search_params', $transformedSearchParams);
     if (!$this->listViewEntries) {
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel, $searchResult);
     }
     if (!$this->listViewCount) {
         $this->listViewCount = $listViewModel->getListViewCount();
     }
     $noOfEntries = count($this->listViewEntries);
     $totalCount = $this->listViewCount;
     $pageLimit = $pagingModel->getPageLimit();
     $pageCount = ceil((int) $totalCount / (int) $pageLimit);
     if ($pageCount == 0) {
         $pageCount = 1;
     }
     $viewer->assign('PAGE_COUNT', $pageCount);
     $startPaginFrom = $pageNumber - 2;
     if ($pageNumber == $totalCount && 1 != $pageNumber) {
         $startPaginFrom = $pageNumber - 4;
     }
     if ($startPaginFrom <= 0 || 1 == $pageNumber) {
         $startPaginFrom = 1;
     }
     $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
     $viewer->assign('PAGE_NUMBER', $pageNumber);
     $viewer->assign('LISTVIEW_COUNT', $totalCount);
     $viewer->assign('START_PAGIN_FROM', $startPaginFrom);
     $viewer->assign('PAGING_MODEL', $pagingModel);
     echo $viewer->view('Pagination.tpl', $moduleName, true);
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:59,代码来源:Pagination.php


示例4: getRecords

 private function getRecords()
 {
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('limit', 'no_limit');
     $listViewModel = Vtiger_ListView_Model::getInstance($this->getModuleName());
     $listEntries = $listViewModel->getListViewEntries($pagingModel, true);
     $tree = [];
     foreach ($listEntries as $item) {
         $this->lastTreeId++;
         $parent = $item->get('pscategory');
         $parent = (int) str_replace('T', '', $parent);
         $tree[] = ['id' => $this->lastTreeId, 'record_id' => $item->getId(), 'parent' => $parent == 0 ? '#' : $parent, 'text' => $item->getName(), 'isrecord' => true, 'state' => [], 'icon' => 'glyphicon glyphicon-file'];
     }
     return $tree;
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:15,代码来源:TreeView.php


示例5: process

 function process(Vtiger_Request $request)
 {
     $branches = $request->get('branches');
     $filter = $request->get('filter');
     $category = $request->get('category');
     if (empty($branches) && empty($category)) {
         return;
     }
     $moduleName = $request->getModule();
     $viewer = $this->getViewer($request);
     $baseModuleName = 'Accounts';
     $multiReferenceFirld = Vtiger_MultiReferenceValue_UIType::getFieldsByModules($baseModuleName, $moduleName);
     $multiReferenceFirld = reset($multiReferenceFirld);
     if (count($multiReferenceFirld) === 0) {
         return;
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('limit', 'no_limit');
     $listViewModel = Vtiger_ListView_Model::getInstance($baseModuleName, $filter);
     $queryGenerator = $listViewModel->get('query_generator');
     $glue = '';
     if (!empty($branches)) {
         if (count($queryGenerator->getWhereFields()) > 0 && count($searchParams) > 0) {
             $glue = QueryGenerator::$AND;
         }
         $queryGenerator->addCondition($multiReferenceFirld['columnname'], implode(',', $branches), 'c');
     }
     if (!empty($category)) {
         $baseModuleId = Vtiger_Functions::getModuleId($baseModuleName);
         $moduleId = Vtiger_Functions::getModuleId($moduleName);
         $query = 'SELECT crmid FROM u_yf_crmentity_rel_tree WHERE module = ' . $baseModuleId . ' AND relmodule = ' . $moduleId . ' AND tree IN (\'' . implode("','", $category) . '\')';
         if (count($queryGenerator->getWhereFields()) > 0 && count($searchParams) > 0) {
             $glue = QueryGenerator::$AND;
         }
         $queryGenerator->addCondition($multiReferenceFirld['columnname'], $query, 'subQuery', 'OR', true);
     }
     $listViewModel->set('query_generator', $queryGenerator);
     $listEntries = $listViewModel->getListViewEntries($pagingModel, true);
     if (count($listEntries) === 0) {
         return;
     }
     $listHeaders = $listViewModel->getListViewHeaders();
     $viewer->assign('ENTRIES', $listEntries);
     $viewer->assign('HEADERS', $listHeaders);
     $viewer->assign('MODULE', $baseModuleName);
     $viewer->view('TreeRecords.tpl', $moduleName);
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:47,代码来源:TreeRecords.php


示例6: getListViewCount

 /**
  * Function to get listView count
  * @param Vtiger_Request $request
  */
 function getListViewCount(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $cvId = $request->get('viewname');
     if (empty($cvId)) {
         $cvId = '0';
     }
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
     $searchParmams = $request->get('search_params');
     $listViewModel->set('search_params', $this->transferListSearchParamsToFilterCondition($searchParmams, $listViewModel->getModule()));
     $listViewModel->set('search_key', $searchKey);
     $listViewModel->set('search_value', $searchValue);
     $listViewModel->set('operator', $request->get('operator'));
     $count = $listViewModel->getListViewCount();
     return $count;
 }
开发者ID:wsLapshin,项目名称:charter_crm,代码行数:22,代码来源:List.php


示例7: getListViewCount

 /**
  * Function to get listView count
  * @param Vtiger_Request $request
  */
 function getListViewCount(Vtiger_Request $request)
 {
     $moduleName = $this->getModule($request);
     $sourceModule = $request->get('src_module');
     $sourceField = $request->get('src_field');
     $sourceRecord = $request->get('src_record');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     $currencyId = $request->get('currency_id');
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $relatedParentModule = $request->get('related_parent_module');
     $relatedParentId = $request->get('related_parent_id');
     if (!empty($relatedParentModule) && !empty($relatedParentId)) {
         $parentRecordModel = Vtiger_Record_Model::getInstanceById($relatedParentId, $relatedParentModule);
         $listViewModel = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $label);
     } else {
         $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName, $sourceModule);
     }
     if (!empty($sourceModule)) {
         $listViewModel->set('src_module', $sourceModule);
         $listViewModel->set('src_field', $sourceField);
         $listViewModel->set('src_record', $sourceRecord);
         $listViewModel->set('currency_id', $currencyId);
     }
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     if (!empty($relatedParentModule) && !empty($relatedParentId)) {
         $count = $listViewModel->getRelatedEntriesCount();
     } else {
         $count = $listViewModel->getListViewCount();
     }
     return $count;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:44,代码来源:Popup.php


示例8: initializeListViewContents

 public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
 {
     $request->set('src_module', $request->getModule());
     //
     $moduleName = $this->getModule($request);
     $cvId = $request->get('cvid');
     $pageNumber = $request->get('page');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     $sourceModule = $request->get('src_module');
     $sourceField = $request->get('src_field');
     $sourceRecord = $request->get('src_record');
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $currencyId = $request->get('currency_id');
     $relatedParentModule = $request->get('related_parent_module');
     $relatedParentId = $request->get('related_parent_id');
     $potentialId = $request->get('potentialid');
     //To handle special operation when selecting record from Popup
     $getUrl = $request->get('get_url');
     //Check whether the request is in multi select mode
     $multiSelectMode = $request->get('multi_select');
     if (empty($multiSelectMode)) {
         $multiSelectMode = false;
     }
     if (empty($cvId)) {
         $cvId = '0';
     }
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     $isRecordExists = Vtiger_Util_Helper::checkRecordExistance($relatedParentId);
     if ($isRecordExists) {
         $relatedParentModule = '';
         $relatedParentId = '';
     } else {
         if ($isRecordExists === NULL) {
             $relatedParentModule = '';
             $relatedParentId = '';
         }
     }
     if (!empty($relatedParentModule) && !empty($relatedParentId)) {
         $parentRecordModel = Vtiger_Record_Model::getInstanceById($relatedParentId, $relatedParentModule);
         $listViewModel = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $label);
     } else {
         $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName, $sourceModule);
     }
     if (empty($orderBy) && empty($sortOrder)) {
         $moduleInstance = CRMEntity::getInstance($moduleName);
         $orderBy = $moduleInstance->default_order_by;
         $sortOrder = $moduleInstance->default_sort_order;
     }
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     if (!empty($sourceModule)) {
         $listViewModel->set('src_module', $sourceModule);
         $listViewModel->set('src_field', $sourceField);
         $listViewModel->set('src_record', $sourceRecord);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     if (!empty($potentialId) && vglobal('inventory_popup_limited_from_potentials')) {
         $listViewModel->set('potential_id', $potentialId);
         $viewer->assign('INVENTORY_LIMITED_FROM_POTENTIALS', true);
     }
     if (!empty($relatedParentModule) && !empty($relatedParentId)) {
         $this->listViewHeaders = $listViewModel->getHeaders();
         $models = $listViewModel->getEntries($pagingModel);
         $noOfEntries = count($models);
         foreach ($models as $recordId => $recordModel) {
             foreach ($this->listViewHeaders as $fieldName => $fieldModel) {
                 $recordModel->set($fieldName, $recordModel->getDisplayValue($fieldName));
             }
             $models[$recordId] = $recordModel;
         }
         $this->listViewEntries = $models;
         if (count($this->listViewEntries) > 0) {
             $parent_related_records = true;
         }
     } else {
         $this->listViewHeaders = $listViewModel->getListViewHeaders();
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
     }
     // If there are no related records with parent module then, we should show all the records
     if (!$parent_related_records && !empty($relatedParentModule) && !empty($relatedParentId)) {
         $relatedParentModule = null;
         $relatedParentId = null;
         $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName, $sourceModule);
         if (!empty($orderBy)) {
             $listViewModel->set('orderby', $orderBy);
             $listViewModel->set('sortorder', $sortOrder);
         }
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:ServicesPopup.php


示例9: getRecordIds

 /**
  * Function which provides the records for the current view
  * @param <Boolean> $skipRecords - List of the RecordIds to be skipped
  * @return <Array> List of RecordsIds
  */
 public function getRecordIds($skipRecords = false, $module = false)
 {
     $db = PearDatabase::getInstance();
     $cvId = $this->getId();
     $moduleModel = $this->getModule();
     $moduleName = $moduleModel->get('name');
     $baseTableName = $moduleModel->get('basetable');
     $baseTableId = $moduleModel->get('basetableid');
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
     $queryGenerator = $listViewModel->get('query_generator');
     $searchKey = $this->get('search_key');
     $searchValue = $this->get('search_value');
     $operator = $this->get('operator');
     if (!empty($searchValue)) {
         $queryGenerator->addUserSearchConditions(array('search_field' => $searchKey, 'search_text' => $searchValue, 'operator' => $operator));
     }
     $searchParams = $this->get('search_params');
     if (empty($searchParams)) {
         $searchParams = array();
     }
     $transformedSearchParams = Vtiger_Util_Helper::transferListSearchParamsToFilterCondition($searchParams, $moduleModel);
     $queryGenerator->parseAdvFilterList($transformedSearchParams);
     $listQuery = $queryGenerator->getQuery();
     if ($module == 'RecycleBin') {
         $listQuery = preg_replace("/vtiger_crmentity.deleted\\s*=\\s*0/i", 'vtiger_crmentity.deleted = 1', $listQuery);
     }
     if ($skipRecords && !empty($skipRecords) && is_array($skipRecords) && count($skipRecords) > 0) {
         $listQuery .= ' AND ' . $baseTableName . '.' . $baseTableId . ' NOT IN (' . implode(',', $skipRecords) . ')';
     }
     $result = $db->query($listQuery);
     $noOfRecords = $db->num_rows($result);
     $recordIds = array();
     for ($i = 0; $i < $noOfRecords; ++$i) {
         $recordIds[] = $db->query_result($result, $i, $baseTableId);
     }
     return $recordIds;
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:42,代码来源:Record.php


示例10: initializeListViewContents

 public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
 {
     //src_module value is added to just to stop showing inactive products
     $request->set('src_module', $request->getModule());
     $moduleName = $this->getModule($request);
     $cvId = $request->get('cvid');
     $pageNumber = $request->get('page');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     $sourceModule = $request->get('src_module');
     $sourceField = $request->get('src_field');
     $sourceRecord = $request->get('src_record');
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $currencyId = $request->get('currency_id');
     $potentialId = $request->get('potentialid');
     $searchParams = $request->get('search_params');
     //To handle special operation when selecting record from Popup
     $getUrl = $request->get('get_url');
     //Check whether the request is in multi select mode
     $multiSelectMode = $request->get('multi_select');
     if (empty($multiSelectMode)) {
         $multiSelectMode = false;
     }
     if (empty($cvId)) {
         $cvId = '0';
     }
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName, $sourceModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (empty($orderBy) && empty($sortOrder)) {
         $moduleInstance = CRMEntity::getInstance($moduleName);
         $orderBy = $moduleInstance->default_order_by;
         $sortOrder = $moduleInstance->default_sort_order;
     }
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     if (!empty($sourceModule)) {
         $listViewModel->set('src_module', $sourceModule);
         $listViewModel->set('src_field', $sourceField);
         $listViewModel->set('src_record', $sourceRecord);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     $searchParmams = $request->get('search_params');
     if (empty($searchParmams)) {
         $searchParmams = array();
     }
     $transformedSearchParams = Vtiger_Util_Helper::transferListSearchParamsToFilterCondition($searchParmams, $moduleModel);
     $listViewModel->set('search_params', $transformedSearchParams);
     //To make smarty to get the details easily accesible
     foreach ($searchParmams as $fieldListGroup) {
         foreach ($fieldListGroup as $fieldSearchInfo) {
             $fieldSearchInfo['searchValue'] = $fieldSearchInfo[2];
             $fieldSearchInfo['fieldName'] = $fieldName = $fieldSearchInfo[0];
             $searchParmams[$fieldName] = $fieldSearchInfo;
         }
     }
     if (Settings_SalesProcesses_Module_Model::checkRelatedToPotentialsLimit() && Settings_SalesProcesses_Module_Model::isLimitForModule($sourceModule)) {
         if ($potentialId == '') {
             $potentialId = -1;
         }
         $listViewModel->set('potential_id', $potentialId);
         $viewer->assign('INVENTORY_LIMITED_FROM_POTENTIALS', true);
     }
     $productModel = Vtiger_Module_Model::getInstance('Products');
     if (!$this->listViewHeaders) {
         $this->listViewHeaders = $listViewModel->getListViewHeaders();
     }
     if (!$this->listViewEntries && $productModel->isActive()) {
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
     }
     if (!$productModel->isActive()) {
         $this->listViewEntries = array();
         $viewer->assign('LBL_MODULE_DISABLED', true);
     }
     foreach ($this->listViewEntries as $key => $listViewEntry) {
         $productId = $listViewEntry->getId();
         $subProducts = $listViewModel->getSubProducts($productId);
         if ($subProducts) {
             $listViewEntry->set('subProducts', $subProducts);
         }
     }
     $noOfEntries = count($this->listViewEntries);
     if (empty($sortOrder)) {
         $sortOrder = "ASC";
     }
     if ($sortOrder == "ASC") {
         $nextSortOrder = "DESC";
         $sortImage = "downArrowSmall.png";
     } else {
//.........这里部分代码省略.........
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:101,代码来源:ProductsPopup.php


示例11: getRecords

 private function getRecords()
 {
     $selectedRecords = $this->getSelectedRecords();
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('limit', 'no_limit');
     $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($this->moduleName, $this->src_module);
     if (!empty($this->src_module)) {
         $listViewModel->set('src_module', $this->src_module);
         $listViewModel->set('src_record', $this->src_record);
     }
     $listEntries = $listViewModel->getListViewEntries($pagingModel, true);
     $tree = [];
     foreach ($listEntries as $item) {
         $this->lastIdinTree++;
         $parent = $item->get('pscategory');
         $parent = (int) str_replace('T', '', $parent);
         $tree[] = ['id' => $this->lastIdinTree, 'record_id' => $item->getId(), 'parent' => $parent == 0 ? '#' : $parent, 'text' => $item->getName(), 'state' => ['selected' => in_array($item->getId(), $selectedRecords)], 'icon' => 'glyphicon glyphicon-file'];
     }
     return $tree;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:20,代码来源:TreeCategory.php


示例12: initializeListViewContents

	public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer) {
		$moduleName = $this->getModule($request);
		$cvId = $request->get('cvid');
		$pageNumber = $request->get('page');
		$orderBy = $request->get('orderby');
		$sortOrder = $request->get('sortorder');
		$sourceModule = $request->get('src_module');
		$sourceField = $request->get('src_field');
		$sourceRecord = $request->get('src_record');
		$searchKey = $request->get('search_key');
		$searchValue = $request->get('search_value');
		$currencyId = $request->get('currency_id');

		//To handle special operation when selecting record from Popup
		$getUrl = $request->get('get_url');

		//Check whether the request is in multi select mode
		$multiSelectMode = $request->get('multi_select');
		if(empty($multiSelectMode)) {
			$multiSelectMode = false;
		}

		if(empty($cvId)) {
			$cvId = '0';
		}
		if(empty ($pageNumber)) {
			$pageNumber = '1';
		}

		$pagingModel = new Vtiger_Paging_Model();
		$pagingModel->set('page', $pageNumber);

		$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
		$listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName);
		$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);

		if(!empty($orderBy)) {
			$listViewModel->set('orderby', $orderBy);
			$listViewModel->set('sortorder', $sortOrder);
		}
		if(!empty($sourceModule)) {
			$listViewModel->set('src_module', $sourceModule);
			$listViewModel->set('src_field', $sourceField);
			$listViewModel->set('src_record', $sourceRecord);
		}
		if((!empty($searchKey)) && (!empty($searchValue))) {
			$listViewModel->set('search_key', $searchKey);
			$listViewModel->set('search_value', $searchValue);
		}

		if(!empty($currencyId)) {
			$listViewModel->set('currency_id', $currencyId);
		}

		if(!$this->listViewHeaders){
			$this->listViewHeaders = $listViewModel->getListViewHeaders();
		}
		//Added to support List Price
		$field = new Vtiger_Field_Model();
		$field->set('name', 'listprice');
		$field->set('column', 'listprice');
		$field->set('label', 'List Price');

		$this->listViewHeaders['listprice'] = $field;
		
		if(!$this->listViewEntries){
			$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
		}
		
		foreach ($this->listViewEntries as $recordId => $recordModel) {
			$recordModel->set('listprice', $recordModel->getProductsListPrice($sourceRecord));
		}
		
		$noOfEntries = count($this->listViewEntries);

		if(empty($sortOrder)) {
			$sortOrder = "ASC";
		}
		if($sortOrder == "ASC") {
			$nextSortOrder = "DESC";
			$sortImage = "downArrowSmall.png";
		}else {
			$nextSortOrder = "ASC";
			$sortImage = "upArrowSmall.png";
		}
		$viewer->assign('MODULE', $moduleName);

		$viewer->assign('SOURCE_MODULE', $sourceModule);
		$viewer->assign('SOURCE_FIELD', $sourceField);
		$viewer->assign('SOURCE_RECORD', $sourceRecord);

		$viewer->assign('SEARCH_KEY', $searchKey);
		$viewer->assign('SEARCH_VALUE', $searchValue);

		$viewer->assign('ORDER_BY',$orderBy);
		$viewer->assign('SORT_ORDER',$sortOrder);
		$viewer->assign('NEXT_SORT_ORDER',$nextSortOrder);
		$viewer->assign('SORT_IMAGE',$sortImage);
		$viewer->assign('GETURL', $getUrl);
		$viewer->assign('CURRENCY_ID', $currencyId);
//.........这里部分代码省略.........
开发者ID:Wasage,项目名称:werpa,代码行数:101,代码来源:Popup.php


示例13: initializeListViewContents

 public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
 {
     $moduleName = $request->getModule();
     $cvId = $request->get('viewname');
     $pageNumber = $request->get('page');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     if ($sortOrder == "ASC") {
         $nextSortOrder = "DESC";
         $sortImage = "icon-chevron-down";
     } else {
         $nextSortOrder = "ASC";
         $sortImage = "icon-chevron-up";
     }
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
     $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'), 'CVID' => $cvId);
     $linkModels = $listViewModel->getListViewMassActions($linkParams);
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $operator = $request->get('operator');
     if (!empty($operator)) {
         $listViewModel->set('operator', $operator);
         $viewer->assign('OPERATOR', $operator);
         $viewer->assign('ALPHABET_VALUE', $searchValue);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     $listViewModel->set('folder_id', $request->get('folder_id'));
     $listViewModel->set('folder_value', $request->get('folder_value'));
     if (!$this->listViewHeaders) {
         $this->listViewHeaders = $listViewModel->getListViewHeaders();
     }
     if (!$this->listViewEntries) {
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
     }
     $noOfEntries = count($this->listViewEntries);
     $viewer->assign('VIEWID', $cvId);
     $viewer->assign('MODULE', $moduleName);
     if (!$this->listViewLinks) {
         $this->listViewLinks = $listViewModel->getListViewLinks($linkParams);
     }
     $viewer->assign('LISTVIEW_LINKS', $this->listViewLinks);
     $viewer->assign('LISTVIEW_MASSACTIONS', $linkModels['LISTVIEWMASSACTION']);
     $viewer->assign('PAGING_MODEL', $pagingModel);
     $viewer->assign('PAGE_NUMBER', $pageNumber);
     $viewer->assign('ORDER_BY', $orderBy);
     $viewer->assign('SORT_ORDER', $sortOrder);
     $viewer->assign('NEXT_SORT_ORDER', $nextSortOrder);
     $viewer->assign('SORT_IMAGE', $sortImage);
     $viewer->assign('COLUMN_NAME', $orderBy);
     $viewer->assign('FOLDER_NAME', $request->get('folder_value'));
     $viewer->assign('LISTVIEW_ENTIRES_COUNT', $noOfEntries);
     $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
     $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
     if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false)) {
         if (!$this->listViewCount) {
             $this->listViewCount = $listViewModel->getListViewCount();
         }
         $totalCount = $this->listViewCount;
         $pageLimit = $pagingModel->getPageLimit();
         $pageCount = ceil((int) $totalCount / (int) $pageLimit);
         if ($pageCount == 0) {
             $pageCount = 1;
         }
         $viewer->assign('PAGE_COUNT', $pageCount);
         $viewer->assign('LISTVIEW_COUNT', $totalCount);
     }
     $viewer->assign('IS_MODULE_EDITABLE', $listViewModel->getModule()->isPermitted('EditView'));
     $viewer->assign('IS_MODULE_DELETABLE', $listViewModel->getModule()->isPermitted('Delete'));
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:81,代码来源:List.php


示例14: initializeListViewContents

 public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
 {
     $moduleName = $this->getModule($request);
     $cvId = $request->get('cvid');
     $pageNumber = $request->get('page');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     $sourceModule = $request->get('src_module');
     $sourceField = $request->get('src_field');
     $sourceRecord = $request->get('src_record');
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $currencyId = $request->get('currency_id');
     $selectedFields = $request->get('selectedFields');
     if (!empty($selectedFields)) {
         foreach ($selectedFields as $key => $value) {
             $selectFields[$value] = $value;
         }
     }
     $view = $request->get('view');
     //To handle special operation when selecting record from Popup
     $getUrl = $request->get('get_url');
     //Enable multiselect mode for email related popup
     $multiSelectMode = true;
     if (empty($cvId)) {
         $cvId = '0';
     }
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     $primaryEmailFieldName = 'email';
     if ($moduleName == 'Accounts' || $moduleName == 'Users') {
         $primaryEmailFieldName = 'email1';
     }
     $listViewModel->extendPopupFields(array($primaryEmailFieldName => $primaryEmailFieldName));
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     if (!empty($sourceModule)) {
         $listViewModel->set('src_module', $sourceModule);
         $listViewModel->set('src_field', $sourceField);
         $listViewModel->set('src_record', $sourceRecord);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     if (!$this->listViewHeaders) {
         $this->listViewHeaders = $listViewModel->getListViewHeaders();
     }
     if (!$this->listViewEntries) {
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
     }
     $noOfEntries = count($this->listViewEntries);
     if (empty($sortOrder)) {
         $sortOrder = "ASC";
     }
     if ($sortOrder == "ASC") {
         $nextSortOrder = "DESC";
         $sortImage = "downArrowSmall.png";
     } else {
         $nextSortOrder = "ASC";
         $sortImage = "upArrowSmall.png";
     }
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SELECT_FIELDS', $selectFields);
     $viewer->assign('SOURCE_MODULE', $sourceModule);
     $viewer->assign('SOURCE_FIELD', $sourceField);
     $viewer->assign('SOURCE_RECORD', $sourceRecord);
     $viewer->assign('VIEW', $view);
     $viewer->assign('SEARCH_KEY', $searchKey);
     $viewer->assign('SEARCH_VALUE', $searchValue);
     $viewer->assign('ORDER_BY', $orderBy);
     $viewer->assign('SORT_ORDER', $sortOrder);
     $viewer->assign('NEXT_SORT_ORDER', $nextSortOrder);
     $viewer->assign('SORT_IMAGE', $sortImage);
     $viewer->assign('GETURL', $getUrl);
     $viewer->assign('CURRENCY_ID', $currencyId);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('PAGING_MODEL', $pagingModel);
     $viewer->assign('PAGE_NUMBER', $pageNumber);
     $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
     $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
     $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
     if (AppConfig::performance('LISTVIEW_COMPUTE_PAGE_COUNT')) {
         if (!$this->listViewCount) {
             $this->listViewCount = $listViewModel->getListViewCount();
         }
         $totalCount = $this->listViewCount;
         $pageLimit = $pagingModel->getPageLimit();
         $pageCount = ceil((int) $totalCount / (int) $pageLimit);
         if ($pageCount == 0) {
             $pageCount = 1;
//.........这里部分代码省略.........
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:101,代码来源:EmailsRelatedModulePopup.php


示例15: initializeListViewContents

 public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
 {
     $moduleName = $request->getModule();
     $cvId = $request->get('cvid');
     $pageNumber = $request->get('page');
     $orderBy = $request->get('orderby');
     $sortOrder = $request->get('sortorder');
     $sourceModule = $request->get('src_module');
     $sourceField = $request->get('src_field');
     $sourceRecord = $request->get('src_record');
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     if (empty($cvId)) {
         $cvId = '0';
     }
     if (empty($pageNumber)) {
         $pageNumber = '1';
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $pageNumber);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $listViewModel = Vtiger_ListView_Model::getInstanceForPopup($moduleName, $sourceModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (empty($orderBy) && empty($sortOrder)) {
         $moduleInstance = CRMEntity::getInstance($moduleName);
         $orderBy = $moduleInstance->default_order_by;
         $sortOrder = $moduleInstance->default_sort_order;
     }
     if (!empty($orderBy)) {
         $listViewModel->set('orderby', $orderBy);
         $listViewModel->set('sortorder', $sortOrder);
     }
     if (!empty($sourceModule)) {
         $listViewModel->set('src_module', $sourceModule);
         $listViewModel->set('src_field', $sourceField);
         $listViewModel->set('src_record', $sourceRecord);
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
     }
     if (!empty($searchKey) && !empty($searchValue)) {
         $listViewModel->set('search_key', $searchKey);
         $listViewModel->set('search_value', $searchValue);
     }
     if (!$this->listViewHeaders) {
         $this->listViewHeaders = $listViewModel->getListViewHeaders();
     }
     if (!$this->listViewEntries) {
         $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
     }
     //get the unit prices for the pricebooks based on the product currency
     $productUnitPrice = Vtiger_Functions::getUnitPrice($sourceRecord, $sourceModule);
     $productPriceDetails = getPriceDetailsForProduct($sourceRecord, $productUnitPrice, 'available', $sourceModule);
     $productCurrencyPrice = array();
     foreach ($productPriceDetails as $priceDetails) {
         $productCurrencyPrice[$priceDetails['curid']] = $priceDetails['curvalue'];
     }
     foreach ($this->listViewEntries as $recordId => $recordModel) {
         $recordDetails = $recordModel->getRawData();
         $priceBookCurrencyId = $recordDetails['currency_id'];
         $recordModel->set('unit_price', $productCurrencyPrice[$priceBookCurrencyId]);
     }
     $noOfEntries = count($this->listViewEntries);
     if (empty($sortOrder)) {
         $sortOrder = "ASC";
     }
     if ($sortOrder == "ASC") {
         $nextSortOrder = "DESC";
         $sortImage = "downArrowSmall.png";
     } else {
         $nextSortOrder = "ASC";
         $sortImage = "upArrowSmall.png";
     }
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SOURCE_MODULE', $sourceModule);
     $viewer->assign('SOURCE_FIELD', $sourceField);
     $viewer->assign('SOURCE_RECORD', $sourceRecord);
     $viewer->assign('SOURCE_RECORD_MODEL', $sourceRecordModel);
     //PARENT_MODULE is used for only translations
     $viewer->assign('PARENT_MODULE', 'PriceBooks');
     $viewer->assign('SEARCH_KEY', $searchKey);
     $viewer->assign('SEARCH_VALUE', $searchValue);
     $viewer->assign('ORDER_BY', $orderBy);
     $viewer->assign('SORT_ORDER', $sortOrder);
     $viewer->assign('NEXT_SORT_ORDER', $nextSortOrder);
     $viewer->assign('SORT_IMAGE', $sortImage);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('PAGING_MODEL', $pagingModel);
     $viewer->assign('PAGE_NUMBER', $pageNumber);
     $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
     $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
     $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
     $viewer->assign('VIEW', 'ProductPriceBookPopup');
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:93,代码来源:ProductPriceBookPopup.php


示例16: getListViewCount

 /**
  * Function to get listView count
  * @param Vtiger_Request $request
  */
 function getListViewCount(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $cvId = $request->get('viewname');
     if (empty($cvId)) {
         $cvId = '0';
     }
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
     $listViewModel->set('search_key', $searchKey);
     $listViewModel->set('search_value', $searchValue);
     $listViewModel->set('operator', $request->get('operator'));
     $count = $listViewModel->getListViewCount();
     return $count;
 }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:20,代码来源:List.php


示例17: getListViewCount

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Vtiger_Loader类代码示例发布时间:2022-05-23
下一篇:
PHP Vtiger_Link_Model类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap