本文整理汇总了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;
}
}
示例2: process
function process(Vtiger_Request $request)
{
$mode = $request->getMode();
if (!empty($mode) && method_exists($this, $mode)) {
$this->{$mode}($request);
}
}
示例3: postprocess
public function postprocess(Vtiger_Request $request)
{
$mode = $request->getMode();
if (!empty($mode)) {
parent::postProcess($request);
}
}
示例4: process
function process(Vtiger_Request $request) {
$mode = $request->getMode();
if(!empty($mode)) {
echo $this->invokeExposedMethod($mode, $request);
return;
}
}
示例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();
}
示例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);
}
示例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();
}
示例8: process
public function process(Vtiger_Request $request) {
$mode = $request->getMode();
if(!empty($mode) && $this->isMethodExposed($mode)) {
return $this->$mode($request);
}
$this->Step1($request);
}
示例9: process
function process(Vtiger_Request $request)
{
$mode = $request->getMode();
if ($mode) {
$this->invokeExposedMethod($mode, $request);
}
}
示例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);
}
示例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());
}
示例12: process
public function process(Vtiger_Request $request) {
$mode = $request->getMode();
if ($mode) {
$this->$mode($request);
} else {
$this->step1($request);
}
}
示例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);
}
}
示例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);
}
}
示例15: process
public function process(Vtiger_Request $request) {
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$mode = $request->getMode();
if($mode == 'Helpbox'){
return $this->getHelpbox($request);
}
}