[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Leads/dashboards/ -> LeadsCreated.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 Leads_LeadsCreated_Dashboard extends Vtiger_IndexAjax_View {
  12  
  13      /**

  14       * Function to get the list of Script models to be included

  15       * @param Vtiger_Request $request

  16       * @return <Array> - List of Vtiger_JsScript_Model instances

  17       */
  18  	function getHeaderScripts(Vtiger_Request $request) {
  19  
  20          $jsFileNames = array(
  21  //            '~/libraries/jquery/jqplot/plugins/jqplot.cursor.min.js',

  22  //            '~/libraries/jquery/jqplot/plugins/jqplot.dateAxisRenderer.min.js',

  23  //            '~/libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js',

  24  //            '~/libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js',

  25  //            '~/libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js'

  26          );
  27  
  28          $headerScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
  29          return $headerScriptInstances;
  30      }
  31  
  32  	public function process(Vtiger_Request $request) {
  33          $currentUser = Users_Record_Model::getCurrentUserModel();
  34          $viewer = $this->getViewer($request);
  35          $moduleName = $request->getModule();
  36  
  37          $linkId = $request->get('linkid');
  38          $createdTime = $request->get('createdtime');
  39          $owner = $request->get('owner');
  40  
  41          //Date conversion from user to database format

  42          if(!empty($createdTime)) {
  43              $dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
  44              $dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
  45          }
  46  
  47          $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
  48          $data = $moduleModel->getLeadsCreated($owner, $dates);
  49  
  50          $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
  51  
  52          //Include special script and css needed for this widget

  53          $viewer->assign('SCRIPTS',$this->getHeaderScripts($request));
  54  
  55          $viewer->assign('WIDGET', $widget);
  56          $viewer->assign('MODULE_NAME', $moduleName);
  57          $viewer->assign('DATA', $data);
  58          $viewer->assign('CURRENTUSER', $currentUser);
  59  
  60          $accessibleUsers = $currentUser->getAccessibleUsersForModule('Leads');
  61          $viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
  62          
  63  
  64          $content = $request->get('content');
  65          if(!empty($content)) {
  66              $viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
  67          } else {
  68              $viewer->view('dashboards/LeadsCreated.tpl', $moduleName);
  69          }
  70      }
  71  }


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