[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Vtiger/views/ -> IndexAjax.php (source)

   1  <?php
   2  /*+**********************************************************************************
   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.1
   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_IndexAjax_View extends Vtiger_Index_View {
  12  
  13  	function __construct() {
  14          parent::__construct();
  15          $this->exposeMethod('showActiveRecords');
  16      }
  17  
  18  	function preProcess(Vtiger_Request $request) {
  19          return true;
  20      }
  21  
  22  	function postProcess(Vtiger_Request $request) {
  23          return true;
  24      }
  25  
  26  	function process(Vtiger_Request $request) {
  27          $mode = $request->get('mode');
  28          if(!empty($mode)) {
  29              $this->invokeExposedMethod($mode, $request);
  30              return;
  31          }
  32      }
  33  
  34      /*
  35       * Function to show the recently modified or active records for the given module
  36       */
  37  	function showActiveRecords(Vtiger_Request $request) {
  38          $viewer = $this->getViewer($request);
  39          $moduleName = $request->getModule();
  40  
  41          $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
  42          $recentRecords = $moduleModel->getRecentRecords();
  43  
  44          $viewer->assign('MODULE', $moduleName);
  45          $viewer->assign('RECORDS', $recentRecords);
  46  
  47          echo $viewer->view('RecordNamesList.tpl', $moduleName, true);
  48      }
  49  
  50  	function getRecordsListFromRequest(Vtiger_Request $request) {
  51          $cvId = $request->get('cvid');
  52          $selectedIds = $request->get('selected_ids');
  53          $excludedIds = $request->get('excluded_ids');
  54  
  55          if(!empty($selectedIds) && $selectedIds != 'all') {
  56              if(!empty($selectedIds) && count($selectedIds) > 0) {
  57                  return $selectedIds;
  58              }
  59          }
  60  
  61          $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
  62          if($customViewModel) {
  63              $searchKey = $request->get('search_key');
  64              $searchValue = $request->get('search_value');
  65              $operator = $request->get('operator');
  66              if(!empty($operator)) {
  67                  $customViewModel->set('operator', $operator);
  68                  $customViewModel->set('search_key', $searchKey);
  69                  $customViewModel->set('search_value', $searchValue);
  70              }
  71              return $customViewModel->getRecordIds($excludedIds);
  72          }
  73      }
  74  }


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