本文整理汇总了PHP中CustomView::getModifiedCvListQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomView::getModifiedCvListQuery方法的具体用法?PHP CustomView::getModifiedCvListQuery怎么用?PHP CustomView::getModifiedCvListQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomView
的用法示例。
在下文中一共展示了CustomView::getModifiedCvListQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getKeyMetricsWithCount
protected function getKeyMetricsWithCount()
{
global $current_user, $adb;
$current_user = Users_Record_Model::getCurrentUserModel();
require_once 'modules/CustomView/ListViewTop.php';
$metriclists = getMetricList();
foreach ($metriclists as $key => $metriclist) {
$metricresult = NULL;
if ($metriclist['module'] == "Calendar") {
$listquery = getListQuery($metriclist['module']);
$oCustomView = new CustomView($metriclist['module']);
$metricsql = $oCustomView->getModifiedCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
$metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql));
} else {
$queryGenerator = new QueryGenerator($metriclist['module'], $current_user);
$queryGenerator->initForCustomViewById($metriclist['id']);
$metricsql = $queryGenerator->getQuery();
$metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql));
}
if ($metricresult) {
$rowcount = $adb->fetch_array($metricresult);
$metriclists[$key]['count'] = $rowcount['count'];
}
}
return $metriclists;
}
示例2: getModuleFilterDetails
protected function getModuleFilterDetails($filterid)
{
global $adb;
$result = $adb->pquery("SELECT * FROM vtiger_customview WHERE cvid=?", array($filterid));
if ($result && $adb->num_rows($result)) {
$resultrow = $adb->fetch_array($result);
$module = $resultrow['entitytype'];
$view = new CustomView($module);
$viewid = $resultrow['cvid'];
$view->getCustomViewByCvid($viewid);
$viewQuery = $view->getModifiedCvListQuery($viewid, getListQuery($module), $module);
$countResult = $adb->pquery(Vtiger_Functions::mkCountQuery($viewQuery), array());
$count = 0;
if ($countResult && $adb->num_rows($countResult)) {
$count = $adb->query_result($countResult, 0, 'count');
}
$filter = $this->prepareFilterDetailUsingResultRow($resultrow);
$filter['userName'] = getUserName($resultrow['userid']);
$filter['count'] = $count;
return $filter;
}
}
示例3: process
/** END */
function process(Mobile_API_Request $request)
{
$wsResponse = parent::process($request);
$response = false;
if ($wsResponse->hasError()) {
$response = $wsResponse;
} else {
$wsResponseResult = $wsResponse->getResult();
$tabid = getTabid($wsResponseResult['module']);
$CATEGORY = getParentTabFromModule($wsResponseResult['module']);
//serch
$total_record_count = 0;
$query_string = trim($_REQUEST['query_string']);
$curModule = 'Home';
$search_tag = vtlib_purify($_REQUEST['search_tag']);
function getSearchModules($filter = array())
{
global $adb;
// vtlib customization: Ignore disabled modules.
//$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29)';
$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29) and vtiger_tab.presence != 1 and vtiger_field.presence in (0,2)';
// END
$result = $adb->pquery($sql, array());
while ($module_result = $adb->fetch_array($result)) {
$modulename = $module_result['name'];
// Do we need to filter the module selection?
if (!empty($filter) && is_array($filter) && !in_array($modulename, $filter)) {
continue;
}
// END
if ($modulename != 'Calendar') {
$return_arr[$modulename] = $modulename;
} else {
$return_arr[$modulename] = 'Activity';
}
}
return $return_arr;
}
if (isset($query_string) && $query_string != '') {
// Was the search limited by user for specific modules?
$search_onlyin = $_REQUEST['search_onlyin'];
if (!empty($search_onlyin) && $search_onlyin != '--USESELECTED--') {
$search_onlyin = explode(',', $search_onlyin);
} else {
if ($search_onlyin == '--USESELECTED--') {
$search_onlyin = $_SESSION['__UnifiedSearch_SelectedModules__'];
} else {
$search_onlyin = array();
}
}
// Save the selection for futur use (UnifiedSearchModules.php)
$_SESSION['__UnifiedSearch_SelectedModules__'] = $search_onlyin;
// END
$object_array = getSearchModules($search_onlyin);
global $adb;
global $current_user;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$search_val = $query_string;
$search_module = $_REQUEST['search_module'];
$i = 0;
$moduleRecordCount = array();
foreach ($object_array as $module => $object_name) {
if ($curModule == 'Home' || $curModule == $module && !empty($_REQUEST['ajax'])) {
$focus = CRMEntity::getInstance($module);
if (isPermitted($module, "index") == "yes") {
$smarty = new vtigerCRM_Smarty();
global $mod_strings;
global $app_strings;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", $module);
$smarty->assign("TAG_SEARCH", $search_tag);
$smarty->assign("SEARCH_MODULE", vtlib_purify($_REQUEST['search_module']));
$smarty->assign("SINGLE_MOD", $module);
$smarty->assign("SEARCH_STRING", htmlentities($search_val, ENT_QUOTES, $default_charset));
$listquery = getListQuery($module);
$oCustomView = '';
$oCustomView = new CustomView($module);
//Instead of getting current customview id, use cvid of All so that all entities will be found
//$viewid = $oCustomView->getViewId($module);
$cv_res = $adb->pquery("select cvid from vtiger_customview where viewname='All' and entitytype=?", array($module));
$viewid = $adb->query_result($cv_res, 0, 'cvid');
$listquery = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
if ($module == "Calendar") {
if (!isset($oCustomView->list_fields['Close'])) {
$oCustomView->list_fields['Close'] = array('activity' => 'status');
}
if (!isset($oCustomView->list_fields_name['Close'])) {
$oCustomView->list_fields_name['Close'] = 'status';
}
}
if ($search_module != '' || $search_tag != '') {
//This is for Tag search
$where = getTagWhere($search_val, $current_user->id);
$search_msg = $app_strings['LBL_TAG_SEARCH'];
//.........这里部分代码省略.........
示例4: getRelCheckquery
}
$return_module = "";
if (isset($_REQUEST['return_module'])) {
$return_module = $_REQUEST['return_module'];
}
$where_relquery = getRelCheckquery($currentModule, $return_module, $recordid);
//if((!isset($is_disable_approve) || (isset($is_disable_approve) && !$is_disable_approve)) && (isset($module_enable_approve) && $module_enable_approve)) {
// $where_relquery .= ' AND ec_crmentity.approved=1 ';
//}
if (empty($query)) {
$query = $focus->getListQuery($where_relquery, true);
//viewscope = all_to_me
}
//customview begin
if ($viewid != "0") {
$query = $oCustomView->getModifiedCvListQuery($viewid, $query, $currentModule, true);
}
//customview end
if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') {
list($where, $ustring) = explode("#@@#", getWhereCondition($currentModule));
$url_string .= "&query=true" . $ustring;
}
if (isset($where) && $where != '') {
$query .= ' and ' . $where;
}
$upperModule = strtoupper($currentModule);
if (isset($_REQUEST['order_by']) && $_REQUEST['order_by'] != '') {
$order_by = $_REQUEST['order_by'];
} else {
$order_by = $_SESSION[$upperModule . '_ORDER_BY'] != '' ? $_SESSION[$upperModule . '_ORDER_BY'] : "modifiedtime";
}
示例5: getSelectAllQuery
function getSelectAllQuery($input, $module)
{
global $adb, $current_user;
$viewid = vtlib_purify($input['viewname']);
if ($module == "Calendar") {
$listquery = getListQuery($module);
$oCustomView = new CustomView($module);
$query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
$where = '';
if ($input['query'] == 'true') {
list($where, $ustring) = split("#@@#", getWhereCondition($module, $input));
if (isset($where) && $where != '') {
$query .= " AND " . $where;
}
}
} else {
$queryGenerator = new QueryGenerator($module, $current_user);
$queryGenerator->initForCustomViewById($viewid);
if ($input['query'] == 'true') {
$queryGenerator->addUserSearchConditions($input);
}
$queryGenerator->setFields(array('id'));
$query = $queryGenerator->getQuery();
if ($module == 'Documents') {
$folderid = vtlib_purify($input['folderidstring']);
$folderid = str_replace(';', ',', $folderid);
$query .= " AND vtiger_notes.folderid in (" . $folderid . ")";
}
}
$result = $adb->pquery($query, array());
return $result;
}
示例6: getListQuery
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if (isPermitted('Emails', 'EditView', '') == 'yes') {
$other_text['s_mail'] = $app_strings[LBL_SEND_MAIL_BUTTON];
}
if (isset($CActionDtls)) {
$other_text['s_cmail'] = $app_strings[LBL_SEND_CUSTOM_MAIL_BUTTON];
}
if ($viewnamedesc['viewname'] == 'All') {
$smarty->assign("ALL", 'All');
}
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
$listquery = getListQuery("Contacts");
$list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "Contacts");
} else {
$list_query = getListQuery("Contacts");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
$list_query .= " AND " . $where;
$_SESSION['export_where'] = $where;
} else {
unset($_SESSION['export_where']);
}
if (isset($order_by) && $order_by != '') {
if ($order_by == 'smownerid') {
if ($adb->dbType == "pgsql") {
$list_query .= ' GROUP BY user_name';
}
示例7: unset
$smarty->assign("SINGLE_MOD", 'Memday');
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("CATEGORY", $category);
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
$_SESSION['export_where'] = $where;
$where = ' and ' . $where;
} else {
unset($_SESSION['export_where']);
}
if ($viewid != "0") {
//change by xiaoyang on 2012-09-14
//$listquery = $focus->getListQuery($where);
$listquery = getListQuery("Memdays");
$query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "Memdays");
} else {
$query = $focus->getListQuery($where);
}
//<<<<<<<<customview>>>>>>>>>
//Retreiving the no of rows
$count_result = $adb->query(mkCountQuery($query));
$noofrows = $adb->query_result($count_result, 0, "count");
//Storing Listview session object
if ($_SESSION['lvs'][$currentModule]) {
setSessionVar($_SESSION['lvs'][$currentModule], $noofrows, $list_max_entries_per_page);
}
$start = $_SESSION['lvs'][$currentModule]['start'];
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
// Setting the record count string
示例8: getModuleFilters
private function getModuleFilters($sid)
{
global $adb, $current_user;
$querycvid = "select ec_homemoduleflds.fieldname,ec_homemodule.* from ec_homemoduleflds left join ec_homemodule on ec_homemodule.stuffid=ec_homemoduleflds.stuffid where ec_homemoduleflds.stuffid=" . $sid;
$resultcvid = $adb->query($querycvid);
$modname = $adb->query_result($resultcvid, 0, "modulename");
$cvid = $adb->query_result($resultcvid, 0, "customviewid");
$maxval = $adb->query_result($resultcvid, 0, "maxentries");
$column_count = $adb->num_rows($resultcvid);
$cvid_check_query = $adb->pquery("SELECT * FROM ec_customview WHERE cvid = '{$cvid}'");
if (isPermitted($modname, 'index') == "yes") {
if ($adb->num_rows($cvid_check_query) > 0) {
if ($modname == 'Calendar') {
require_once "modules/Calendar/Activity.php";
$focus = new Activity();
} else {
require_once "modules/{$modname}/{$modname}.php";
$focus = new $modname();
}
$oCustomView = new CustomView($modname);
$listquery = getListQuery($modname);
if (trim($listquery) == '') {
$listquery = $focus->getListQuery($modname);
}
$query = $oCustomView->getModifiedCvListQuery($cvid, $listquery, $modname);
$count_result = $adb->query(mkCountQuery($query));
$noofrows = $adb->query_result($count_result, 0, "count");
$navigation_array = getNavigationValues(1, $noofrows, $maxval);
//To get the current language file
global $current_language, $app_strings;
$fieldmod_strings = return_module_language($current_language, $modname);
if ($modname == 'Calendar') {
$query .= "AND ec_activity.activitytype NOT IN ('Emails')";
}
if ($adb->dbType == "pgsql") {
$list_result = $adb->query($query . " OFFSET 0 LIMIT " . $maxval);
} else {
$list_result = $adb->query($query . " LIMIT 0," . $maxval);
}
for ($l = 0; $l < $column_count; $l++) {
$fieldinfo = $adb->query_result($resultcvid, $l, "fieldname");
list($tabname, $colname, $fldname, $fieldmodlabel) = explode(":", $fieldinfo);
//For Header starts
$fieldheader = explode("_", $fieldmodlabel, 2);
$fldlabel = $fieldheader[1];
$pos = strpos($fldlabel, "_");
if ($pos == true) {
$fldlabel = str_replace("_", " ", $fldlabel);
}
$field_label = isset($app_strings[$fldlabel]) ? $app_strings[$fldlabel] : (isset($fieldmod_strings[$fldlabel]) ? $fieldmod_strings[$fldlabel] : $fldlabel);
$cv_presence = $adb->query("SELECT * from ec_cvcolumnlist WHERE cvid = {$cvid} and columnname LIKE '%" . $fldname . "%'");
if ($is_admin == false) {
$fld_permission = getFieldVisibilityPermission($modname, $current_user->id, $fldname);
}
if ($fld_permission == 0 && $adb->num_rows($cv_presence)) {
$field_query = $adb->query("SELECT fieldlabel FROM ec_field WHERE fieldname = '{$fldname}' AND tablename = '{$tabname}'");
$field_label = $adb->query_result($field_query, 0, 'fieldlabel');
$header[] = $field_label;
}
$fieldcolumns[$fldlabel] = array($tabname => $colname);
//For Header ends
}
$listview_entries = getListViewEntries($focus, $modname, $list_result, $navigation_array, "", "", "EditView", "Delete", $oCustomView, 'HomePage', $fieldcolumns);
$return_value = array('ModuleName' => $modname, 'cvid' => $cvid, 'Maxentries' => $maxval, 'Header' => $header, 'Entries' => $listview_entries);
if (sizeof($header) != 0) {
return $return_value;
} else {
echo "Fields not found in Selected Filter";
}
} else {
echo "<font color='red'>Filter You have Selected is Not Found</font>";
}
} else {
echo "<font color='red'>Permission Denied</font>";
}
}
示例9: getParentTab
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", 'PurchaseOrder');
$smarty->assign("CUSTOMVIEW_OPTION", $customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$category = getParentTab();
$smarty->assign("CATEGORY", $category);
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("CUSTOMVIEW", $custom_view_strings);
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
$listquery = getListQuery("PurchaseOrder");
$query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "PurchaseOrder");
} else {
$query = getListQuery("PurchaseOrder");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
$query .= ' and ' . $where;
}
if (isset($order_by) && $order_by != '') {
if ($order_by == 'smownerid') {
if ($adb->dbType == "pgsql") {
$query .= ' GROUP BY user_name';
}
$query .= ' ORDER BY user_name ' . $sorder;
} else {
$tablename = getTableNameForField('PurchaseOrder', $order_by);
示例10: getGroupslist
$smarty->assign("CHANGE_GROUP_OWNER", getGroupslist());
if (isPermitted('Potentials', 'Delete', '') == 'yes') {
$other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
if (isPermitted('Potentials', 'EditView', '') == 'yes') {
$other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if ($viewnamedesc['viewname'] == 'All') {
$smarty->assign("ALL", 'All');
}
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
$listquery = getListQuery("Potentials");
$list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "Potentials");
} else {
$list_query = getListQuery("Potentials");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
if (isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard'] == 'true') {
$list_query .= " AND vtiger_potential.sales_stage = '" . $mod_strings['Closed Won'] . "' AND " . $where;
} elseif (isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true') {
$list_query .= " AND vtiger_potential.sales_stage not in( '" . $mod_strings['Closed Won'] . "' , '" . $mod_strings['Closed Lost'] . "' )AND " . $where;
} else {
$list_query .= " AND " . $where;
}
$_SESSION['export_where'] = $where;
} else {
unset($_SESSION['export_where']);
示例11: list
}
}
$url_string = '';
if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') {
list($where, $ustring) = split("#@@#", RBSearch($select_module));
// we have a query
$url_string .= "&query=true" . $ustring;
$log->info("Here is the where clause for the list view: {$where}");
$smarty->assign("SEARCH_URL", $url_string);
}
$focus = CRMEntity::getInstance($select_module);
if (count($module_name) > 0) {
$cur_mod_view = new CustomView($select_module);
$viewid = $cur_mod_view->getViewId($select_module);
$list_query = getListQuery($select_module, '');
$list_query = $cur_mod_view->getModifiedCvListQuery($viewid, $list_query, $select_module);
$list_query = preg_replace("/vtiger_crmentity.deleted\\s*=\\s*0/i", 'vtiger_crmentity.deleted = 1', $list_query);
//Search criteria added to the list Query
if (isset($where) && $where != '') {
$list_query .= ' AND ' . $where;
}
$count_result = $adb->query(mkCountQuery($list_query));
$noofrows = $adb->query_result($count_result, 0, "count");
$rb_listview_header = getListViewHeader($focus, $select_module, '', '', '', 'global', $cur_mod_view, '', true);
$listview_header_search = getSearchListHeaderValues($focus, $select_module, $url_string, $sorder, $order_by, "", $cur_mod_view);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = vtlib_purify($_REQUEST['start']);
} else {
$start = 1;
}
示例12: process
/** END */
function process(Mobile_API_Request $request)
{
global $current_user, $current_language, $displayed_modules;
global $adb, $theme;
$wsResponse = parent::process($request);
$response = false;
if ($wsResponse->hasError()) {
$response = $wsResponse;
} else {
$current_user = $this->getActiveUser();
$response = false;
$total_record_count = 0;
$query_string = trim($_REQUEST['query_string']);
$curModule = 'Home';
$search_tag = vtlib_purify($_REQUEST['search_tag']);
//get language
$current_user = $this->getActiveUser();
$CRM_Version = Mobile::config('crm_version');
if ($CRM_Version != '5.2.1') {
//for v5.3.0 use User's Settings
include 'user_privileges/user_privileges_' . $current_user->id . '.php';
if (isset($user_info['language'])) {
$this->activeUser->column_fields['language'] = $user_info['language'];
} else {
$this->activeUser->column_fields['language'] = 'en_us';
}
} else {
//for v5.2.1 use default language
global $adb;
$queryResult = $adb->pquery("SELECT prefix FROM vtiger_language WHERE isdefault =1", array());
$this->activeUser->column_fields['language'] = $adb->query_result($queryResult, 0, 'prefix');
}
$current_language = $this->activeUser->column_fields['language'];
include dirname(__FILE__) . '/../language/' . $current_language . '.lang.php';
function getSearchModules($filter = array())
{
global $adb;
// vtlib customization: Ignore disabled modules.
//$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29)';
$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29) and vtiger_tab.presence != 1 and vtiger_field.presence in (0,2)';
// END
$result = $adb->pquery($sql, array());
while ($module_result = $adb->fetch_array($result)) {
$modulename = $module_result['name'];
// Do we need to filter the module selection?
if (!empty($filter) && is_array($filter) && !in_array($modulename, $filter)) {
continue;
}
// END
if ($modulename != 'Calendar') {
$return_arr[$modulename] = $modulename;
} else {
$return_arr[$modulename] = 'Activity';
}
}
return $return_arr;
}
if (isset($query_string) && $query_string != '') {
// limit search to modules enabled for mobile
$search_onlyin = vtlib_purify($_REQUEST['search_onlyin']);
if (!empty($search_onlyin)) {
$search_onlyin = explode(',', $search_onlyin);
//prevent manipulations
if (array_values($search_onlyin) != array_values($displayed_modules)) {
//do standard search
$search_onlyin = $displayed_modules;
}
} else {
$search_onlyin = $displayed_modules;
}
// Save the selection for future use (UnifiedSearchModules.php)
$_SESSION['__UnifiedSearch_SelectedModules__'] = $search_onlyin;
// END
$object_array = getSearchModules($search_onlyin);
$search_val = $query_string;
$search_module = $_REQUEST['search_module'];
$i = 0;
$moduleRecordCount = array();
foreach ($object_array as $module => $object_name) {
if ($curModule == 'Home' || $curModule == $module && !empty($_REQUEST['ajax'])) {
$focus = CRMEntity::getInstance($module);
if (isPermitted($module, "index") == "yes") {
$listquery = getListQuery($module);
$oCustomView = '';
$oCustomView = new CustomView($module);
//Instead of getting current customview id, use cvid of All so that all entities will be found
//$viewid = $oCustomView->getViewId($module);
$cv_res = $adb->pquery("select cvid from vtiger_customview where viewname='All' and entitytype=?", array($module));
$viewid = $adb->query_result($cv_res, 0, 'cvid');
$listquery = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
if ($module == "Calendar") {
if (!isset($oCustomView->list_fields['Close'])) {
$oCustomView->list_fields['Close'] = array('activity' => 'status');
}
if (!isset($oCustomView->list_fields_name['Close'])) {
$oCustomView->list_fields_name['Close'] = 'status';
}
}
if ($search_module != '' || $search_tag != '') {
//.........这里部分代码省略.........
示例13: getKeyMetrics
/** to get the details of a KeyMetrics on Home page
* @returns $customviewlist Array in the following format
* $values = Array('Title'=>Array(0=>'image name',
* 1=>'Key Metrics',
* 2=>'home_metrics'
* ),
* 'Header'=>Array(0=>'Metrics',
* 1=>'Count'
* ),
* 'Entries'=>Array($cvid=>Array(
* 0=>$customview name,
* 1=>$no of records for the view
* ),
* $cvid=>Array(
* 0=>$customview name,
* 1=>$no of records for the view
* ),
* |
* |
* $cvid=>Array(
* 0=>$customview name,
* 1=>$no of records for the view
* )
* )
*
*/
function getKeyMetrics($maxval, $calCnt)
{
require_once "include/Tracker.php";
require_once 'modules/CustomView/CustomView.php';
require_once 'include/logging.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$metricviewnames = "'Hot Leads'";
$current_language = vglobal('current_language');
$current_module_strings = return_module_language($current_language, "CustomView");
$log = LoggerManager::getLogger('metrics');
$metriclists = getMetricList();
// Determine if the KeyMetrics widget should appear or not?
if ($calCnt == 'calculateCnt') {
return count($metriclists);
}
$log->info("Metrics :: Successfully got MetricList to be displayed");
if (isset($metriclists)) {
$current_user = vglobal('current_user');
foreach ($metriclists as $key => $metriclist) {
if ($metriclist['module'] == "Calendar") {
$listquery = getListQuery($metriclist['module']);
$oCustomView = new CustomView($metriclist['module']);
$metricsql = $oCustomView->getModifiedCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
$metricsql = Vtiger_Functions::mkCountQuery($metricsql);
$metricresult = $adb->query($metricsql);
if ($metricresult) {
$rowcount = $adb->fetch_array($metricresult);
$metriclists[$key]['count'] = $rowcount['count'];
}
} else {
$queryGenerator = new QueryGenerator($metriclist['module'], $current_user);
$queryGenerator->initForCustomViewById($metriclist['id']);
$metricsql = $queryGenerator->getQuery();
$metricsql = Vtiger_Functions::mkCountQuery($metricsql);
$metricresult = $adb->query($metricsql);
if ($metricresult) {
$rowcount = $adb->fetch_array($metricresult);
$metriclists[$key]['count'] = $rowcount['count'];
}
}
}
$log->info("Metrics :: Successfully build the Metrics");
}
$title = array();
$title[] = 'keyMetrics.gif';
$title[] = $app_strings['LBL_HOME_KEY_METRICS'];
$title[] = 'home_metrics';
$header = array();
$header[] = $app_strings['LBL_HOME_METRICS'];
$header[] = $app_strings['LBL_MODULE'];
$header[] = $app_strings['LBL_HOME_COUNT'];
$entries = array();
if (isset($metriclists)) {
$oddRow = true;
foreach ($metriclists as $metriclist) {
$value = array();
$CVname = strlen($metriclist['name']) > 20 ? substr($metriclist['name'], 0, 20) . '...' : $metriclist['name'];
$value[] = '<a href="index.php?action=ListView&module=' . $metriclist['module'] . '&viewname=' . $metriclist['id'] . '">' . $CVname . '</a> <font style="color:#6E6E6E;">(' . $metriclist['user'] . ')</font>';
$value[] = '<a href="index.php?action=ListView&module=' . $metriclist['module'] . '&viewname=' . $metriclist['id'] . '">' . getTranslatedString($metriclist['module']) . '</a>';
$value[] = '<a href="index.php?action=ListView&module=' . $metriclist['module'] . '&viewname=' . $metriclist['id'] . '">' . $metriclist['count'] . '</a>';
$entries[$metriclist['id']] = $value;
}
}
$values = array('Title' => $title, 'Header' => $header, 'Entries' => $entries);
if ($display_empty_home_blocks || count($value) != 0) {
return $values;
}
}
示例14: rgb
$other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
}
if ($viewnamedesc['viewname'] == 'All') {
$smarty->assign("ALL", 'All');
}
if ($viewid == 0) {
echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span clas\n\t\ts='genHeaderSmall'>{$app_strings['LBL_PERMISSION']}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\n\t\t</td>\n\t\t</tr>\n\t\t</tbody></table>\n\t\t</div>";
echo "</td></tr></table>";
exit;
}
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
$listquery = getListQuery("Vendors");
$list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "Vendors");
} else {
$list_query = getListQuery("Vendors");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
$list_query .= ' and ' . $where;
$_SESSION['export_where'] = $where;
} else {
unset($_SESSION['export_where']);
}
if (isset($order_by) && $order_by != '') {
$tablename = getTableNameForField('Vendors', $order_by);
$tablename = $tablename != '' ? $tablename . "." : '';
if ($adb->dbType == "pgsql") {
$list_query .= ' GROUP BY ' . $tablename . $order_by;
示例15: formatForSqlLike
$display_title = $email_title;
}
//to get the search vtiger_field if exists
if (isset($_REQUEST['search']) && $_REQUEST['search'] != '' && $_REQUEST['search_text'] != '') {
$url_string .= "&search=" . vtlib_purify($_REQUEST['search']) . "&search_field=" . vtlib_purify($_REQUEST['search_field']) . "&search_text=" . vtlib_purify($_REQUEST['search_text']);
if ($_REQUEST['search_field'] != 'join') {
$where = $adb->sql_escape_string($_REQUEST['search_field']) . " like '" . formatForSqlLike($_REQUEST['search_text']) . "'";
} else {
$where = "(subject like '" . formatForSqlLike($_REQUEST['search_text']) . "' OR vtiger_users.user_name like '" . formatForSqlLike($_REQUEST['search_text']) . "')";
}
}
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
$listquery = getListQuery("Emails");
$list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "Emails");
} else {
$list_query = getListQuery("Emails");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
$list_query .= " AND " . $where;
}
if ($_REQUEST['folderid'] == '2') {
$list_query .= " AND vtiger_seactivityrel.crmid in (select contactid from vtiger_contactdetails) AND vtiger_emaildetails.email_flag !='WEBMAIL'";
}
if ($_REQUEST['folderid'] == '3') {
$list_query .= " AND vtiger_seactivityrel.crmid in (select accountid from vtiger_account)";
}
if ($_REQUEST['folderid'] == '4') {
$list_query .= " AND vtiger_seactivityrel.crmid in (select leadid from vtiger_leaddetails)";