本文整理汇总了PHP中CustomView::getCVAdvFilterSQL方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomView::getCVAdvFilterSQL方法的具体用法?PHP CustomView::getCVAdvFilterSQL怎么用?PHP CustomView::getCVAdvFilterSQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomView
的用法示例。
在下文中一共展示了CustomView::getCVAdvFilterSQL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
/**
* This function exports all the data for a given module
* Param $type - module name
* Return type text
*/
function export($type)
{
global $log, $list_max_entries_per_page;
$log->debug("Entering export(" . $type . ") method ...");
global $adb;
$focus = 0;
$content = '';
if ($type != "") {
// vtlib customization: Hook to dynamically include required module file.
// Refer to the logic in setting $currentModule in index.php
$focus = CRMEntity::getInstance($type);
}
$log = LoggerManager::getLogger('export_' . $type);
$db = PearDatabase::getInstance();
$oCustomView = new CustomView("{$type}");
$viewid = $oCustomView->getViewId("{$type}");
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$search_type = $_REQUEST['search_type'];
$export_data = $_REQUEST['export_data'];
if (isset($_SESSION['export_where']) && $_SESSION['export_where'] != '' && $search_type == 'includesearch') {
$where = $_SESSION['export_where'];
}
$query = $focus->create_export_query($where);
if ($search_type != 'includesearch' && $type != 'Calendar') {
$stdfiltersql = $oCustomView->getCVStdFilterSQL($viewid);
$advfiltersql = $oCustomView->getCVAdvFilterSQL($viewid);
if (isset($stdfiltersql) && $stdfiltersql != '') {
$query .= ' and ' . $stdfiltersql;
}
if (isset($advfiltersql) && $advfiltersql != '') {
$query .= ' and ' . $advfiltersql;
}
}
$params = array();
if (($search_type == 'withoutsearch' || $search_type == 'includesearch') && $export_data == 'selecteddata') {
$idstring = explode(";", $_REQUEST['idstring']);
if ($type == 'Accounts' && count($idstring) > 0) {
$query .= ' and vtiger_account.accountid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Contacts' && count($idstring) > 0) {
$query .= ' and vtiger_contactdetails.contactid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Potentials' && count($idstring) > 0) {
$query .= ' and vtiger_potential.potentialid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Leads' && count($idstring) > 0) {
$query .= ' and vtiger_leaddetails.leadid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Products' && count($idstring) > 0) {
$query .= ' and vtiger_products.productid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Documents' && count($idstring) > 0) {
$query .= ' and vtiger_notes.notesid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'HelpDesk' && count($idstring) > 0) {
$query .= ' and vtiger_troubletickets.ticketid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} elseif ($type == 'Vendors' && count($idstring) > 0) {
$query .= ' and vtiger_vendor.vendorid in (' . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
} else {
if (count($idstring) > 0) {
// vtlib customization: Hook to make the export feature available for custom modules.
$query .= " and {$focus->table_name}.{$focus->table_index} in (" . generateQuestionMarks($idstring) . ')';
array_push($params, $idstring);
// END
}
}
}
if (isset($order_by) && $order_by != '') {
if ($order_by == 'smownerid') {
$query .= ' ORDER BY user_name ' . $sorder;
} elseif ($order_by == 'lastname' && $type == 'Documents') {
$query .= ' ORDER BY vtiger_contactdetails.lastname ' . $sorder;
} elseif ($order_by == 'crmid' && $type == 'HelpDesk') {
$query .= ' ORDER BY vtiger_troubletickets.ticketid ' . $sorder;
} else {
$tablename = getTableNameForField($type, $order_by);
$tablename = $tablename != '' ? $tablename . "." : '';
if ($adb->dbType == "pgsql") {
$query .= ' GROUP BY ' . $tablename . $order_by;
}
$query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
}
if ($export_data == 'currentpage') {
$current_page = ListViewSession::getCurrentPage($type, $viewid);
$limit_start_rec = ($current_page - 1) * $list_max_entries_per_page;
if ($limit_start_rec < 0) {
$limit_start_rec = 0;
}
$query .= ' LIMIT ' . $limit_start_rec . ',' . $list_max_entries_per_page;
}
$result = $adb->pquery($query, $params, true, "Error exporting {$type}: " . "<BR>{$query}");
//.........这里部分代码省略.........
示例2: getCVAdvFilterSQL
/**
* Function returns Advanced filter sql
* @return <String>
*/
public function getCVAdvFilterSQL()
{
$customView = new CustomView();
return $customView->getCVAdvFilterSQL($this->getId());
}