[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Potentials/dashboards/ -> GroupedBySalesPerson.php (source)

   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_GroupedBySalesPerson_Dashboard extends Vtiger_IndexAjax_View {
  12      
  13      function getSearchParams($assignedto,$stage) {
  14          $listSearchParams = array();
  15          $conditions = array(array('assigned_user_id','e',$assignedto),array("sales_stage","e",$stage));
  16          $listSearchParams[] = $conditions;
  17          return '&search_params='. json_encode($listSearchParams);
  18      }
  19  
  20  	public function process(Vtiger_Request $request) {
  21          $currentUser = Users_Record_Model::getCurrentUserModel();
  22          $viewer = $this->getViewer($request);
  23          $moduleName = $request->getModule();
  24  
  25          $linkId = $request->get('linkid');
  26  
  27          $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
  28          $data = $moduleModel->getPotentialsCountBySalesPerson();
  29          $listViewUrl = $moduleModel->getListViewUrl();
  30          for($i = 0;$i<count($data);$i++){
  31              $data[$i]["links"] = $listViewUrl.$this->getSearchParams($data[$i]["last_name"],$data[$i]["sales_stage"]);
  32          }
  33  
  34          $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
  35  
  36          $viewer->assign('WIDGET', $widget);
  37          $viewer->assign('MODULE_NAME', $moduleName);
  38          $viewer->assign('DATA', $data);
  39  
  40          //Include special script and css needed for this widget

  41          $viewer->assign('STYLES',$this->getHeaderCss($request));
  42          $viewer->assign('CURRENTUSER', $currentUser);
  43  
  44          $content = $request->get('content');
  45          if(!empty($content)) {
  46              $viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
  47          } else {
  48              $viewer->view('dashboards/GroupBySalesPerson.tpl', $moduleName);
  49          }
  50      }
  51  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1