Browse Source

#126 Partial UI update for Mailgun

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
851da38297
  1. 17
      admin/admin_settings.php
  2. 9
      js/modsForHesk-javascript.js
  3. 2
      language/en/text.php

17
admin/admin_settings.php

@ -1299,11 +1299,13 @@ if ( defined('HESK_DEMO') )
<div class="form-group">
<label for="s_smtp" class="col-sm-3 control-label"><?php echo $hesklang['emlsend2']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>email.html#55','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<div class="col-sm-9">
<?php
$on = '';
$off = '';
$mailgunOn = '';
$onload_div = 'none';
$onload_mailgun = 'none';
$onload_status = '';
if ($hesk_settings['smtp'])
@ -1311,6 +1313,11 @@ if ( defined('HESK_DEMO') )
$on = 'checked="checked"';
$onload_div = 'block';
}
elseif ($modsForHesk_settings['use_mailgun'])
{
$mailgunOn = 'checked="checked"';
$onload_mailgun = 'block';
}
else
{
$off = 'checked="checked"';
@ -1318,8 +1325,9 @@ if ( defined('HESK_DEMO') )
}
echo '
<div class="radio"><label><input type="radio" name="s_smtp" value="0" onclick="hesk_attach_disable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'))" onchange="hesk_toggleLayerDisplay(\'smtp_settings\');" '.$off.' /> '.$hesklang['phpmail'].'</label></div>&nbsp;&nbsp;&nbsp;
<div class="radio"><label><input type="radio" name="s_smtp" value="1" onclick="hesk_attach_enable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'))" onchange="hesk_toggleLayerDisplay(\'smtp_settings\');" '.$on.' /> '.$hesklang['smtp'].'</label></div>';
<div class="radio"><label><input type="radio" name="s_smtp" value="0" onclick="hesk_attach_disable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([],[\'smtp_settings\',\'mailgun_settings\']);" '.$off.' /> '.$hesklang['phpmail'].'</label></div>
<div class="radio"><label><input type="radio" name="s_smtp" value="1" onclick="hesk_attach_enable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([\'smtp_settings\'],[\'mailgun_settings\']);" '.$on.' /> '.$hesklang['smtp'].'</label></div>
<div class="radio"><label><input type="radio" name="s_smtp" value="2" onclick="toggleContainers([\'mailgun_settings\'],[\'smtp_settings\']);" '.$mailgunOn.'>'.$hesklang['mailgun'].' <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="'.$hesklang['mailgun'].'" data-content="'.$hesklang['mailgun_help'].'"></i></label></div>';
?>
<input type="hidden" name="tmp_smtp_host_name" value="<?php echo $hesk_settings['smtp_host_name']; ?>" />
<input type="hidden" name="tmp_smtp_host_port" value="<?php echo $hesk_settings['smtp_host_port']; ?>" />
@ -1334,6 +1342,9 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div id="mailgun_settings" style="display:<?php echo $onload_mailgun; ?>">
<p>populate this!</p>
</div>
<div id="smtp_settings" style="display:<?php echo $onload_div; ?>">
<div class="form-group">
<label for="s_smtp_host_name" class="col-sm-3 control-label"><?php echo $hesklang['smtph']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>email.html#55','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>

9
js/modsForHesk-javascript.js

@ -57,4 +57,13 @@ function toggleChildrenForm(show) {
}
}
function toggleContainers(showIds, hideIds) {
showIds.forEach(function (entry) {
$('#' + entry).show();
});
hideIds.forEach(function (entry) {
$('#' + entry).hide();
});
}
jQuery(document).ready(loadJquery);

2
language/en/text.php

@ -33,6 +33,8 @@ $hesklang['email_custom_field_help'] = 'Allows the input of an email address. Si
$hesklang['email_custom_field_label'] = 'Address Type';
$hesklang['cc'] = 'Cc:';
$hesklang['bcc'] = 'Bcc:';
$hesklang['mailgun'] = 'Mailgun';
$hesklang['mailgun_help'] = 'Send mail using the Mailgun API. For more information on Mailgun, visit https://www.mailgun.com';
// ADDED OR MODIFIED IN Mods For HESK 1.7.0

Loading…
Cancel
Save