echo GetMessage('BIGDATA_ENABLED'); ?> <?php if (!$available) { ?> <div class="adm-c-bigdata-activate-content-task-list-warning"><span><?php echo GetMessage('BIGDATA_DISABLED'); ?> </span></div> <?php } ?> </li> <?php $installed = time() - Bitrix\Main\Config\Option::get('main', 'rcm_component_usage', 0) < 3600 * 24; ?> <li <?php echo $installed ? 'class="good"' : ''; ?> > <?php echo GetMessage('BIGDATA_INSTALLED'); ?> <?php if (!$installed) { ?> <div class="adm-c-bigdata-activate-content-task-list-warning"><span><?php echo GetMessage('BIGDATA_UNINSTALLED'); ?> </span></div>
echo Admin\OrderEdit::getFastNavigationHtml($fastNavItems); // yellow block with brief echo Admin\Blocks\OrderInfo::getView($saleOrder, $orderBasket); // Problem block if ($saleOrder->getField("MARKED") == "Y") { echo Admin\OrderEdit::getProblemBlockHtml($saleOrder->getField("REASON_MARKED")); } $aTabs = array(array("DIV" => "tab_order", "TAB" => Loc::getMessage("SALE_OVIEW_TAB_ORDER"), "TITLE" => Loc::getMessage("SALE_OVIEW_TAB_ORDER"), "SHOW_WRAP" => "N", "IS_DRAGGABLE" => "Y"), array("DIV" => "tab_history", "TAB" => Loc::getMessage("SALE_OVIEW_TAB_HISTORY"), "TITLE" => Loc::getMessage("SALE_OVIEW_TAB_HISTORY")), array("DIV" => "tab_analysis", "TAB" => Loc::getMessage("SALE_OVIEW_TAB_ANALYSIS"), "TITLE" => Loc::getMessage("SALE_OVIEW_TAB_ANALYSIS"))); $tabControl = new CAdminTabControlDrag($formId, $aTabs, $moduleId, false, true); $tabControl->Begin(); //TAB order -- $tabControl->BeginNextTab(); $blocksOrder = $tabControl->getCurrentTabBlocksOrder($defaultBlocksOrder); $statusOnPaid = Bitrix\Main\Config\Option::get('sale', 'status_on_paid'); $statusOnAllowDelivery = Bitrix\Main\Config\Option::get('sale', 'status_on_allow_delivery'); $statusOnPaid2AllowDelivery = Bitrix\Main\Config\Option::get('sale', 'status_on_payed_2_allow_delivery'); $autoChangeStatus = 'Y'; if (empty($statusOnPaid) && (empty($statusOnAllowDelivery) || empty($statusOnPaid2AllowDelivery))) { $autoChangeStatus = 'N'; } ?> <tr><td> <input type="hidden" id="ID" name="ID" value="<?php echo $ID; ?> "> <input type="hidden" id="SITE_ID" name="SITE_ID" value="<?php echo htmlspecialcharsbx($saleOrder->getSiteId()); ?> "> <input type="hidden" id="AUTO_CHANGE_STATUS_ON_PAID" name="AUTO_CHANGE_STATUS_ON_PAID" value="<?php
?> ?mid=<?php echo urlencode($module_id); ?> &lang=<?php echo LANGUAGE_ID; ?> "> <?php $o_tab->BeginNextTab(); foreach ($all_options as &$option) { $type = $option[2]; if ($option[0] == "group_ids") { $cur_opt_val = explode("|", Bitrix\Main\Config\Option::get($module_id, $option[0])); } else { $cur_opt_val = Bitrix\Main\Config\Option::get($module_id, $option[0]); } ?> <tr> <td width="40%" <?php if ($type == "textarea") { echo "class=\"adm-detail-valign-top\""; } ?> > <label for="<?php echo htmlspecialcharsbx($option[0]); ?> "><?php echo $option[1]; ?>
public static function AgentCountDayOrders() { global $DB; if (Bitrix\Main\Loader::includeModule("sale")) { //count orders $arFilter = array("STATUS_ID" => array("F", "P"), "PAYED" => "Y"); $dateFromTs = MakeTimeStamp(date("d", time() - 3600 * 24 * 2) . "." . date("m", time() - 3600 * 24 * 2) . "." . date("Y", time() - 3600 * 24 * 2) . " 23:59:59", "DD.MM.YYYY HH:MI:SS"); $dateToTs = MakeTimeStamp(date("d") . "." . date("m") . "." . date("Y") . " 00:00:00", "DD.MM.YYYY HH:MI:SS"); $arFilter[">DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateFromTs); $arFilter["<DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateToTs); $dbOrders = CSaleOrder::GetList(array(), $arFilter); $numOrders = $dbOrders->SelectedRowsCount(); $newNumOrders = array("newDay" => $numOrders); $curNumOrders = Bitrix\Main\Config\Option::get("storeassist", "num_orders", ""); if ($curNumOrders) { $curNumOrders = unserialize($curNumOrders); } $newNumOrders["prevDay"] = isset($curNumOrders["newDay"]) ? $curNumOrders["newDay"] : 0; Bitrix\Main\Config\Option::set("storeassist", "num_orders", serialize($newNumOrders), ""); //count progress $progress = Bitrix\Main\Config\Option::get("storeassist", "progress_percent", 0); $newProgress = 0; if ($newNumOrders["newDay"] >= $newNumOrders["prevDay"] && $newNumOrders["newDay"] > 0) { $newProgress = ++$progress > 10 ? 10 : $progress; } else { $newProgress = --$progress > 0 ? $progress : 0; } Bitrix\Main\Config\Option::set("storeassist", "progress_percent", $newProgress, ""); } return "CStoreAssist::AgentCountDayOrders();"; }
public static function CheckNumberForBlackList($number) { $blackListTime = Bitrix\Main\Config\Option::get("voximplant", "blacklist_time", 5); $blackListCount = Bitrix\Main\Config\Option::get("voximplant", "blacklist_count", 5); $minTime = new Bitrix\Main\Type\DateTime(); $minTime->add('-' . $blackListTime . ' minutes'); $dbData = VI\StatisticTable::getList(array('filter' => array("PHONE_NUMBER" => $number, '>CALL_START_DATE' => $minTime), 'select' => array('ID'))); $callsCount = 0; while ($dbData->fetch()) { $callsCount++; if ($callsCount >= $blackListCount) { $number = substr($number, 0, 20); VI\BlacklistTable::add(array("PHONE_NUMBER" => $number)); $messageUserId = Bitrix\Main\Config\Option::get("voximplant", "blacklist_user_id", ""); CVoxImplantHistory::SendMessageToChat($messageUserId, $number, CVoxImplantMain::CALL_INCOMING, GetMessage("BLACKLIST_NUMBER")); return true; } } return false; }
$newNumber = substr($_POST["BLACKLIST_NEW_NUMBER"], 0, 20); $newNumber = CVoxImplantPhone::Normalize($newNumber); if ($newNumber) { $dbBlacklist = Bitrix\Voximplant\BlacklistTable::getList(array("filter" => array("PHONE_NUMBER" => $newNumber))); if (!$dbBlacklist->Fetch()) { Bitrix\Voximplant\BlacklistTable::add(array("PHONE_NUMBER" => $newNumber)); } LocalRedirect(POST_FORM_ACTION_URI); } else { $arResult["ERROR"] = GetMessage("VI_BLACKLIST_NUMBER_ERROR"); } } if (isset($_POST["action"]) && $_POST["action"] == "delete_number") { $dbBlacklist = Bitrix\Voximplant\BlacklistTable::getList(array("filter" => array("PHONE_NUMBER" => $_POST["number"]))); if ($arBlacklist = $dbBlacklist->Fetch()) { Bitrix\Voximplant\BlacklistTable::delete($arBlacklist["ID"]); } $APPLICATION->RestartBuffer(); echo \Bitrix\Main\Web\Json::encode(array("success" => "Y")); die; } } $arResult["ITEMS"] = array(); $dbBlacklist = Bitrix\Voximplant\BlacklistTable::getList(); while ($arBlacklist = $dbBlacklist->Fetch()) { $arResult["ITEMS"][] = $arBlacklist; } $arResult["BLACKLIST_AUTO"] = Bitrix\Main\Config\Option::get("voximplant", "blacklist_auto", "N"); $arResult["BLACKLIST_TIME"] = intval(Bitrix\Main\Config\Option::get("voximplant", "blacklist_time", 5)); $arResult["BLACKLIST_COUNT"] = intval(Bitrix\Main\Config\Option::get("voximplant", "blacklist_count", 5)); $this->IncludeComponentTemplate();
?> <form method="post" action="<?php echo $APPLICATION->GetCurPage(); ?> ?mid=<?php echo urlencode($module_id); ?> &lang=<?php echo LANGUAGE_ID; ?> "> <?php $o_tab->BeginNextTab(); foreach ($all_options as $name => $desc) { $cur_opt_val = htmlspecialcharsbx(Bitrix\Main\Config\Option::get($module_id, $name)); $name = htmlspecialcharsbx($name); ?> <tr> <td width="40%"> <label for="<?php echo $name; ?> "><?php echo $desc; ?> :</label> </td> <td width="60%"> <?php if ($name == "set_automatic") {
foreach ($arBlock["MAIN_ITEMS"] as $itemCode => $arItem) { if (!$arItem["available"]) { continue; } ?> <li class="adm-s-setting-task <?php if (in_array($itemCode, $arStoreAssistOption)) { ?> complited<?php } ?> "> <?php switch ($itemCode) { case "support_developer": $partnerName = Bitrix\Main\Config\Option::get("storeassist", "partner_name", ""); $message = htmlspecialcharsbx(GetMessage("STOREAS_ITEMS_" . $itemCode, array("#NAME#" => $partnerName ? "\"" . $partnerName . "\"" : ""))); ?> <a href="<?php echo $arItem["path"]; ?> " title="<?php echo $message; ?> " onclick="BX.Storeassist.Admin.setOption('<?php echo CUtil::JSEscape($itemCode); ?> ', 'Y')" target="_blank"> <span><?php echo $message; ?>
CVoxImplantHistory::WriteToLog($params, 'PORTAL ADD HISTORY'); if (isset($params['PORTAL_NUMBER']) && isset($params['ACCOUNT_SEARCH_ID'])) { $params['PORTAL_NUMBER'] = $params['ACCOUNT_SEARCH_ID']; } CVoxImplantHistory::Add($params); $ViAccount = new CVoxImplantAccount(); $ViAccount->SetAccountBalance($params["balance"]); echo "200 OK"; } elseif ($params["COMMAND"] == "IncomingGetConfig") { $result = CVoxImplantIncoming::GetConfigBySearchId($params['PHONE_NUMBER']); CVoxImplantHistory::WriteToLog($result, 'PORTAL GET INCOMING CONFIG'); if ($result['ID']) { $result = CVoxImplantIncoming::RegisterCall($result, $params); } $isNumberInBlacklist = CVoxImplantIncoming::IsNumberInBlackList($params["CALLER_ID"]); $isBlacklistAutoEnable = Bitrix\Main\Config\Option::get("voximplant", "blacklist_auto", "N") == "Y"; if ($result["WORKTIME_SKIP_CALL"] == "Y" && !$isNumberInBlacklist && $isBlacklistAutoEnable) { $isNumberInBlacklist = CVoxImplantIncoming::CheckNumberForBlackList($params["CALLER_ID"]); } if ($isNumberInBlacklist) { $result["NUMBER_IN_BLACKLIST"] = "Y"; } if (!CVoxImplantAccount::IsPro()) { $result["CRM_SOURCE"] = 'CALL'; $result["CALL_VOTE"] = 'N'; if ($result["QUEUE_TYPE"] == CVoxImplantConfig::QUEUE_TYPE_ALL) { $result["QUEUE_TYPE"] = CVoxImplantConfig::QUEUE_TYPE_EVENLY; $result["NO_ANSWER_RULE"] = CVoxImplantIncoming::RULE_VOICEMAIL; } } foreach (GetModuleEvents("voximplant", "onCallInit", true) as $arEvent) {