当前位置: 首页>>代码示例>>PHP>>正文


PHP CustomView::getMetricsCvListQuery方法代码示例

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


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

示例1: 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()
{
    require_once "data/Tracker.php";
    require_once 'modules/CustomView/CustomView.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    global $app_strings;
    global $adb;
    global $log;
    global $current_language;
    $metricviewnames = "'Hot Leads'";
    $current_module_strings = return_module_language($current_language, "CustomView");
    $log = LoggerManager::getLogger('metrics');
    $metriclists = getMetricList();
    $log->info("Metrics :: Successfully got MetricList to be displayed");
    if (isset($metriclists)) {
        foreach ($metriclists as $key => $metriclist) {
            $listquery = getListQuery($metriclist['module']);
            if (empty($listquery)) {
                if (is_file("modules/" . $metriclist['module'] . "/" . $metriclist['module'] . ".php")) {
                    include_once "modules/" . $metriclist['module'] . "/" . $metriclist['module'] . ".php";
                    $metric_focus = new $metriclist['module']();
                    $listquery = $metric_focus->getListQuery('');
                }
            }
            $oCustomView = new CustomView($metriclist['module']);
            $metricsql = $oCustomView->getMetricsCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
            $metricresult = $adb->query($metricsql);
            if ($metricresult) {
                $rowcount = $adb->fetch_array($metricresult);
                if (isset($rowcount)) {
                    $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_HOME_COUNT'];
    $entries = array();
    if (isset($metriclists)) {
        $oddRow = true;
        foreach ($metriclists as $metriclist) {
            $value = array();
            $metric_fields = array('ID' => $metriclist['id'], 'NAME' => $metriclist['name'], 'COUNT' => $metriclist['count'], 'MODULE' => $metriclist['module']);
            $value[] = '<a href="index.php?action=index&module=' . $metriclist['module'] . '&viewname=' . $metriclist['id'] . '">' . $metriclist['name'] . '</a>';
            $value[] = '<a href="index.php?action=index&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;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:85,代码来源:ListViewTop.php

示例2: 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 "data/Tracker.php";
    require_once 'modules/CustomView/CustomView.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    global $app_strings;
    global $adb;
    global $log;
    global $current_language;
    $metricviewnames = "'Hot Leads'";
    $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)) {
        foreach ($metriclists as $key => $metriclist) {
            $listquery = getListQuery($metriclist['module']);
            if ($metriclist['module'] == 'Calendar') {
                $listquery .= " AND vtiger_activity.activitytype != 'Emails' ";
            }
            $oCustomView = new CustomView($metriclist['module']);
            $metricsql = $oCustomView->getMetricsCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
            if ($metriclist['module'] == "Calendar" and !$adb->isPostgres()) {
                $metricsql .= " group by vtiger_activity.activityid ";
            }
            $metricresult = $adb->query($metricsql);
            if ($metricresult) {
                if ($metriclist['module'] == "Calendar") {
                    $metriclists[$key]['count'] = $adb->num_rows($metricresult);
                } else {
                    $rowcount = $adb->fetch_array($metricresult);
                    if (isset($rowcount)) {
                        $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;
    }
}
开发者ID:p6,项目名称:VF,代码行数:95,代码来源:ListViewTop.php

示例3: array

$query = "select ec_customview.* from ec_customview inner join ec_tab on ec_tab.name = ec_customview.entitytype where ec_customview.setmetrics = 1 order by ec_customview.entitytype";
$result = $adb->query($query);
if ($result) {
    require_once 'modules/CustomView/CustomView.php';
    require_once 'modules/CustomView/ListViewTop.php';
}
$metriclists = array();
$metricslist = array();
for ($i = 0; $i < $adb->num_rows($result); $i++) {
    $metr_id = $adb->query_result($result, $i, 'cvid');
    $metr_name = $adb->query_result($result, $i, 'viewname');
    $metr_module = $adb->query_result($result, $i, 'entitytype');
    $metr_count = "";
    $listquery = getListQuery($metr_module, '', true);
    $oCustomView = new CustomView($metr_module);
    $metricsql = $oCustomView->getMetricsCvListQuery($metr_id, $listquery, $metr_module);
    $log->info("metricsql:" . $metricsql);
    if (isset($metricsql) && !empty($metricsql)) {
        $metricresult = $adb->query($metricsql);
    }
    if ($metricresult) {
        $rowcount = $adb->fetch_array($metricresult);
        if (isset($rowcount)) {
            $keyview_body .= '<tr>
			<td>
			&nbsp;<a href="index.php?action=index&module=' . $metr_module . '&viewname=' . $metr_id . '">' . $metr_name . '</a>
			</td>
			<td align="left">&nbsp;' . $app_strings[$metr_module] . '</td>
			<td align="left">&nbsp;' . $rowcount['count'] . '</td>
			</tr>';
        }
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:ListView.php

示例4: getMetricListHome

$html_contents .= '<td class="crmTableRow" align="left"><b>&nbsp;' . $app_strings['LBL_VIEW'] . '</b></td>';
$html_contents .= '<td class="crmTableRow" align="left"><b>&nbsp;' . $app_strings['LBL_MODULE'] . '</b></td>';
$html_contents .= '<td class="crmTableRow" align="left"><b>&nbsp;' . $app_strings['LBL_HOME_COUNT'] . '</b></td></tr>';
$metriclists = getMetricListHome();
if (isset($metriclists)) {
    foreach ($metriclists as $metriclist) {
        $listquery = getListQuery($metriclist['module'], '', true);
        if (empty($listquery)) {
            if (is_file("modules/" . $metriclist['module'] . "/" . $metriclist['module'] . ".php")) {
                include_once "modules/" . $metriclist['module'] . "/" . $metriclist['module'] . ".php";
                $metric_focus = new $metriclist['module']();
                $listquery = $metric_focus->getListQuery('', true);
            }
        }
        $oCustomView = new CustomView($metriclist['module']);
        $metricsql = $oCustomView->getMetricsCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
        $log->info("metricsql:" . $metricsql);
        $metricresult = $adb->query($metricsql);
        if ($metricresult) {
            $rowcount = $adb->fetch_array($metricresult);
            if (isset($rowcount)) {
                $html_contents .= '<tr><td class="crmTableRow" align="left">&nbsp;<a href="index.php?action=index&module=' . $metriclist['module'] . '&viewname=' . $metriclist['id'] . '">' . $metriclist['name'] . '</a></td><td class="crmTableRow" align="left">&nbsp;' . $app_strings[$metriclist['module']] . '</td><td class="crmTableRow" align="left">&nbsp;' . $rowcount['count'] . '</td></tr>';
            }
        }
        $oCustomView = null;
    }
}
$html_contents .= '</table>';
/** to get the details of a customview Entries
  * @returns  $metriclists Array in the following format
  * $customviewlist []= Array('id'=>custom view id,
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:key_customview.php


注:本文中的CustomView::getMetricsCvListQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。