public static function GetMelody($name, $lang = 'EN', $fileId = 0) { $fileId = intval($fileId); $result = ''; if ($fileId > 0) { $res = CFile::GetFileArray($fileId); if ($res && $res['MODULE_ID'] == 'voximplant') { if (substr($res['SRC'], 0, 4) == 'http' || substr($res['SRC'], 0, 2) == '//') { $result = $res['SRC']; } else { $result = CVoxImplantHttp::GetServerAddress() . $res['SRC']; } } } if ($result == '') { $default = CVoxImplantConfig::GetDefaultMelodies($lang); $result = isset($default[$name]) ? $default[$name] : ''; } return $result; }
} $arResult = array("ERROR" => $error, "ITEM" => array_merge($arResult["ITEM"], $arFields), "QUEUE" => array_flip($queue["U"]), "SIP_CONFIG" => array_merge($arResult["SIP_CONFIG"], $arFieldsSip)); } foreach (array("MELODY_WELCOME", "MELODY_WAIT", "MELODY_HOLD", "MELODY_VOICEMAIL", "WORKTIME_DAYOFF_MELODY") as $id) { if ($arResult["ITEM"][$id] > 0) { $res = CFile::GetFileArray($arResult["ITEM"][$id]); if ($res) { $arResult["ITEM"]["~" . $id] = $res; } else { $arResult["ITEM"][$id] = 0; } } } $arResult["ITEM"]["MELODY_LANG"] = empty($arResult["ITEM"]["MELODY_LANG"]) ? strtoupper(LANGUAGE_ID) : $arResult["ITEM"]["MELODY_LANG"]; $arResult["ITEM"]["MELODY_LANG"] = in_array($arResult["ITEM"]["MELODY_LANG"], array("RU", "EN", "DE")) ? $arResult["ITEM"]["MELODY_LANG"] : "EN"; $arResult["DEFAULT_MELODIES"] = CVoxImplantConfig::GetDefaultMelodies(false); if (IsModuleInstalled('bitrix24')) { $arResult['LINK_TO_DOC'] = in_array(LANGUAGE_ID, array("ru", "kz", "ua", "by")) ? 'https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=52&CHAPTER_ID=02564' : 'https://www.bitrixsoft.com/support/training/course/index.php?COURSE_ID=55&LESSON_ID=6635'; } else { $arResult['LINK_TO_DOC'] = in_array(LANGUAGE_ID, array("ru", "kz", "ua", "by")) ? 'https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=48&CHAPTER_ID=02699' : 'https://www.bitrixsoft.com/support/training/course/index.php?COURSE_ID=26&LESSON_ID=6734'; } //for work time block $arResult["TIME_ZONE_ENABLED"] = CTimeZone::Enabled(); $arResult["TIME_ZONE_LIST"] = CTimeZone::GetZones(); if (empty($arResult["ITEM"]["WORKTIME_TIMEZONE"])) { if (LANGUAGE_ID == "ru") { $arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Moscow"; } elseif (LANGUAGE_ID == "de") { $arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Berlin"; } elseif (LANGUAGE_ID == "ua") { $arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Kiev";