[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/HelpDesk/dashboards/ -> OpenTickets.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 HelpDesk_OpenTickets_Dashboard extends Vtiger_IndexAjax_View {
  12      
  13      function getSearchParams($value) {
  14          $listSearchParams = array();
  15          $conditions = array(array('ticketstatus','e','Open'),array('assigned_user_id','e',$value));
  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->getOpenTickets();
  29          $listViewUrl = $moduleModel->getListViewUrl();
  30          for($i = 0;$i<count($data);$i++){
  31              $data[$i]["links"] = $listViewUrl.$this->getSearchParams($data[$i][name]);
  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('CURRENTUSER', $currentUser);
  42  
  43          $content = $request->get('content');
  44          if(!empty($content)) {
  45              $viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
  46          } else {
  47              $viewer->view('dashboards/OpenTickets.tpl', $moduleName);
  48          }
  49      }
  50  }


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