Skip to content

Commit f0be885

Browse files
committed
Hide "add text in notification" check when custom_recipients setting is off
1 parent 88cf26e commit f0be885

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/Views/tickets/partials/comments/modal_new.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@
8686
</div>
8787
@endif
8888
@if ($u->currentLevel() > 1)
89-
<div class="form-row">
89+
<div class="form-row" @if(!$setting->grab('custom_recipients')) style="display: none" @endif>
9090
<div class="form-check">
91-
<label><input type="checkbox" id="add_in_user_notification_text" name="add_in_user_notification_text" value="yes"> {{ trans('panichd::lang.show-ticket-add-com-check-email-text') }}</label>
91+
<label><input type="checkbox" id="add_in_user_notification_text" name="add_in_user_notification_text" value="yes" @if(!$setting->grab('custom_recipients')) disabled="disabled" @endif> {{ trans('panichd::lang.show-ticket-add-com-check-email-text') }}</label>
9292
</div>
9393
</div>
9494

9595
@if ($u->canManageTicket($ticket->id))
96-
<div class="form-row">
97-
<div class="form-check" style="display: none;">
96+
<div class="form-row" style="display: none;">
97+
<div class="form-check">
9898
<label><input type="checkbox" id="add_to_intervention" name="add_to_intervention" value="yes" disabled> {{ trans('panichd::lang.show-ticket-add-com-check-intervention') }}</label>
9999
</div>
100100
</div>

src/Views/tickets/partials/comments/new_in_createedit_ticket_form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161

6262
<textarea style="display: none" rows="5" class="form-control jquery_level2_enable input_comment_text" name="comment_x" cols="50" disabled="disabled"></textarea>
6363
<div class="jquery_error_text"></div>
64-
<label class="mt-2"><input type="checkbox" class="input_comment_notification_text" name="comment_x_notification_text" value="yes"> {{ trans('panichd::lang.show-ticket-add-com-check-email-text') }}</label>
64+
<label class="mt-2" @if(!$setting->grab('custom_recipients')) style="display: none" @endif><input type="checkbox" class="input_comment_notification_text" name="comment_x_notification_text" value="yes" @if(!$setting->grab('custom_recipients')) disabled="disabled" @endif> {{ trans('panichd::lang.show-ticket-add-com-check-email-text') }}</label>
6565
</div>
6666
</div>

src/Views/tickets/partials/comments/new_in_createedit_ticket_scripts.blade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
@if($setting->grab('custom_recipients'))
4141
_block.find('.note_recipients').prop('disabled', true).select2('destroy').hide();
4242
_block.find('.reply_recipients').prop('disabled', false).show().select2();
43+
@else
44+
_block.find('.input_comment_notification_text').prop('disabled', false).closest('label').show();
4345
@endif
4446
}else{
4547
// Switch to internal note
@@ -51,6 +53,8 @@
5153
@if($setting->grab('custom_recipients'))
5254
_block.find('.reply_recipients').prop('disabled', true).select2('destroy').hide();
5355
_block.find('.note_recipients').prop('disabled', false).show().select2();
56+
@else
57+
_block.find('.input_comment_notification_text').prop('disabled', true).closest('label').hide();
5458
@endif
5559
}
5660
});

src/Views/tickets/partials/comments/scripts.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@
3131
if (type == 'reply'){
3232
$(this).closest('.comment-modal').find('#note_recipients').select2('destroy');
3333
$(this).closest('.comment-modal').find('#reply_recipients').select2();
34-
35-
$('#add_to_intervention').prop('disabled', false).closest('div').show();
34+
@if(!$setting->grab('custom_recipients'))
35+
$('#add_in_user_notification_text').prop('disabled', false).closest('.form-row').show();
36+
@endif
37+
$('#add_to_intervention').prop('disabled', false).closest('.form-row').show();
3638
}else{
3739
$(this).closest('.comment-modal').find('#reply_recipients').select2('destroy');
3840
$(this).closest('.comment-modal').find('#note_recipients').select2();
39-
40-
$('#add_to_intervention').prop('disabled', true).closest('div').hide();
41+
@if(!$setting->grab('custom_recipients'))
42+
$('#add_in_user_notification_text').prop('disabled', true).closest('.form-row').hide();
43+
@endif
44+
$('#add_to_intervention').prop('disabled', true).closest('.form-row').hide();
4145
}
4246
4347
var alt = type == 'note' ? 'reply' : 'note';

0 commit comments

Comments
 (0)