本文整理汇总了PHP中Vtiger_ListView_Model::getListViewEntries方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_ListView_Model::getListViewEntries方法的具体用法?PHP Vtiger_ListView_Model::getListViewEntries怎么用?PHP Vtiger_ListView_Model::getListViewEntries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_ListView_Model
的用法示例。
在下文中一共展示了Vtiger_ListView_Model::getListViewEntries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$queryGenerator = $this->get('query_generator');
// Added as Users module do not have custom filters and id column is added by querygenerator.
$fields = $queryGenerator->getFields();
$fields[] = 'id';
$queryGenerator->setFields($fields);
return parent::getListViewEntries($pagingModel);
}
示例2: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel, $status (Active or Inactive User). Default false
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$queryGenerator = $this->get('query_generator');
// Added as Users module do not have custom filters and id column is added by querygenerator.
$fields = $queryGenerator->getFields();
$fields[] = 'id';
$queryGenerator->setFields($fields);
$userFieldsFix = $this->get('search_params');
if (empty($userFieldsFix)) {
$userFieldsFix[0]['columns'] = array();
}
$indexKey = '';
$indexValue = '';
$roleKey = '';
$roleValue = '';
$roleDataInfo = array();
foreach ($userFieldsFix[0]['columns'] as $key => $column) {
if (strpos($column['columnname'], 'is_admin') !== false) {
$indexKey = $key;
$indexValue = $column['value'] == '0' ? 'off' : 'on';
} else {
if (strpos($column['columnname'], 'roleid') !== false) {
$roleKey = $key;
$db = PearDatabase::getInstance();
$sql = "SELECT `roleid`, `rolename` FROM `vtiger_role`;";
$result = $db->query($sql, true);
$roleNum = $db->num_rows($result);
if ($roleNum > 0) {
for ($i = 0; $i < $roleNum; $i++) {
$roleid = $db->query_result($result, $i, 'roleid');
$rolename = $db->query_result($result, $i, 'rolename');
$translated = vtranslate($rolename);
if ($translated == $column['value']) {
$roleValue = $roleid;
}
}
}
}
}
}
if ($indexValue !== '') {
$userFieldsFix[0]['columns'][$indexKey]['value'] = $indexValue;
}
if ($roleValue !== '') {
$userFieldsFix[0]['columns'][$roleKey]['value'] = $roleValue;
}
$this->set('search_params', $userFieldsFix);
return parent::getListViewEntries($pagingModel);
}