示例#1
0
<?php

define("STOP_STATISTICS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
$arReturn = array();
if (!CModule::IncludeModule('crm')) {
    $arReturn['ERROR'][] = GetMessage('CRM_PS_MODULE_NOT_INSTALLED');
}
if (!isset($arReturn['ERROR'])) {
    $CrmPerms = new CCrmPerms($USER->GetID());
    $bCrmWritePerm = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
    if ($USER->IsAuthorized() && check_bitrix_sessid() && $bCrmWritePerm) {
        $ID = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
        $personTypeId = isset($_REQUEST['person_type']) ? $_REQUEST['person_type'] : 0;
        $action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
        switch ($action) {
            case 'get_fields':
                $arReturn['FIELDS'] = CCrmPaySystem::getPSCorrespondence($ID);
                $arReturn['FIELDS_LIST'] = implode(',', array_keys($arReturn['FIELDS']));
                break;
        }
    } else {
        $arReturn['ERROR'][] = GetMessage('CRM_PS_ACCESS_DENIED');
    }
}
$arReturn = $APPLICATION->ConvertCharsetArray($arReturn, SITE_CHARSET, 'utf-8');
echo json_encode($arReturn);
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
示例#2
0
					</div>';
}

$arResult['FIELDS']['tab_props'][] = array(
	'id' => 'LOGOTIP',
	'name' => GetMessage('CRM_PS_FIELD_LOGOTIP'),
	'type' => 'custom',
	'value' => $logoHtml
);
*/
$io = CBXVirtualIo::GetInstance();
$arPaySys['ACTION']['ACTION_FILE'] = $io->ExtractNameFromPath($arPaySys['ACTION']['ACTION_FILE'] ? $arPaySys['ACTION']['ACTION_FILE'] : 'bill');
$arResult['FIELDS']['tab_props'][] = array('id' => 'ACTION_FILE', 'name' => GetMessage("CRM_PS_FIELD_ACTION_FILE"), 'type' => 'list', 'items' => CCrmPaySystem::getActionsList(), 'value' => $arPaySys['ACTION']['ACTION_FILE']);
$arResult['FIELDS']['tab_props'][] = array('id' => 'DETAILS', 'name' => GetMessage("CRM_PS_ACT_PROPERTIES"), 'type' => 'section');
$arResult['ACTION_FILE'] = $arPaySys['ACTION']['ACTION_FILE'];
$arResult['PS_ACT_FIELDS'] = CCrmPaySystem::getPSCorrespondence($arPaySys['ACTION']['ACTION_FILE']);
$arResult['ACTION_FIELDS_LIST'] = implode(',', array_keys($arResult['PS_ACT_FIELDS']));
$arResult['SIMPLE_MODE'] = CCrmPaySystem::isFormSimple();
$arResult['USER_FIELDS'] = array();
$quoteUserFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(CCrmQuote::$sUFEntityID, 0, LANGUAGE_ID);
foreach ($quoteUserFields as $quoteUserFieldName => &$quoteUserField) {
    $arResult['USER_FIELDS']['quote'][$quoteUserFieldName] = $quoteUserField['EDIT_FORM_LABEL'];
}
unset($quoteUserField);
$arPaySys['ACTION']['PARAMS'] = unserialize($arPaySys['ACTION']['PARAMS']);
foreach ($arResult['PS_ACT_FIELDS'] as $idCorr => $arCorr) {
    if ($arCorr['TYPE'] == 'SELECT') {
        $arCorr['OPTIONS'] = $arCorr['VALUE'];
    }
    if (isset($arPaySys['ACTION']['PARAMS'][$idCorr]) && isset($arPaySys['ACTION']['PARAMS'][$idCorr]['TYPE']) && isset($arPaySys['ACTION']['PARAMS'][$idCorr]['VALUE'])) {
        if ($arCorr['TYPE'] == 'FILE') {