当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Request::getMode方法代码示例

本文整理汇总了PHP中Vtiger_Request::getMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Request::getMode方法的具体用法?PHP Vtiger_Request::getMode怎么用?PHP Vtiger_Request::getMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Request的用法示例。


在下文中一共展示了Vtiger_Request::getMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getExportQuery

 /**
  * Function that generates Export Query based on the mode
  * @param Vtiger_Request $request
  * @return <String> export query
  */
 function getExportQuery(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $mode = $request->getMode();
     $cvId = $request->get('viewname');
     $moduleName = $request->get('source_module');
     $queryGenerator = new QueryGenerator($moduleName, $currentUser);
     $queryGenerator->initForCustomViewById($cvId);
     $fieldInstances = $this->moduleFieldInstances;
     $accessiblePresenceValue = array(0, 2);
     foreach ($fieldInstances as $field) {
         // Check added as querygenerator is not checking this for admin users
         $presence = $field->get('presence');
         if (in_array($presence, $accessiblePresenceValue)) {
             $fields[] = $field->getName();
         }
     }
     $queryGenerator->setFields($fields);
     $query = $queryGenerator->getQuery();
     if (in_array($moduleName, getInventoryModules())) {
         $query = $this->moduleInstance->getExportQuery($this->focus, $query);
     }
     $this->accessibleFields = $queryGenerator->getFields();
     switch ($mode) {
         case 'ExportAllData':
             return $query;
             break;
         case 'ExportCurrentPage':
             $pagingModel = new Vtiger_Paging_Model();
             $limit = $pagingModel->getPageLimit();
             $currentPage = $request->get('page');
             if (empty($currentPage)) {
                 $currentPage = 1;
             }
             $currentPageStart = ($currentPage - 1) * $limit;
             if ($currentPageStart < 0) {
                 $currentPageStart = 0;
             }
             $query .= ' LIMIT ' . $currentPageStart . ',' . $limit;
             return $query;
             break;
         case 'ExportSelectedRecords':
             $idList = $this->getRecordsListFromRequest($request);
             $baseTable = $this->moduleInstance->get('basetable');
             $baseTableColumnId = $this->moduleInstance->get('basetableid');
             if (!empty($idList)) {
                 if (!empty($baseTable) && !empty($baseTableColumnId)) {
                     $idList = implode(',', $idList);
                     $query .= ' AND ' . $baseTable . '.' . $baseTableColumnId . ' IN (' . $idList . ')';
                 }
             } else {
                 $query .= ' AND ' . $baseTable . '.' . $baseTableColumnId . ' NOT IN (' . implode(',', $request->get('excluded_ids')) . ')';
             }
             return $query;
             break;
         default:
             return $query;
             break;
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:65,代码来源:ExportData.php

示例2: process

 function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     if (!empty($mode) && method_exists($this, $mode)) {
         $this->{$mode}($request);
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:7,代码来源:FindDuplicatesAjax.php

示例3: postprocess

 public function postprocess(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     if (!empty($mode)) {
         parent::postProcess($request);
     }
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:7,代码来源:Import.php

示例4: process

    function process(Vtiger_Request $request) {
		$mode = $request->getMode();
		if(!empty($mode)) {
			echo $this->invokeExposedMethod($mode, $request);
			return;
		}
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:7,代码来源:Basic.php

示例5: process

	public function process(Vtiger_Request $request) {
		$mode = $request->getMode();
		if (!empty($mode)) {
			echo $this->invokeExposedMethod($mode, $request);
			return;
		}

		$taxId = $request->get('taxid');
		$type = $request->get('type');
		if (empty($taxId)) {
			$taxRecordModel = new Settings_Vtiger_TaxRecord_Model();
		} else {
			$taxRecordModel = Settings_Vtiger_TaxRecord_Model::getInstanceById($taxId, $type);
		}
		
		$fields = array('taxlabel','percentage','deleted');
		foreach($fields as $fieldName) {
			if($request->has($fieldName)) {
				$taxRecordModel->set($fieldName,$request->get($fieldName));
			}
		}
		
		$taxRecordModel->setType($type);

		$response = new Vtiger_Response();
		try {
			$taxId = $taxRecordModel->save();
			$recordModel = Settings_Vtiger_TaxRecord_Model::getInstanceById($taxId, $type);
			$response->setResult(array_merge(array('_editurl' => $recordModel->getEditTaxUrl(), 'type' => $recordModel->getType()),$recordModel->getData()));
		} catch (Exception $e) {
			$response->setError($e->getCode(), $e->getMessage());
		}
		$response->emit();
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:34,代码来源:TaxAjax.php

示例6: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getInstanceById($record);
     $reportModel->setModule('Reports');
     $reportModel->set('advancedFilter', $request->get('advanced_filter'));
     $secondaryModules = $reportModel->getSecondaryModules();
     if (empty($secondaryModules)) {
         $viewer->assign('CLICK_THROUGH', true);
     }
     $dataFields = $request->get('datafields', 'count(*)');
     if (is_string($dataFields)) {
         $dataFields = array($dataFields);
     }
     $reportModel->set('reporttypedata', Zend_Json::encode(array('type' => $request->get('charttype', 'pieChart'), 'groupbyfield' => $request->get('groupbyfield'), 'datafields' => $dataFields)));
     $reportModel->set('reporttype', 'chart');
     $reportModel->save();
     $reportChartModel = Reports_Chart_Model::getInstanceById($reportModel);
     $data = $reportChartModel->getData();
     $viewer->assign('CHART_TYPE', $reportChartModel->getChartType());
     $viewer->assign('DATA', json_encode($data, JSON_HEX_APOS));
     $viewer->assign('MODULE', $moduleName);
     $viewer->view('ChartReportContents.tpl', $moduleName);
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:27,代码来源:ChartSaveAjax.php

示例7: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     if (!empty($mode)) {
         echo $this->invokeExposedMethod($mode, $request);
         return;
     }
     $id = $request->get('id');
     $type = $request->get('view');
     if (empty($id)) {
         $recordModel = new Settings_Inventory_Record_Model();
     } else {
         $recordModel = Settings_Inventory_Record_Model::getInstanceById($id, $type);
     }
     $fields = $request->getAll();
     foreach ($fields as $fieldName => $fieldValue) {
         if ($request->has($fieldName) && !in_array($fieldName, ['module', 'parent', 'view', '__vtrftk', 'action'])) {
             $recordModel->set($fieldName, $fieldValue);
         }
     }
     $recordModel->setType($type);
     $response = new Vtiger_Response();
     try {
         $id = $recordModel->save();
         $recordModel = Settings_Inventory_Record_Model::getInstanceById($id, $type);
         $response->setResult(array_merge(['_editurl' => $recordModel->getEditUrl(), 'row_type' => $currentUser->get('rowheight')], $recordModel->getData()));
     } catch (Exception $e) {
         $response->setError($e->getCode(), $e->getMessage());
     }
     $response->emit();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:32,代码来源:SaveAjax.php

示例8: process

	public function process(Vtiger_Request $request) {
		$mode = $request->getMode();
		if(!empty($mode) && $this->isMethodExposed($mode)) {
			return $this->$mode($request);
		}
		$this->Step1($request);
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:7,代码来源:Index.php

示例9: process

 function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     if ($mode) {
         $this->invokeExposedMethod($mode, $request);
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:7,代码来源:NoteBook.php

示例10: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getInstanceById($record);
     $reportModel->setModule('Reports');
     $reportModel->set('advancedFilter', $request->get('advanced_filter'));
     $page = $request->get('page');
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $page);
     $pagingModel->set('limit', Reports_Detail_View::REPORT_LIMIT);
     if ($mode === 'save') {
         $reportModel->saveAdvancedFilters();
         $reportData = $reportModel->getReportData($pagingModel);
         $data = $reportData['data'];
     } else {
         if ($mode === 'generate') {
             $reportData = $reportModel->generateData($pagingModel);
             $data = $reportData['data'];
         }
     }
     $calculation = $reportModel->generateCalculationData();
     $viewer->assign('PRIMARY_MODULE', $reportModel->getPrimaryModule());
     $viewer->assign('CALCULATION_FIELDS', $calculation);
     $viewer->assign('DATA', $data);
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('PAGING_MODEL', $pagingModel);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('NEW_COUNT', $reportData['count']);
     $viewer->assign('REPORT_RUN_INSTANCE', ReportRun::getInstance($record));
     $viewer->view('ReportContents.tpl', $moduleName);
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:34,代码来源:SaveAjax.php

示例11: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     $viewer = $this->getViewer($request);
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $viewer->assign('CURRENT_USER', $currentUserModel);
     $viewer->view('CalendarView.tpl', $request->getModule());
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:8,代码来源:Calendar.php

示例12: process

	public function process(Vtiger_Request $request) {
		$mode = $request->getMode();
		if ($mode) {
			$this->$mode($request);
		} else {
			$this->step1($request);
		}
	}
开发者ID:Wasage,项目名称:werpa,代码行数:8,代码来源:Edit.php

示例13: process

 function process(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/FindDuplicatesAjax.php::process");
     $mode = $request->getMode();
     if (!empty($mode) && method_exists($this, $mode)) {
         $this->{$mode}($request);
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:9,代码来源:FindDuplicatesAjax.php

示例14: process

 function process(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./actions/NoteBook.php::process");
     $mode = $request->getMode();
     if ($mode) {
         $this->invokeExposedMethod($mode, $request);
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:9,代码来源:NoteBook.php

示例15: process

	public function process(Vtiger_Request $request) {
		$currentUserModel = Users_Record_Model::getCurrentUserModel();
		
		$mode = $request->getMode();
		if($mode == 'Helpbox'){
			return $this->getHelpbox($request);
		}

	}
开发者ID:Wasage,项目名称:werpa,代码行数:9,代码来源:Frames.php


注:本文中的Vtiger_Request::getMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。