本文整理汇总了PHP中Vtiger_Request::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Request::get方法的具体用法?PHP Vtiger_Request::get怎么用?PHP Vtiger_Request::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Request
的用法示例。
在下文中一共展示了Vtiger_Request::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$source = $request->get('source');
$sourceModule = $request->get('sourceModule');
if ($sourceModule != '') {
$source = Vtiger_Functions::getModuleId($sourceModule);
}
if ($source == '') {
$source = 6;
}
$moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);
$RelatedModule = $moduleModel->getRelatedModule($source);
$viewer = $this->getViewer($request);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('SOURCE', $source);
$viewer->assign('SOURCEMODULE', Vtiger_Functions::getModuleName($source));
$viewer->assign('WIDGETS', $moduleModel->getWidgets($source));
$viewer->assign('RELATEDMODULES', $RelatedModule);
$viewer->assign('FILTERS', json_encode($moduleModel->getFiletrs($RelatedModule)));
$viewer->assign('CHECKBOXS', json_encode($moduleModel->getCheckboxs($RelatedModule)));
//$viewer->assign('EXCLUDEDTYPES', $moduleModel->excludedTypes($source) );
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('MODULE', $moduleName);
$viewer->view('Index.tpl', $qualifiedModuleName);
}
示例2: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$qualifiedModuleName = $request->getModule(false);
$sourceModule = $request->get('sourceModule');
$viewer = $this->getViewer($request);
$mode = '';
$selectedFieldsList = array();
if ($recordId) {
$recordModel = Settings_Webforms_Record_Model::getInstanceById($recordId, $qualifiedModuleName);
$mode = 'edit';
if ($sourceModule === $recordModel->get('targetmodule')) {
$selectedFieldsList = $recordModel->getSelectedFieldsList();
}
} else {
$recordModel = Settings_Webforms_Record_Model::getCleanInstance($qualifiedModuleName);
}
$viewer->assign('MODE', $mode);
$viewer->assign('SOURCE_MODULE', $sourceModule);
$viewer->assign('MODULE', $qualifiedModuleName);
$viewer->assign('SELECTED_FIELD_MODELS_LIST', $selectedFieldsList);
$viewer->assign('ALL_FIELD_MODELS_LIST', $recordModel->getAllFieldsList($sourceModule));
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->view('FieldsEditView.tpl', $qualifiedModuleName);
}
示例3: process
public function process(Vtiger_Request $request)
{
$qualifiedModuleName = $request->getModule(false);
$moduleModel = Settings_Vtiger_CompanyDetails_Model::getInstance();
$status = false;
if ($request->get('organizationname')) {
$saveLogo = $status = true;
if (!empty($_FILES['logo']['name'])) {
$logoDetails = $_FILES['logo'];
$fileType = explode('/', $logoDetails['type']);
$fileType = $fileType[1];
if (!$logoDetails['size'] || !in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
$saveLogo = false;
}
//mime type check
$mimeType = Vtiger_Functions::getMimeContentType($logoDetails['tmp_name']);
$mimeTypeContents = explode('/', $mimeType);
if (!$logoDetails['size'] || $mimeTypeContents[0] != 'image' || !in_array($mimeTypeContents[1], Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
$saveLogo = false;
}
// Check for php code injection
$imageContents = file_get_contents($_FILES["logo"]["tmp_name"]);
if (preg_match('/(<\?php?(.*?))/i', $imageContents) == 1) {
$saveLogo = false;
}
if ($saveLogo) {
$moduleModel->saveLogo();
}
} else {
$saveLogo = true;
}
$fields = $moduleModel->getFields();
foreach ($fields as $fieldName => $fieldType) {
$fieldValue = $request->get($fieldName);
if ($fieldName === 'logoname') {
if (!empty($logoDetails['name'])) {
$fieldValue = ltrim(basename(" " . $logoDetails['name']));
} else {
$fieldValue = $moduleModel->get($fieldName);
}
}
$moduleModel->set($fieldName, $fieldValue);
}
$moduleModel->save();
}
$reloadUrl = $moduleModel->getIndexViewUrl();
if ($saveLogo && $status) {
} else if (!$saveLogo) {
$reloadUrl .= '&error=LBL_INVALID_IMAGE';
} else {
$reloadUrl = $moduleModel->getEditViewUrl() . '&error=LBL_FIELDS_INFO_IS_EMPTY';
}
header('Location: ' . $reloadUrl);
}
示例4: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
$currencyName = $request->get('currency');
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$priceDetails = $recordModel->getPriceDetails();
} else {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$priceDetails = $recordModel->getPriceDetails();
foreach ($priceDetails as $key => $currencyDetails) {
if ($currencyDetails['curname'] === $currencyName) {
$baseCurrencyConversionRate = $currencyDetails['conversionrate'];
break;
}
}
foreach ($priceDetails as $key => $currencyDetails) {
if ($currencyDetails['curname'] === $currencyName) {
$currencyDetails['conversionrate'] = 1;
$currencyDetails['is_basecurrency'] = 1;
} else {
$currencyDetails['conversionrate'] = $currencyDetails['conversionrate'] / $baseCurrencyConversionRate;
$currencyDetails['is_basecurrency'] = 0;
}
$priceDetails[$key] = $currencyDetails;
}
}
$viewer = $this->getViewer($request);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('PRICE_DETAILS', $priceDetails);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->view('MoreCurrenciesList.tpl', 'Products');
}
示例5: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$qualifiedModuleName = $request->getModule(false);
if ($recordId) {
$recordModel = Settings_MailConverter_Record_Model::getInstanceById($recordId);
} else {
$recordModel = Settings_MailConverter_Record_Model::getCleanInstance();
}
$recordModel->set('scannerOldName', $request->get('scannerOldName'));
$fieldsList = $recordModel->getModule()->getFields();
foreach ($fieldsList as $fieldName => $fieldModel) {
$recordModel->set($fieldName, $request->get($fieldName));
}
$status = $recordModel->save();
$response = new Vtiger_Response();
if ($status) {
$result = array('message' => vtranslate('LBL_SAVED_SUCCESSFULLY', $qualifiedModuleName));
$result['id'] = $recordModel->getId();
$response->setResult($result);
} else {
$response->setError(vtranslate('LBL_CONNECTION_TO_MAILBOX_FAILED', $qualifiedModuleName));
}
$response->emit();
}
示例6: process
public function process(Vtiger_Request $request)
{
$db = PearDatabase::getInstance();
$qualifiedModuleName = $request->getModule(false);
$moduleName = $request->getModule();
$baseModule = $request->get('base_module');
$tpl_id = $request->get('tpl_id');
if ($request->get('s') == '' || $request->get('s') == 'true') {
$summary = $request->get('summary');
$conditionAll = $request->getRaw('condition_all_json');
$conditionOption = $request->getRaw('condition_option_json');
if ($tpl_id != '') {
$insertBaseRecord = "UPDATE vtiger_dataaccess SET module_name = ?, summary = ? WHERE dataaccessid = ?";
$db->pquery($insertBaseRecord, array($baseModule, $summary, $tpl_id), true);
Settings_DataAccess_Module_Model::updateConditions($conditionAll, $tpl_id);
Settings_DataAccess_Module_Model::updateConditions($conditionOption, $tpl_id, FALSE);
} else {
$insertBaseRecord = "INSERT INTO vtiger_dataaccess (module_name,summary) VALUES(?,?)";
$db->pquery($insertBaseRecord, array($baseModule, $summary), true);
$tpl_id = $db->getLastInsertID();
Settings_DataAccess_Module_Model::addConditions($conditionAll, $tpl_id);
Settings_DataAccess_Module_Model::addConditions($conditionOption, $tpl_id, FALSE);
}
}
$DataAccess = Settings_DataAccess_Module_Model::getDataAccessInfo($tpl_id, false);
$viewer = $this->getViewer($request);
$viewer->assign('STEP', 3);
$viewer->assign('TPL_ID', $tpl_id);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('REQUEST', $request);
$viewer->assign('BASE_MODULE', $baseModule);
$viewer->assign('ACTIONS_SELECTED', $DataAccess['basic_info']['data']);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
echo $viewer->view('Step3.tpl', $qualifiedModuleName, true);
}
示例7: GetCSV
/**
* Function exports report in a CSV file
* @param Vtiger_Request $request
*/
function GetCSV(Vtiger_Request $request)
{
$recordId = $request->get('record');
$reportModel = Reports_Record_Model::getInstanceById($recordId);
$reportModel->set('advancedFilter', $request->get('advanced_filter'));
$reportModel->getReportCSV();
}
示例8: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$modules = $request->get('modules');
$assignId = $request->get('assigned_user_id');
$currentUser = Users_Record_Model::getCurrentUserModel();
$entityValues = array();
$entityValues['transferRelatedRecordsTo'] = $request->get('transferModule');
//■権限なぜか、エラーになるので権限を固定するinouchi
//$entityValues['assignedTo'] = vtws_getWebserviceEntityId(vtws_getOwnerType($assignId), $assignId);
$entityValues['assignedTo'] = vtws_getWebserviceEntityId(vtws_getOwnerType(1), 1);
$entityValues['leadId'] = vtws_getWebserviceEntityId($request->getModule(), $recordId);
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $request->getModule());
$convertLeadFields = $recordModel->getConvertLeadFields();
$availableModules = array('Accounts', 'Contacts', 'Potentials');
foreach ($availableModules as $module) {
if (vtlib_isModuleActive($module) && in_array($module, $modules)) {
$entityValues['entities'][$module]['create'] = true;
$entityValues['entities'][$module]['name'] = $module;
foreach ($convertLeadFields[$module] as $fieldModel) {
$fieldName = $fieldModel->getName();
$fieldValue = $request->get($fieldName);
//Potential Amount Field value converting into DB format
if ($fieldModel->getFieldDataType() === 'currency') {
$fieldValue = Vtiger_Currency_UIType::convertToDBFormat($fieldValue);
} elseif ($fieldModel->getFieldDataType() === 'date') {
$fieldValue = DateTimeField::convertToDBFormat($fieldValue);
} elseif ($fieldModel->getFieldDataType() === 'reference' && $fieldValue) {
$ids = vtws_getIdComponents($fieldValue);
if (count($ids) === 1) {
$fieldValue = vtws_getWebserviceEntityId(getSalesEntityType($fieldValue), $fieldValue);
}
}
$entityValues['entities'][$module][$fieldName] = $fieldValue;
}
}
}
try {
$result = vtws_convertlead($entityValues, $currentUser);
} catch (Exception $e) {
$this->showError($request, $e);
exit;
}
if (!empty($result['Accounts'])) {
$accountIdComponents = vtws_getIdComponents($result['Accounts']);
$accountId = $accountIdComponents[1];
}
if (!empty($result['Contacts'])) {
$contactIdComponents = vtws_getIdComponents($result['Contacts']);
$contactId = $contactIdComponents[1];
}
if (!empty($accountId)) {
header("Location: index.php?view=Detail&module=Accounts&record={$accountId}");
} elseif (!empty($contactId)) {
header("Location: index.php?view=Detail&module=Contacts&record={$contactId}");
} else {
$this->showError($request);
exit;
}
}
示例9: process
function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$records = $request->get('records');
$template = $request->get('template');
$targetModuleName = $request->get('target');
$method = $request->get('method');
$success = [];
if (!empty($template)) {
$templateRecord = Vtiger_MappedFields_Model::getInstanceById($template);
foreach ($records as $recordId) {
if ($templateRecord->checkFiltersForRecord(intval($recordId))) {
if ($method == 0) {
$recordModel = Vtiger_Record_Model::getCleanInstance($targetModuleName);
$parentRecordModel = Vtiger_Record_Model::getInstanceById($recordId);
$recordModel->setRecordFieldValues($parentRecordModel);
if ($this->checkMandatoryFields($recordModel)) {
continue;
}
// TODO Add saving fields that exist in advanced module
$recordModel->save();
if (isRecordExists($recordModel->getId())) {
$success[] = $recordId;
}
} else {
$success[] = $recordId;
}
}
}
}
$output = ['all' => count($records), 'ok' => $success, 'fail' => array_diff($records, $success)];
$response = new Vtiger_Response();
$response->setResult($output);
$response->emit();
}
示例10: process
function process(Vtiger_Request $request)
{
$username = $request->get('username');
$password = $request->get('password');
$user = CRMEntity::getInstance('Users');
$user->column_fields['user_name'] = $username;
if ($user->doLogin($password)) {
$userid = $user->retrieve_user_id($username);
Vtiger_Session::set('AUTHUSERID', $userid);
// For Backward compatability
// TODO Remove when switch-to-old look is not needed
$_SESSION['authenticated_user_id'] = $userid;
$_SESSION['app_unique_key'] = vglobal('application_unique_key');
$_SESSION['authenticated_user_language'] = vglobal('default_language');
//Enabled session variable for KCFINDER
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['KCFINDER']['uploadURL'] = "test/upload";
$_SESSION['KCFINDER']['uploadDir'] = "test/upload";
$deniedExts = implode(" ", vglobal('upload_badext'));
$_SESSION['KCFINDER']['deniedExts'] = $deniedExts;
// End
//Track the login History
$moduleModel = Users_Module_Model::getInstance('Users');
$moduleModel->saveLoginHistory($user->column_fields['user_name']);
//End
header('Location: index.php?module=Users&parent=Settings&view=SystemSetup');
exit;
} else {
header('Location: index.php?module=Users&parent=Settings&view=Login&error=1');
exit;
}
}
示例11: getActivities
/**
* Function to get activities
* @param Vtiger_Request $request
* @return <List of activity models>
*/
public function getActivities(Vtiger_Request $request)
{
$moduleName = 'Calendar';
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if ($currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
$moduleName = $request->getModule();
$recordId = $request->get('record');
$pageNumber = $request->get('page');
if (empty($pageNumber)) {
$pageNumber = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('limit', 10);
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$moduleModel = $recordModel->getModule();
$relatedActivities = $moduleModel->getCalendarActivities('', $pagingModel, 'all', $recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('ACTIVITIES', $relatedActivities);
return $viewer->view('RelatedActivities.tpl', $moduleName, true);
}
}
示例12: getRecordModelFromRequest
protected function getRecordModelFromRequest(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$modelData = $recordModel->getData();
$recordModel->set('id', $recordId);
$recordModel->set('mode', 'edit');
} else {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$modelData = $recordModel->getData();
$recordModel->set('mode', '');
}
$fieldModelList = $moduleModel->getFields();
foreach ($fieldModelList as $fieldName => $fieldModel) {
if (in_array($fieldName, array('header_content', 'content', 'footer_content'))) {
$fieldValue = $request->getRaw($fieldName, null);
} else {
$fieldValue = $request->get($fieldName, null);
}
$fieldDataType = $fieldModel->getFieldDataType();
if ($fieldDataType == 'time') {
$fieldValue = Vtiger_Time_UIType::getTimeValueWithSeconds($fieldValue);
}
if ($fieldValue !== null) {
if (!is_array($fieldValue)) {
$fieldValue = trim($fieldValue);
}
$recordModel->set($fieldName, $fieldValue);
}
}
return $recordModel;
}
示例13: process
function process(Vtiger_Request $request)
{
$log = vglobal('log');
$log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '() method ...');
$moduleName = $request->getModule();
$recordId = $request->get('record');
$view = $request->get('fromview');
$viewer = $this->getViewer($request);
$handlerClass = Vtiger_Loader::getComponentClassName('Model', 'MappedFields', $moduleName);
$mfModel = new $handlerClass();
if ($view == 'List') {
$allRecords = Vtiger_Mass_Action::getRecordsListFromRequest($request);
$templates = $mfModel->getActiveTemplatesForModule($moduleName, $view);
$viewer->assign('ALL_RECORDS', $allRecords);
} else {
$templates = $mfModel->getActiveTemplatesForRecord($recordId, $view, $moduleName);
$viewer->assign('RECORD', $recordId);
}
$viewer->assign('TEMPLATES', $templates);
$viewer->assign('VIEW', $view);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('BASE_MODULE_NAME', 'Vtiger');
$this->preProcess($request);
$viewer->view('GenerateModal.tpl', $qualifiedModule);
$this->postProcess($request);
$log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
}
示例14: deleteRecords
public function deleteRecords(Vtiger_Request $request) {
$searchValue = $request->get('search_value');
$selectedIds = $request->get('selected_ids');
$excludedIds = $request->get('excluded_ids');
$db = PearDatabase::getInstance();
$query = 'DELETE FROM vtiger_portal';
$params = array();
if(!empty($selectedIds) && $selectedIds != 'all' && count($selectedIds) > 0) {
$query .= " WHERE portalid IN (".generateQuestionMarks($selectedIds).")";
$params = $selectedIds;
} else if($selectedIds == 'all') {
if(empty($searchValue) && count($excludedIds) > 0) {
$query .= " WHERE portalid NOT IN (".generateQuestionMarks($excludedIds).")";
$params = $excludedIds;
} else if(!empty($searchValue) && count($excludedIds) < 1) {
$query .= " WHERE portalname LIKE '%".$searchValue."%'";
} else if(!empty($searchValue) && count($excludedIds) > 0) {
$query .= " WHERE portalname LIKE '%".$searchValue."%' AND portalid NOT IN (".generateQuestionMarks($excludedIds).")";
$params = $excludedIds;
}
}
$db->pquery($query, $params);
}
示例15: changePassword
public function changePassword($request)
{
$request = new Vtiger_Request($request);
$viewer = Vtiger_Viewer::getInstance();
$userName = $request->get('username');
$newPassword = $request->get('password');
$confirmPassword = $request->get('confirmPassword');
$shortURLID = $request->get('shorturl_id');
$secretHash = $request->get('secret_hash');
$shortURLModel = Vtiger_ShortURL_Helper::getInstance($shortURLID);
$secretToken = $shortURLModel->handler_data['secret_token'];
$validateData = array('username' => $userName, 'secret_token' => $secretToken, 'secret_hash' => $secretHash);
$valid = $shortURLModel->compareEquals($validateData);
if ($valid) {
$userId = getUserId_Ol($userName);
$user = Users::getActiveAdminUser();
$wsUserId = vtws_getWebserviceEntityId('Users', $userId);
vtws_changePassword($wsUserId, '', $newPassword, $confirmPassword, $user);
} else {
$viewer->assign('ERROR', true);
}
$shortURLModel->delete();
$viewer->assign('USERNAME', $userName);
$viewer->assign('PASSWORD', $newPassword);
$viewer->view('FPLogin.tpl', 'Users');
}