76 if ($this->configuration->hasOptions())
81 $this->configuration->setArrayOptions(array(
84 'code' =>
'OUTPUT_NUMBER',
85 'name' =>
Loc::getMessage(
'SENDER_INTEGRATION_CALL_MESSAGE_CONFIG_OUTPUT_NUMBER'),
86 'items' => \CVoxImplantConfig::GetPortalNumbers(
false),
90 $GLOBALS[
'APPLICATION']->includeComponent(
91 "bitrix:sender.call.number",
"",
93 "INPUT_NAME" =>
"%INPUT_NAME%",
94 "VALUE" =>
"%INPUT_VALUE%",
95 "MESSAGE_TYPE" => $this->
getCode()
98 return ob_get_clean();
101 'show_in_list' =>
true,
102 'readonly_view' =>
function($value)
109 'code' =>
'MESSAGE_TEXT',
110 'name' =>
Loc::getMessage(
'SENDER_INTEGRATION_CALL_MESSAGE_CONFIG_MESSAGE_TEXT'),
115 'code' =>
'VOICE_LANGUAGE',
116 'name' =>
Loc::getMessage(
'SENDER_INTEGRATION_CALL_MESSAGE_CONFIG_VOICE_LANGUAGE'),
117 'items' => Tts\Language::getList(),
119 'group' => Message\ConfigurationOption::GROUP_ADDITIONAL,
123 'code' =>
'VOICE_SPEED',
124 'name' =>
Loc::getMessage(
'SENDER_INTEGRATION_CALL_MESSAGE_CONFIG_VOICE_SPEED'),
125 'items' => Tts\Speed::getList(),
127 'group' => Message\ConfigurationOption::GROUP_ADDITIONAL,
131 'code' =>
'VOICE_VOLUME',
132 'name' =>
Loc::getMessage(
'SENDER_INTEGRATION_CALL_MESSAGE_CONFIG_VOICE_VOLUME'),
133 'items' => Tts\Volume::getList(),
135 'group' => Message\ConfigurationOption::GROUP_ADDITIONAL,
139 TimeLimiter::prepareMessageConfiguration($this->configuration);
152 Entity\Message::create()
154 ->loadConfiguration($id, $this->configuration);
156 $defaultValues = array(
157 'VOICE_VOLUME' => Tts\Volume::getDefault(),
158 'VOICE_SPEED' => Tts\Speed::getDefault(),
159 'VOICE_LANGUAGE' => Tts\Language::getDefaultVoice(LANGUAGE_ID),
161 foreach ($defaultValues as $key => $value)
163 $option = $this->configuration->getOption($key);
164 if (!$option || $option->hasValue())
169 $option->setValue($value);
172 $textOption = $this->configuration->getOption(
'MESSAGE_TEXT');
175 $speedOption = $this->configuration->getOption(
'VOICE_SPEED');
176 $textOption->setView(
177 function () use ($speedOption)
180 $GLOBALS[
'APPLICATION']->includeComponent(
181 "bitrix:sender.call.text.editor",
184 "INPUT_NAME" =>
"%INPUT_NAME%",
185 "VALUE" =>
"%INPUT_VALUE%",
186 "SPEED_INPUT_NAME" => $speedOption
188 "%INPUT_NAME_" . $speedOption->getCode() .
"%"
194 return ob_get_clean();
198 TimeLimiter::prepareMessageConfigurationView($this->configuration);