$personTypes[$personType['ID']] = $personType; } ?> <select name="filter_pay_system[]" multiple size="3"> <option value=""><?php echo GetMessage("SALE_F_ALL"); ?> </option> <?php $res = \Bitrix\Sale\PaySystem\Manager::getList(array('select' => array('ID', 'NAME'), 'filter' => array('ACTIVE' => 'Y'), 'order' => array("SORT" => "ASC", "NAME" => "ASC"))); $paySystemList = array(); while ($paySystem = $res->fetch()) { $paySystemList[$paySystem['ID']]['NAME'] = $paySystem['NAME']; } if ($paySystemList) { $dbRestRes = Sale\Services\PaySystem\Restrictions\Manager::getList(array('select' => array('SERVICE_ID', 'PARAMS'), 'filter' => array('=CLASS_NAME' => '\\Bitrix\\Sale\\Services\\PaySystem\\Restrictions\\PersonType', 'SERVICE_ID' => array_keys($paySystemList)))); while ($ptParams = $dbRestRes->fetch()) { $paySystemList[$ptParams['SERVICE_ID']]['PERSON_TYPE_ID'] = $ptParams['PARAMS']['PERSON_TYPE_ID']; } foreach ($paySystemList as $psId => $paySystem) { $personTypeString = ''; if ($paySystem['PERSON_TYPE_ID']) { $psPt = array(); foreach ($paySystem['PERSON_TYPE_ID'] as $ptId) { $psPt[] = (strlen($personTypes[$ptId]['NAME']) > 15 ? substr($personTypes[$ptId]['NAME'], 0, 6) . "..." . substr($personTypes[$ptId]['NAME'], -7) : $personTypes[$ptId]['NAME']) . "/" . $personTypes[$ptId]["LID"] . ""; } if ($psPt) { $personTypeString = ' (' . join(', ', $psPt) . ')'; } } ?>
$result = PaySystemActionTable::add($fields); if (!$result->isSuccess()) { $errorMessage .= join(',', $result->getErrorMessages()); } else { $id = $result->getId(); if ($id > 0) { $fields = array('PARAMS' => serialize(array('BX_PAY_SYSTEM_ID' => $id)), 'PAY_SYSTEM_ID' => $id); $result = PaySystemActionTable::update($id, $fields); if (!$result->isSuccess()) { $errorMessage .= join(',', $result->getErrorMessages()); } $service = PaySystem\Manager::getObjectById($id); $currency = $service->getCurrency(); if ($currency) { $params = array('SERVICE_ID' => $id, 'SERVICE_TYPE' => Restrictions\Manager::SERVICE_TYPE_PAYMENT, 'PARAMS' => array('CURRENCY' => $currency)); Restrictions\Manager::getClassesList(); $saveResult = \Bitrix\Sale\Services\PaySystem\Restrictions\Currency::save($params); if (!$saveResult->isSuccess()) { $errorMessage .= Loc::getMessage('SALE_PSE_ERROR_RSRT_CURRENCY_SAVE'); } } } } } if ($errorMessage === '') { if ($isConsumerChange) { $priorActionFile = $request->get('PRIOR_ACTION_FILE'); if (empty($priorActionFile)) { BusinessValue::addConsumer('PAYSYSTEM_NEW', $data); } else { BusinessValue::changeConsumer('PAYSYSTEM_' . $id, $data);
} foreach ($ids as $id) { if ((int) $id <= 0) { continue; } switch ($_REQUEST['action']) { case "delete": $dbRes = \Bitrix\Sale\Internals\PaymentTable::getList(array('filter' => array('PAY_SYSTEM_ID' => $id))); if ($dbRes->fetch()) { $lAdmin->AddGroupError(Loc::getMessage("SALE_DELETE_ERROR"), $id); continue; } $restrictionList = \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::getRestrictionsList($id); if ($restrictionList) { // init restrictions \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::getClassesList(); foreach ($restrictionList as $restriction) { $restriction["CLASS_NAME"]::delete($restriction['ID'], $id); } } $result = Bitrix\Sale\Internals\PaySystemActionTable::delete($id); if (!$result->isSuccess()) { if ($result->getErrorMessages()) { $lAdmin->AddGroupError(join(', ', $result->getErrorMessages()), $id); } else { $lAdmin->AddGroupError(GetMessage("SPSAN_ERROR_DELETE"), $id); } } break; case "activate": case "deactivate":