本文整理匯總了PHP中Vtiger_Request::getModule方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Request::getModule方法的具體用法?PHP Vtiger_Request::getModule怎麽用?PHP Vtiger_Request::getModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Request
的用法示例。
在下文中一共展示了Vtiger_Request::getModule方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: process
public function process(Vtiger_Request $request)
{
$moduleSettingsName = $request->getModule(false);
$moduleName = $request->getModule();
$baseModule = $request->get('module_name');
$idTpl = $request->get('tpl_id');
$viewer = $this->getViewer($request);
if ($idTpl) {
$docInfo = Settings_OSSDocumentControl_Module_Model::getDocInfo($idTpl);
$viewer->assign('BASE_INFO', $docInfo['basic_info']);
//var_dump($docInfo['required_conditions']);
for ($i = 0; $i < count($docInfo['required_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['required_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['required_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('REQUIRED_CONDITIONS', $docInfo['required_conditions']);
for ($i = 0; $i < count($docInfo['optional_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['optional_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['optional_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('OPTIONAL_CONDITIONS', $docInfo['optional_conditions']);
$viewer->assign('TPL_ID', $idTpl);
//$fieldModel = Vtiger_Field_Model::getInstance($value->get('name'), $baseModuleModel);
}
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('SUMMARY', $request->get('summary'));
$viewer->assign('BASE_MODULE', $baseModule);
$viewer->assign('QUALIFIED_MODULE', $moduleSettingsName);
$viewer->assign('FIELD_LIST', Settings_OSSDocumentControl_Module_Model::getListBaseModuleField($baseModule));
//$viewer->assign('FOLDER_LIST', Documents_Module_Model::getAllFolders());
$viewer->assign('CONDITION_BY_TYPE', Settings_OSSDocumentControl_Module_Model::getConditionByType());
echo $viewer->view('Edit2.tpl', $moduleSettingsName, true);
}
示例2: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$lang = $request->get('lang');
$mod = $request->get('mod');
$ShowDifferences = $request->get('sd');
$moduleModel = Settings_LangManagement_Module_Model::getInstance($qualifiedModuleName);
if ($lang != '' && $mod != '') {
//$data = $moduleModel->loadLangTranslation($lang,'HelpInfo',$ShowDifferences);
$data = $moduleModel->loadAllFieldsFromModule($lang, $mod, $ShowDifferences);
}
$Langs = $moduleModel->getLang();
//$Mods = $moduleModel->getModFromLang($lang);
$viewer = $this->getViewer($request);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('REQUEST', $request);
$viewer->assign('LANGS', $Langs);
$viewer->assign('DATA', $data);
$viewer->assign('LANGS', $Langs);
$viewer->assign('SD', $ShowDifferences);
//$viewer->assign('MODS', $Mods );
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('MODULE', $moduleName);
$viewer->view('EditHelpIcon.tpl', $qualifiedModuleName);
}
示例3: 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;
}
}
示例4: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$scannerId = $request->get('record');
if ($scannerId == '') {
$scannerId = Settings_MailConverter_Module_Model::getDefaultId();
}
$qualifiedModuleName = $request->getModule(false);
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($qualifiedModuleName);
$recordExists = Settings_MailConverter_Module_Model::MailBoxExists();
$recordModel = Settings_MailConverter_Record_Model::getAll();
$viewer = $this->getViewer($request);
$viewer->assign('LISTVIEW_LINKS', $listViewModel->getListViewLinks());
$viewer->assign("MODULE_MODEL", Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName));
$viewer->assign("MAILBOXES", Settings_MailConverter_Module_Model::getMailboxes());
$viewer->assign("MODULE_NAME", $moduleName);
$viewer->assign("QUALIFIED_MODULE_NAME", $qualifiedModuleName);
$viewer->assign('CRON_RECORD_MODEL', Settings_CronTasks_Record_Model::getInstanceByName('MailScanner'));
$viewer->assign('RECORD_EXISTS', $recordExists);
if ($scannerId) {
$viewer->assign('SCANNER_ID', $scannerId);
$viewer->assign("RECORD", $recordModel[$scannerId]);
$viewer->assign('SCANNER_MODEL', Settings_MailConverter_Record_Model::getInstanceById($scannerId));
$viewer->assign('RULE_MODELS_LIST', Settings_MailConverter_RuleRecord_Model::getAll($scannerId));
$viewer->assign('FOLDERS_SCANNED', Settings_MailConverter_Module_Model::getScannedFolders($scannerId));
}
$viewer->view("RulesList.tpl", $qualifiedModuleName);
}
示例5: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$moduleName = $request->getModule();
$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('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('MODE', $mode);
$viewer->assign('SOURCE_MODULE', $sourceModule);
$viewer->assign('MODULE', $moduleName);
$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);
}
示例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: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$scannerId = $request->get('scannerId');
$qualifiedModuleName = $request->getModule(false);
$moduleName = $request->getModule();
if ($recordId) {
$recordModel = Settings_MailConverter_RuleRecord_Model::getInstanceById($recordId);
} else {
$recordModel = Settings_MailConverter_RuleRecord_Model::getCleanInstance($scannerId);
}
$assignedTo = Settings_MailConverter_RuleRecord_Model::getAssignedTo($scannerId, $recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD_ID', $recordId);
$viewer->assign('RECORD_MODEL', $recordModel);
$viewer->assign('MODULE_MODEL', new Settings_MailConverter_Module_Model());
$viewer->assign('SCANNER_ID', $scannerId);
$viewer->assign('SCANNER_MODEL', Settings_MailConverter_Record_Model::getInstanceById($scannerId));
$viewer->assign('DEFAULT_OPTIONS', Settings_MailConverter_RuleRecord_Model::getDefaultConditions());
$viewer->assign('DEFAULT_ACTIONS', Settings_MailConverter_RuleRecord_Model::getDefaultActions());
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('ASSIGNED_USER', $assignedTo[0]);
$viewer->view('RuleEditView.tpl', $qualifiedModuleName);
}
示例8: 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);
}
示例9: edit
public function edit(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$wid = $request->get('id');
$moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);
$WidgetInfo = $moduleModel->getWidgetInfo($wid);
$RelatedModule = $moduleModel->getRelatedModule($WidgetInfo['tabid']);
$type = $WidgetInfo['type'];
$viewer = $this->getViewer($request);
$viewer->assign('SOURCE', $WidgetInfo['tabid']);
$viewer->assign('SOURCEMODULE', Vtiger_Functions::getModuleName($WidgetInfo['tabid']));
$viewer->assign('WID', $wid);
$viewer->assign('WIDGETINFO', $WidgetInfo);
$viewer->assign('TYPE', $type);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('RELATEDMODULES', $RelatedModule);
$widgetName = 'Vtiger_' . $type . '_Widget';
if (class_exists($widgetName)) {
$widgetInstance = new $widgetName();
$tplName = $widgetInstance->getConfigTplName();
$viewer->view("widgets/{$tplName}.tpl", 'Vtiger');
}
}
示例10: process
public function process(Vtiger_Request $request)
{
$cknsmcq = "workflows";
${"GLOBALS"}["ifktazsbq"] = "moduleName";
${"GLOBALS"}["acketqlpqnw"] = "viewer";
$mypsusquojx = "adb";
$pqoebw = "moduleModel";
${"GLOBALS"}["qtbfyex"] = "sql";
$dxxvvyg = "sql";
global $current_user, $vtiger_current_version;
${$mypsusquojx} = \PearDatabase::getInstance();
${"GLOBALS"}["awhfqalqhehy"] = "qualifiedModuleName";
${${"GLOBALS"}["acketqlpqnw"]} = $this->getViewer(${${"GLOBALS"}["kjqyskixvfj"]});
${${"GLOBALS"}["ifktazsbq"]} = $request->getModule();
$xoteddmoemi = "viewer";
${${"GLOBALS"}["awhfqalqhehy"]} = $request->getModule(false);
${$xoteddmoemi} = $this->getViewer(${${"GLOBALS"}["kjqyskixvfj"]});
${$pqoebw} = Vtiger_Module_Model::getInstance("Workflow2");
${${"GLOBALS"}["qtbfyex"]} = "SELECT * FROM com_vtiger_workflows ORDER BY summary";
${${"GLOBALS"}["nvialwkvl"]} = $adb->query(${$dxxvvyg});
${$cknsmcq} = array();
$vefbawinlqlq = "row";
while (${$vefbawinlqlq} = $adb->fetchByAssoc(${${"GLOBALS"}["nvialwkvl"]})) {
${${"GLOBALS"}["bfbscdga"]}[${${"GLOBALS"}["dqfbywgzt"]}["module_name"]][] = ${${"GLOBALS"}["dqfbywgzt"]};
}
$viewer->assign("workflows", ${${"GLOBALS"}["bfbscdga"]});
$viewer->view("CoreWFImport.tpl", ${${"GLOBALS"}["lxccvb"]});
}
示例11: preProcessSettings
public function preProcessSettings(Vtiger_Request $request)
{
$yrykpljnc = "sql";
$oerxenbygyao = "viewer";
${${"GLOBALS"}["qokftpe"]} = $request->getModule(false);
${$oerxenbygyao} = $this->getViewer(${${"GLOBALS"}["lrlscty"]});
$this->moduleName = $request->getModule();
$this->qualifiedModuleName = $request->getModule(false);
$this->settingsModel = Settings_Vtiger_Module_Model::getInstance($this->qualifiedModuleName);
${${"GLOBALS"}["rcxcyussani"]} = Vtiger_Module_Model::getInstance("Workflow2");
$viewer->assign("VERSION", $moduleModel->version);
$viewer->assign("VIEW", $request->get("view"));
$viewer->assign("MODULE", $this->moduleName);
$viewer->assign("QUALIFIED_MODULE", $this->qualifiedModuleName);
$viewer->assign("LOAD_OLD", Settings_Vtiger_Index_View::${${"GLOBALS"}["vhlhzctq"]});
global $adb;
${$yrykpljnc} = "SELECT * FROM vtiger_wf_repository_types\n INNER JOIN vtiger_wf_types ON (vtiger_wf_types.type = vtiger_wf_repository_types.name AND vtiger_wf_types.repo_id = vtiger_wf_repository_types.repos_id)\n WHERE vtiger_wf_repository_types.version > vtiger_wf_types.version LIMIT 1\n ";
$sbyhkryhvqd = "sql";
${${"GLOBALS"}["ryillrzl"]} = $adb->query(${$sbyhkryhvqd});
if ($adb->num_rows(${${"GLOBALS"}["ryillrzl"]}) > 0) {
$viewer->assign("AVAILABLE_TASK_UPDATE", true);
} else {
$viewer->assign("AVAILABLE_TASK_UPDATE", false);
}
$viewer->view("IndexMenuStart.tpl", ${${"GLOBALS"}["qokftpe"]});
}
示例12: process
public function process(Vtiger_Request $request)
{
$qualifiedModuleName = $request->getModule(false);
$moduleName = $request->getModule();
$baseModule = $request->get('base_module');
$idTpl = $request->get('tpl_id');
$viewer = $this->getViewer($request);
if ($idTpl && $baseModule != 'All') {
$docInfo = Settings_DataAccess_Module_Model::getDataAccessInfo($idTpl);
$viewer->assign('BASE_INFO', $docInfo['basic_info']);
for ($i = 0; $i < count($docInfo['required_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['required_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['required_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('REQUIRED_CONDITIONS', $docInfo['required_conditions']);
for ($i = 0; $i < count($docInfo['optional_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['optional_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['optional_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('OPTIONAL_CONDITIONS', $docInfo['optional_conditions']);
$viewer->assign('TPL_ID', $idTpl);
}
$viewer->assign('STEP', 2);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('REQUEST', $request);
$viewer->assign('SUMMARY', $request->get('summary'));
$viewer->assign('BASE_MODULE', $baseModule);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('FIELD_LIST', Settings_DataAccess_Module_Model::getListBaseModuleField($baseModule));
$viewer->assign('CONDITION_BY_TYPE', Settings_DataAccess_Module_Model::getConditionByType());
echo $viewer->view('Step2.tpl', $qualifiedModuleName, true);
}
示例13: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$qualifiedModuleName = $request->getModule(false);
$moduleName = $request->getModule();
$recordModel = Settings_Webforms_Record_Model::getInstanceById($recordId, $qualifiedModuleName);
$selectedFieldsList = $recordModel->getSelectedFieldsList('showForm');
foreach ($selectedFieldsList as $fieldName => $fieldModel) {
if (Settings_Webforms_Record_Model::isCustomField($fieldName)) {
$dataType = $fieldModel->getFieldDataType();
if ($dataType != 'picklist' && $dataType != 'multipicklist') {
$fieldModel->set('name', 'label:' . str_replace(' ', '_', $fieldModel->get('label')));
}
}
}
$action_path = vglobal('site_URL') . 'modules/Webforms/capture.php';
$captchaPath = vglobal('site_URL') . 'modules/Settings/Webforms/actions/CheckCaptcha.php';
$viewer = $this->getViewer($request);
$viewer->assign('RECORD_ID', $recordId);
$viewer->assign('RECORD_MODEL', $recordModel);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('SELECTED_FIELD_MODELS_LIST', $selectedFieldsList);
$viewer->assign('ACTION_PATH', $action_path);
$viewer->assign('CAPTCHA_PATH', $captchaPath);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
global $captchaConfig;
$viewer->assign('VTIGER_RECAPTCHA_PUBLIC_KEY', $captchaConfig['VTIGER_RECAPTCHA_PUBLIC_KEY']);
$viewer->view('ShowForm.tpl', $qualifiedModuleName);
}
示例14: process
public function process(Vtiger_Request $request)
{
$moduleSettingsName = $request->getModule(false);
$moduleName = $request->getModule();
$paymentsIn = array();
$record = Vtiger_Record_Model::getCleanInstance($moduleName);
$type = $request->get('type');
$bank = $request->get('bank');
$this->saveFile($_FILES);
$recordParse = $record->getSummary($type, $bank, $_FILES["file"]["name"]);
// only incomming records (C)
$i = 0;
$j = array();
foreach ($recordParse->operations as $transfers) {
foreach ($transfers as $key => $value) {
if ($key == 'indicator' && $value == 'C') {
$paymentsIn[] = $transfers;
}
if ($key == 'third_letter_currency_code') {
$j[] = $i;
}
}
$i++;
}
$json = json_encode($paymentsIn);
$viewer = $this->getViewer($request);
$viewer->assign('MODULENAME', $moduleName);
$viewer->assign('PAYMENTSIN', $paymentsIn);
$viewer->assign('COUNT', count($paymentsIn));
$viewer->assign('JSON', $json);
echo $viewer->view('step1.tpl', $moduleSettingsName, true);
}
示例15: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->get('record');
$roleName = $request->get('rolename');
$allowassignedrecordsto = $request->get('allowassignedrecordsto');
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
if (!empty($recordId)) {
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
} else {
$recordModel = new Settings_Roles_Record_Model();
}
if ($request->get('profile_directly_related_to_role') == '1') {
$profileId = $request->get('profile_directly_related_to_role_id');
$profileName = $request->get('profilename');
if (empty($profileName)) {
$profileName = $roleName . '+' . vtranslate('LBL_PROFILE', $qualifiedModuleName);
}
if ($profileId) {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceById($profileId);
} else {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceByName($profileName, true);
if (empty($profileRecordModel)) {
$profileRecordModel = new Settings_Profiles_Record_Model();
}
}
$profileRecordModel->set('directly_related_to_role', '1');
$profileRecordModel->set('profilename', $profileName)->set('profile_permissions', $request->get('permissions'));
$profileRecordModel->set('viewall', $request->get('viewall'));
$profileRecordModel->set('editall', $request->get('editall'));
$savedProfileId = $profileRecordModel->save();
$roleProfiles = array($savedProfileId);
} else {
$roleProfiles = $request->get('profiles');
}
$parentRoleId = $request->get('parent_roleid');
if ($recordModel && !empty($parentRoleId)) {
$parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId);
$recordModel->set('change_owner', $request->get('change_owner'))->set('searchunpriv', $request->get('searchunpriv'))->set('clendarallorecords', $request->get('clendarallorecords'));
if (!empty($allowassignedrecordsto)) {
$recordModel->set('allowassignedrecordsto', $allowassignedrecordsto);
}
// set the value of assigned records to
if ($parentRole && !empty($roleName) && !empty($roleProfiles)) {
$recordModel->set('rolename', $roleName);
$recordModel->set('profileIds', $roleProfiles);
$parentRole->addChildRole($recordModel);
}
//After role updation recreating user privilege files
if ($roleProfiles) {
foreach ($roleProfiles as $profileId) {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceById($profileId);
$profileRecordModel->recalculate(array($recordId));
}
}
}
$redirectUrl = $moduleModel->getDefaultUrl();
header("Location: {$redirectUrl}");
}