5use \Bitrix\Main\Localization\Loc;
6Loc::loadMessages(__FILE__);
8use \Bitrix\Main\ArgumentNullException;
24 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a list -o json");
25 $jsonData = $shellAdapter->getLastOutput();
29 $arData = json_decode($jsonData,
true);
31 if(isset($arData[
"params"]) && isset($arData[
"params"][
"providers"]) && is_array($arData[
"params"][
"providers"]))
32 $result = $arData[
"params"][
"providers"];
36 foreach(
$params[
"filter"] as $filterKey => $filterValue)
38 foreach(
$result as $providerId => $providerParams)
40 if(!array_key_exists($filterKey, $providerParams) || $providerParams[$filterKey] != $filterValue)
60 if($providerId ==
'' )
66 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a status --provider ".$providerId.
" -o json");
67 $jsonData = $shellAdapter->getLastOutput();
71 $arData = json_decode($jsonData,
true);
73 if(isset($arData[
"params"][
"provider_options"][$providerId]) && is_array($arData[
"params"][
"provider_options"][$providerId]))
74 $result = $arData[
"params"][
"provider_options"][$providerId];
87 if($providerId ==
'' )
92 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a configs --provider ".$providerId.
" -o json");
93 $jsonData = $shellAdapter->getLastOutput();
97 $arData = json_decode($jsonData,
true);
99 if(isset($arData[
"params"][
"provider_configs"][$providerId][
"configurations"]) && is_array($arData[
"params"][
"provider_configs"][$providerId][
"configurations"]))
100 $result = $arData[
"params"][
"provider_configs"][$providerId][
"configurations"];
112 public static function sendOrder($providerId, $configId)
114 if($providerId ==
'' )
122 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a order --provider ".$providerId.
" --config_id ".$configId.
" -o json");
123 $jsonData = $shellAdapter->getLastOutput();
127 $arData = json_decode($jsonData,
true);
129 if(isset($arData[
"params"][
"provider_order"][$providerId][
"task_id"]))
130 $result = $arData[
"params"][
"provider_order"][$providerId][
"task_id"];
136 $description = Loc::getMessage(
"SCALE_PROVIDER_SEND_ORDER_SUCCESS");
141 $description = Loc::getMessage(
"SCALE_PROVIDER_SEND_ORDER_ERROR");
145 array(
"##PROVIDER##",
"##CONFIG_ID##",
"##ORDER_ID##"),
152 "SCALE_PROVIDER_SEND_ORDER",
153 $providerId.
"::".$configId,
168 if($providerId ==
'' )
176 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a order_status --provider ".$providerId.
" --task_id ".$taskId.
" -o json");
177 $jsonData = $shellAdapter->getLastOutput();
181 $arData = json_decode($jsonData,
true);
183 if(isset($arData[
"params"][
"provider_order"][$providerId]))
184 $result = $arData[
"params"][
"provider_order"][$providerId];
199 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a orders_list".($providerId <>
'' ?
" --provider ".$providerId :
"").
" -o json");
200 $jsonData = $shellAdapter->getLastOutput();
204 $arData = json_decode($jsonData,
true);
206 if(isset($arData[
"params"][
"provider_order_list"]))
207 $result = $arData[
"params"][
"provider_order_list"];
222 if($providerId ==
'' )
230 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-provider -a order_to_host --provider ".$providerId.
" --task_id ".$taskId.
" -o json");
231 $jsonData = $shellAdapter->getLastOutput();
235 $result = json_decode($jsonData,
true);
static addRecord($level, $auditType, $itemId, $description)
static getStatus($providerId)
static getConfigs($providerId)
static addToPullFromOrder($providerId, $taskId)
static getOrdersList($providerId="")
static getList($params=array())
static sendOrder($providerId, $configId)
static getOrderStatus($providerId, $taskId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']