本文整理汇总了PHP中Vtiger_Request::has方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Request::has方法的具体用法?PHP Vtiger_Request::has怎么用?PHP Vtiger_Request::has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Request
的用法示例。
在下文中一共展示了Vtiger_Request::has方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBreadcrumbTitle
public function getBreadcrumbTitle(Vtiger_Request $request)
{
$moduleName = $request->getModule();
if ($request->has('isDuplicate')) {
$pageTitle = vtranslate('LBL_VIEW_DUPLICATE', $moduleName);
} elseif ($request->has('record')) {
$pageTitle = vtranslate('LBL_VIEW_EDIT', $moduleName);
} else {
$pageTitle = vtranslate('LBL_VIEW_CREATE', $moduleName);
}
return $pageTitle;
}
示例2: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$srecord = $request->get('srecord');
$smodule = $request->get('smodule');
$type = $request->get('type');
$mode = $request->get('mode');
$record = $request->get('record');
$mailFilter = $request->get('mailFilter');
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$recordModel_OSSMailScanner = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
$config = $recordModel_OSSMailScanner->getConfig('email_list');
if ($request->has('limit')) {
$config['widget_limit'] = $request->get('limit');
}
$viewer = $this->getViewer($request);
$viewer->assign('RECOLDLIST', $recordModel->{$mode}($srecord, $smodule, $config, $type, $mailFilter));
$viewer->assign('SENDURLDDATA', $urldata);
$viewer->assign('MODULENAME', $moduleName);
$viewer->assign('SMODULENAME', $smodule);
$viewer->assign('RECORD', $record);
$viewer->assign('SRECORD', $srecord);
$viewer->assign('TYPE', $type);
$viewer->assign('POPUP', $config['popup']);
$viewer->view('widgets.tpl', 'OSSMailView');
}
示例3: process
function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = $request->getModule();
$componentName = $request->get('name');
$linkId = $request->get('linkid');
if (!empty($componentName)) {
$className = Vtiger_Loader::getComponentClassName('Dashboard', $componentName, $moduleName);
if (!empty($className)) {
$widget = NULL;
if (!empty($linkId)) {
$widget = new Vtiger_Widget_Model();
$widget->set('linkid', $linkId);
$widget->set('userid', $currentUser->getId());
$widget->set('filterid', $request->get('filterid', NULL));
if ($request->has('data')) {
$widget->set('data', $request->get('data'));
}
$widget->add();
}
$classInstance = new $className();
$classInstance->process($request, $widget);
return;
}
}
$response = new Vtiger_Response();
$response->setResult(array('success' => false, 'message' => vtranslate('NO_DATA')));
$response->emit();
}
示例4: save
public function save(Vtiger_Request $request)
{
$fieldId = $request->get('fieldid');
$fieldInstance = Vtiger_Field_Model::getInstance($fieldId);
$fields = ['presence', 'quickcreate', 'summaryfield', 'helpinfo', 'generatedtype', 'masseditable', 'displaytype'];
foreach ($request->getAll() as $key => $value) {
if ($key == 'mandatory') {
$fieldInstance->updateTypeofDataFromMandatory($value);
}
if (in_array($key, $fields)) {
$fieldInstance->set($key, $value);
}
}
$defaultValue = $request->get('fieldDefaultValue');
if ($fieldInstance->getFieldDataType() == 'date') {
$dateInstance = new Vtiger_Date_UIType();
$defaultValue = $dateInstance->getDBInsertedValue($defaultValue);
}
if ($request->has('fieldMask')) {
$fieldInstance->set('fieldparams', $request->get('fieldMask'));
}
if (is_array($defaultValue)) {
$defaultValue = implode(' |##| ', $defaultValue);
}
$fieldInstance->set('defaultvalue', $defaultValue);
$response = new Vtiger_Response();
try {
$fieldInstance->save();
$response->setResult(array('success' => true, 'presence' => $request->get('presence'), 'mandatory' => $fieldInstance->isMandatory(), 'label' => vtranslate($fieldInstance->get('label'), $request->get('sourceModule'))));
} catch (Exception $e) {
$response->setError($e->getCode(), $e->getMessage());
}
$response->emit();
}
示例5: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
if (!$request->has('owner')) {
$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
} else {
$owner = $request->get('owner');
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', (int) $widget->get('limit'));
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$overDueActivities = $owner === false ? array() : $moduleModel->getCalendarActivities('overdue', $pagingModel, $owner);
$viewer = $this->getViewer($request);
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('ACTIVITIES', $overDueActivities);
$viewer->assign('PAGING', $pagingModel);
$viewer->assign('CURRENTUSER', $currentUser);
$title_max_length = vglobal('title_max_length');
$href_max_length = vglobal('href_max_length');
$viewer->assign('NAMELENGHT', $title_max_length);
$viewer->assign('HREFNAMELENGHT', $href_max_length);
$viewer->assign('NODATAMSGLABLE', 'LBL_NO_OVERDUE_ACTIVITIES');
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CalendarActivities.tpl', $moduleName);
}
}
示例6: process
public function process(Vtiger_Request $request)
{
PDFMaker_Debugger_Model::GetInstance()->Init();
$PDFMaker = new PDFMaker_PDFMaker_Model();
if ($PDFMaker->CheckPermissions("DELETE") == false) {
$PDFMaker->DieDuePermission();
}
$adb = PearDatabase::getInstance();
$id_array = array();
if ($request->has('templateid') && !$request->isEmpty('templateid')) {
$templateid = $request->get('templateid');
$checkSql = "select module from vtiger_pdfmaker where templateid=?";
$checkRes = $adb->pquery($checkSql, array($templateid));
$checkRow = $adb->fetchByAssoc($checkRes);
//if we are trying to delete template that is not allowed for current user then die because user should not be able to see the template
//$PDFMaker->CheckTemplatePermissions($checkRow["module"], $templateid);
$Template_Permissions_Data = $PDFMaker->returnTemplatePermissionsData($checkRow["module"], $templateid);
if ($Template_Permissions_Data["delete"] === false) {
$this->DieDuePermission();
}
$sql = "delete from vtiger_pdfmaker where templateid=?";
$adb->pquery($sql, array($templateid));
$sql = "delete from vtiger_pdfmaker_settings where templateid=?";
$adb->pquery($sql, array($templateid));
} else {
$idlist = $request->get('idlist');
$id_array = explode(';', $idlist);
$checkSql = "select templateid, module from vtiger_pdfmaker where templateid IN (" . generateQuestionMarks($id_array) . ")";
$checkRes = $adb->pquery($checkSql, $id_array);
$checkArr = array();
while ($checkRow = $adb->fetchByAssoc($checkRes)) {
$checkArr[$checkRow["templateid"]] = $checkRow["module"];
}
for ($i = 0; $i < count($id_array) - 1; $i++) {
//if we are trying to delete template that is not allowed for current user then die because user should not be able to see the template
//$PDFMaker->CheckTemplatePermissions($checkArr[$id_array[$i]], $id_array[$i]);
$Template_Permissions_Data = $PDFMaker->returnTemplatePermissionsData($checkArr[$id_array[$i]], $id_array[$i]);
if ($Template_Permissions_Data["delete"] === false) {
$this->DieDuePermission();
}
$sql = "delete from vtiger_pdfmaker where templateid=?";
$adb->pquery($sql, array($id_array[$i]));
$sql = "delete from vtiger_pdfmaker_settings where templateid=?";
$adb->pquery($sql, array($id_array[$i]));
}
}
$ajaxDelete = $request->get('ajaxDelete');
$listViewUrl = "index.php?module=PDFMaker&view=List";
if ($ajaxDelete) {
$response = new Vtiger_Response();
$response->setResult($listViewUrl);
return $response;
} else {
header("Location: {$listViewUrl}");
}
}
示例7: getRecordModelFromRequest
/**
* Function to get the record model based on the request parameters
* @param Vtiger_Request $request
* @return Vtiger_Record_Model or Module specific Record Model instance
*/
protected function getRecordModelFromRequest(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$modelData = $recordModel->getData();
$recordModel->set('id', $recordId);
$sharedType = $request->get('sharedtype');
if (!empty($sharedType)) {
$recordModel->set('calendarsharedtype', $request->get('sharedtype'));
}
$recordModel->set('mode', 'edit');
} else {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$modelData = $recordModel->getData();
$recordModel->set('mode', '');
}
foreach ($modelData as $fieldName => $value) {
$requestFieldExists = $request->has($fieldName);
if (!$requestFieldExists) {
continue;
}
$fieldValue = $request->get($fieldName, null);
if ($fieldName === 'is_admin' && !$fieldValue) {
$fieldValue = 'off';
}
if ($fieldValue !== null) {
if (!is_array($fieldValue)) {
$fieldValue = trim($fieldValue);
}
$recordModel->set($fieldName, $fieldValue);
}
}
$homePageComponents = $recordModel->getHomePageComponents();
$selectedHomePageComponents = $request->get('homepage_components', array());
foreach ($homePageComponents as $key => $value) {
if (in_array($key, $selectedHomePageComponents)) {
$request->setGlobal($key, $key);
} else {
$request->setGlobal($key, '');
}
}
// Tag cloud save
$tagCloud = $request->get('tagcloudview');
if ($tagCloud == "on") {
$recordModel->set('tagcloud', 0);
} else {
$recordModel->set('tagcloud', 1);
}
return $recordModel;
}
示例8: getRecordModelFromRequest
/**
* Function to get the record model based on the request parameters
* @param Vtiger_Request $request
* @return Vtiger_Record_Model or Module specific Record Model instance
*/
public function getRecordModelFromRequest(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$recordModel->set('id', $recordId);
$recordModel->set('mode', 'edit');
$fieldModelList = $recordModel->getModule()->getFields();
foreach ($fieldModelList as $fieldName => $fieldModel) {
$fieldValue = $fieldModel->getUITypeModel()->getUserRequestValue($recordModel->get($fieldName));
if ($fieldName === $request->get('field')) {
$fieldValue = $request->get('value');
}
$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);
}
$recordModel->set($fieldName, $fieldValue);
}
} else {
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$recordModel->set('mode', '');
$fieldModelList = $moduleModel->getFields();
foreach ($fieldModelList as $fieldName => $fieldModel) {
if ($request->has($fieldName)) {
$fieldValue = $request->get($fieldName, null);
} else {
$fieldValue = $fieldModel->getDefaultFieldValue();
}
$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;
}
示例9: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$sortOrder = $request->get('sortorder');
$orderBy = $request->get('orderby');
$data = $request->getAll();
$params = ['activitesType' => 'upcoming'];
if ($request->get('activitesType')) {
$params = ['activitesType' => $request->get('activitesType')];
} else {
$data['activitesType'] = 'upcoming';
$params = ['activitesType' => 'upcoming'];
}
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
if (!$request->has('owner')) {
$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
} else {
$owner = $request->get('owner');
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', (int) $widget->get('limit'));
$pagingModel->set('orderby', $orderBy);
$pagingModel->set('sortorder', $sortOrder);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$overDueActivities = $owner === false ? array() : $moduleModel->getCalendarActivities('createdByMeButNotMine', $pagingModel, $owner, false, $params);
$viewer = $this->getViewer($request);
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('ACTIVITIES', $overDueActivities);
$viewer->assign('PAGING', $pagingModel);
$viewer->assign('CURRENTUSER', $currentUser);
$title_max_length = vglobal('title_max_length');
$href_max_length = vglobal('href_max_length');
$viewer->assign('NAMELENGHT', $title_max_length);
$viewer->assign('HREFNAMELENGHT', $href_max_length);
$viewer->assign('NODATAMSGLABLE', 'LBL_NO_RECORDS_MATCHED_THIS_CRITERIA');
$viewer->assign('OWNER', $owner);
$viewer->assign('DATA', $data);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CreatedNotMineActivities.tpl', $moduleName);
}
}
示例10: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$linkId = $request->get('linkid');
$response = new Vtiger_Response();
if ($request->has('widgetid')) {
$widget = Vtiger_Widget_Model::getInstanceWithWidgetId($request->get('widgetid'), $currentUser->getId());
} else {
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
}
if (!$widget->isDefault()) {
$widget->remove();
$response->setResult(array('linkid' => $linkId, 'name' => $widget->getName(), 'url' => $widget->getUrl(), 'title' => vtranslate($widget->getTitle(), $request->getModule())));
} else {
$response->setError(vtranslate('LBL_CAN_NOT_REMOVE_DEFAULT_WIDGET', $moduleName));
}
$response->emit();
}
示例11: transformToUI5URL
protected function transformToUI5URL(Vtiger_Request $request)
{
$params = 'module=Settings&action=index';
if ($request->has('item')) {
switch ($request->get('item')) {
case 'LayoutEditor':
$params = 'module=Settings&action=LayoutBlockList&parenttab=Settings&formodule=' . $request->get('source_module');
break;
case 'EditWorkflows':
$params = 'module=com_vtiger_workflow&action=workflowlist&list_module=' . $request->get('source_module');
break;
case 'PicklistEditor':
$params = 'module=PickList&action=PickList&parenttab=Settings&moduleName=' . $request->get('source_module');
break;
case 'SMSServerConfig':
$params = 'module=' . $request->get('source_module') . '&action=SMSConfigServer&parenttab=Settings&formodule=' . $request->get('source_module');
break;
case 'CustomFieldList':
$params = 'module=Settings&action=CustomFieldList&parenttab=Settings&formodule=' . $request->get('source_module');
break;
case 'GroupDetailView':
$params = 'module=Settings&action=GroupDetailView&groupId=' . $request->get('groupId');
break;
case 'ModuleManager':
$params = 'module=Settings&action=ModuleManager&parenttab=Settings';
break;
case 'MailScanner':
$params = 'module=Settings&action=MailScanner&parenttab=Settings';
break;
case 'WebForms':
$params = 'module=Webforms&action=index&parenttab=Settings';
break;
case 'CustomFields':
$params = 'module=Settings&action=CustomFieldList&parenttab=Settings&formodule=' . $request->get('source_module');
break;
}
}
return '../index.php?' . $params;
}
示例12: process
function process(Vtiger_Request $request)
{
if (!$request->has('_operation')) {
return $this->processRoot($request);
}
$operation = $request->getOperation();
$controllerInfo = self::$controllers[$operation];
// TODO Handle case when controller information is not available
//$controllerFile = dirname(__FILE__) . '/' . $controllerInfo['file'];
//checkFileAccessForInclusion($controllerFile);
//include_once $controllerFile;
$controller = new $controllerInfo['class']();
// Making sure to close the open connection
if ($controller) {
$controller->closeConnector();
}
$response = $controller->process($request);
if ($response) {
$response->emit();
}
unset($request);
unset($response);
}
示例13: process
public function process(Vtiger_Request $request)
{
$record = $request->get('record');
if (empty($record)) {
//get instance from currency name, Aleady deleted and adding again same currency case
$recordModel = Settings_Currency_Record_Model::getInstance($request->get('currency_name'));
if (empty($recordModel)) {
$recordModel = new Settings_Currency_Record_Model();
}
} else {
$recordModel = Settings_Currency_Record_Model::getInstance($record);
}
$fieldList = array('currency_name', 'conversion_rate', 'currency_status', 'currency_code', 'currency_symbol');
foreach ($fieldList as $fieldName) {
if ($request->has($fieldName)) {
$recordModel->set($fieldName, $request->get($fieldName));
}
}
//To make sure we are saving record as non deleted. This is useful if we are adding deleted currency
$recordModel->set('deleted', 0);
$response = new Vtiger_Response();
try {
if ($request->get('currency_status') == 'Inactive' && !empty($record)) {
$transforCurrencyToId = $request->get('transform_to_id');
if (empty($transforCurrencyToId)) {
throw new Exception('Transfer currency id cannot be empty');
}
Settings_Currency_Module_Model::tranformCurrency($record, $transforCurrencyToId);
}
$id = $recordModel->save();
$recordModel = Settings_Currency_Record_Model::getInstance($id);
$response->setResult(array_merge($recordModel->getData(), array('record' => $recordModel->getId())));
} catch (Exception $e) {
$response->setError($e->getCode(), $e->getMessage());
}
$response->emit();
}
示例14: getValueForSave
/**
* Get the value to save
* @param Vtiger_Request $request
* @param string $field Field name
* @param int $i Sequence number
* @return string
*/
public function getValueForSave($request, $field, $i)
{
$value = '';
if ($request->has($field . $i)) {
$value = $request->get($field . $i);
} else {
if ($request->has($field)) {
$value = $request->get($field);
}
}
if (in_array($field, $this->jsonFields) && $value != '') {
$value = json_encode($value);
}
if (in_array($field, ['price', 'gross', 'net', 'discount', 'purchase', 'margin', 'marginp', 'tax', 'total'])) {
$value = CurrencyField::convertToDBFormat($value, null, true);
}
return $value;
}
示例15: getRecordModelFromRequest
/**
* Function to get the record model based on the request parameters
* @param Vtiger_Request $request
* @return Vtiger_Record_Model or Module specific Record Model instance
*/
public function getRecordModelFromRequest(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
if ($request->get('field') == 'enable_recurring') {
$enableRecurrence = true;
}
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$recordModel->set('id', $recordId);
$recordModel->set('mode', 'edit');
$fieldModelList = $recordModel->getModule()->getFields();
foreach ($fieldModelList as $fieldName => $fieldModel) {
//For not converting createdtime and modified time to user format
$uiType = $fieldModel->get('uitype');
if ($uiType == 70) {
$fieldValue = $recordModel->get($fieldName);
} else {
$fieldValue = $fieldModel->getUITypeModel()->getUserRequestValue($recordModel->get($fieldName));
}
if ($fieldName === $request->get('field')) {
$fieldValue = $request->get('value');
}
/**
* If field is enable recurrence then we need to pass related fields of
* recurrence to save,because untill enable recurrence is checked,the
* related field values wont get saved
*/
if ($enableRecurrence) {
$requestFieldValue = $request->get($fieldName);
if ($requestFieldValue != '') {
$fieldValue = $request->get($fieldName);
}
}
$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);
}
$recordModel->set($fieldName, $fieldValue);
}
} else {
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$recordModel->set('mode', '');
$fieldModelList = $moduleModel->getFields();
foreach ($fieldModelList as $fieldName => $fieldModel) {
if ($request->has($fieldName)) {
$fieldValue = $request->get($fieldName, null);
} else {
$fieldValue = $fieldModel->getDefaultFieldValue();
}
$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;
}