[ 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 Potentials_FunnelAmount_Dashboard extends Vtiger_IndexAjax_View { 12 13 /** 14 * Retrieves css styles that need to loaded in the page 15 * @param Vtiger_Request $request - request model 16 * @return <array> - array of Vtiger_CssScript_Model 17 */ 18 function getHeaderCss(Vtiger_Request $request){ 19 $cssFileNames = array( 20 //Place your widget specific css files here 21 ); 22 $headerCssScriptInstances = $this->checkAndConvertCssStyles($cssFileNames); 23 return $headerCssScriptInstances; 24 } 25 26 function getSearchParams($stage) { 27 $listSearchParams = array(); 28 $conditions = array(array("sales_stage","e",$stage)); 29 $listSearchParams[] = $conditions; 30 return '&search_params='. json_encode($listSearchParams); 31 } 32 33 public function process(Vtiger_Request $request) { 34 $currentUser = Users_Record_Model::getCurrentUserModel(); 35 $viewer = $this->getViewer($request); 36 $moduleName = $request->getModule(); 37 38 $linkId = $request->get('linkid'); 39 40 $moduleModel = Vtiger_Module_Model::getInstance($moduleName); 41 $data = $moduleModel->getPotentialTotalAmountBySalesStage(); 42 $listViewUrl = $moduleModel->getListViewUrl(); 43 for($i = 0;$i<count($data);$i++){ 44 $data[$i]["links"] = $listViewUrl.$this->getSearchParams($data[$i][1]); 45 } 46 47 $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId()); 48 49 $viewer->assign('WIDGET', $widget); 50 $viewer->assign('MODULE_NAME', $moduleName); 51 $viewer->assign('DATA', $data); 52 53 $viewer->assign('STYLES',$this->getHeaderCss($request)); 54 $viewer->assign('CURRENTUSER', $currentUser); 55 56 $content = $request->get('content'); 57 if(!empty($content)) { 58 $viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName); 59 } else { 60 $viewer->view('dashboards/FunnelAmount.tpl', $moduleName); 61 } 62 } 63 }
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 |