Add an 'emails to receive' option for email custom fields

master
Mike Koch 6 years ago
parent 2b089f3907
commit 904202488d
No known key found for this signature in database
GPG Key ID: 9DF46195699C8A67

@ -519,7 +519,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php echo $hesklang['email_custom_field_label']; ?>
</label>
<div class="col-sm-8">
<?php $address_type = empty($value['email_type']) ? 'none' : $value['email_type']; ?>
<?php
$address_type = empty($value['email_type']) ? 'none' : $value['email_type'];
?>
<div class="radio">
<label>
<input type="radio" name="email_type" value="none"
@ -541,8 +543,41 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php echo $hesklang['bcc']; ?>
</label>
</div>
<script>
$('input[name="email_type"]').change(function() {
if ($('input[name="email_type"]:checked').val() === 'none') {
$('#emails_to_receive').hide();
} else {
$('#emails_to_receive').show();
}
});
</script>
</div>
</div>
<div class="form-group" id="emails_to_receive" style="display: <?php if ($address_type === 'none') {echo 'none';} else {echo 'block';} ?>">
<label for="staff_or_customer" class="col-sm-4 control-label">
<?php echo $hesklang['emails_to_receive']; ?>
</label>
<div class="col-sm-8">
<?php
$emails_to_receive = empty($value['emails_to_receive']) ? array() : $value['emails_to_receive'];
?>
<div class="checkbox">
<label>
<input type="checkbox" name="emails_to_receive[]" value="STAFF"
<?php if (in_array('STAFF', $emails_to_receive)) {echo 'checked';} ?>>
<?php echo $hesklang['emails_sent_to_staff']; ?>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="emails_to_receive[]" value="CUSTOMER"
<?php if (in_array('CUSTOMER', $emails_to_receive)) {echo 'checked';} ?>>
<?php echo $hesklang['emails_sent_to_customer']; ?>
</label>
</div>
</div>
</div>
</div>
<div id="hidden" style="display:<?php echo ($type == 'hidden') ? 'block' : 'none' ?>">
@ -1250,7 +1285,8 @@ function cf_validate()
case 'email':
$cf['email_multi'] = hesk_POST('email_multi') ? 1 : 0;
$cf['email_type'] = hesk_POST('email_type', 'none');
$cf['value'] = array('multiple' => $cf['email_multi'], 'email_type' => $cf['email_type']);
$cf['emails_to_receive'] = $cf['email_type'] === 'none' ? array() : hesk_POST_array('emails_to_receive', array());
$cf['value'] = array('multiple' => $cf['email_multi'], 'email_type' => $cf['email_type'], 'emails_to_receive' => $cf['emails_to_receive']);
break;
case 'hidden':

@ -2239,6 +2239,9 @@ $hesklang['highlight_ticket_rows_based_on_priority'] = 'Highlight ticket rows ba
$hesklang['highlight_ticket_rows_based_on_priority_help'] = 'If enabled, each ticket on the tickets page will be highlighted based on priority. If disabled, only * Critical * and High priority tickets will be highlighted.';
$hesklang['highlight_ticket_rows_based_on_priority_descr'] = 'Highlight all ticket rows based on priority';
$hesklang['protected_group'] = 'This is a protected group; you cannot change accessible categories / features.';
$hesklang['emails_to_receive'] = 'Emails to receive';
$hesklang['emails_sent_to_staff'] = 'Emails sent to staff';
$hesklang['emails_sent_to_customer'] = 'Emails sent to customer';
// DO NOT CHANGE BELOW
if (!defined('IN_SCRIPT')) die('PHP syntax OK!');

Loading…
Cancel
Save