Skip to content

Commit

Permalink
Play sound option per invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jun 11, 2021
1 parent 6f204ca commit 7a3debf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Expand Up @@ -57,6 +57,12 @@
</div>
</div>

<div class="col-12">
<div class="form-group">
<label><?php echo erLhcoreClassAbstract::renderInput('play_sound', $fields['play_sound'], $object)?> <?php echo $fields['play_sound']['trans'];?></label>
</div>
</div>

<div class="col-12">
<div class="form-group">
<label><?php echo $fields['message_width']['trans'];?></label>
Expand Down
Expand Up @@ -342,6 +342,14 @@
'hidden' => true,
'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')
),
'play_sound' => array(
'type' => 'checkbox',
'main_attr' => 'design_data_array',
'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Play sound'),
'required' => false,
'hidden' => true,
'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')
),
'append_bot' => array(
'type' => 'checkbox',
'main_attr' => 'design_data_array',
Expand Down
8 changes: 7 additions & 1 deletion lhc_web/modules/lhwidgetrestapi/getinvitation.php
Expand Up @@ -19,7 +19,7 @@
exit;
}

if (is_numeric($payload['invitation']) && $payload['invitation'] > 0/*&& ($onlineUser->invitation_id == 0 || $onlineUser->invitation_id != $payload['invitation'])*/) {
if (is_numeric($payload['invitation']) && $payload['invitation'] > 0) {
erLhAbstractModelProactiveChatInvitation::setInvitation($onlineUser, (int)$payload['invitation']);
}

Expand Down Expand Up @@ -164,6 +164,12 @@
$outputResponse['std_header'] = true;
}

if (isset($invitation->design_data_array['play_sound']) && $invitation->design_data_array['play_sound'] == true) {
$outputResponse['play_sound'] = true;
} else {
$outputResponse['play_sound'] = false;
}

$outputResponse['invitation_name'] = $invitation->name;
}

Expand Down

0 comments on commit 7a3debf

Please sign in to comment.