[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /*+*********************************************************************************** 3 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 *************************************************************************************/ 10 11 class Vtiger_Notebook_Dashboard extends Vtiger_IndexAjax_View { 12 13 public function process(Vtiger_Request $request, $widget=NULL) { 14 $viewer = $this->getViewer($request); 15 $moduleName = $request->getModule(); 16 17 // Initialize Widget to the right-state of information 18 if ($widget && !$request->has('widgetid')) { 19 $widgetId = $widget->get('id'); 20 } else { 21 $widgetId = $request->get('widgetid'); 22 } 23 24 $widget = Vtiger_Notebook_Model::getUserInstance($widgetId); 25 26 $mode = $request->get('mode'); 27 if ($mode == 'save') { 28 $widget->save($request); 29 } 30 $viewer->assign('WIDGET', $widget); 31 $viewer->assign('MODULE_NAME', $moduleName); 32 33 34 $content = $request->get('content'); 35 if(!empty($content)) { 36 $viewer->view('dashboards/NotebookContents.tpl', $moduleName); 37 } else { 38 $viewer->view('dashboards/Notebook.tpl', $moduleName); 39 } 40 41 } 42 43 // NOTE: Move this function to appropriate model. 44 protected function getKeyMetricsWithCount() { 45 global $current_user, $adb; 46 $current_user = Users_Record_Model::getCurrentUserModel(); 47 48 require_once 'modules/CustomView/ListViewTop.php'; 49 $metriclists = getMetricList(); 50 51 foreach ($metriclists as $key => $metriclist) { 52 53 $metricresult = NULL; 54 if($metriclist['module'] == "Calendar") { 55 $listquery = getListQuery($metriclist['module']); 56 $oCustomView = new CustomView($metriclist['module']); 57 $metricsql = $oCustomView->getModifiedCvListQuery($metriclist['id'],$listquery,$metriclist['module']); 58 $metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql)); 59 } else { 60 $queryGenerator = new QueryGenerator($metriclist['module'], $current_user); 61 $queryGenerator->initForCustomViewById($metriclist['id']); 62 $metricsql = $queryGenerator->getQuery(); 63 $metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql)); 64 } 65 if($metricresult) { 66 $rowcount = $adb->fetch_array($metricresult); 67 $metriclists[$key]['count'] = $rowcount['count']; 68 } 69 } 70 return $metriclists; 71 } 72 73 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |