02d19217 by Jeff Balicki

dd

1 parent d7eef400
......@@ -3,26 +3,27 @@ use Tz\WordPress\Tools;
use Tz\WordPress\Tools\Notifications;
use Tz\WordPress\Tools\Notifications\Settings;
function getInputFormValues($validation, $name) {
function getInputFormValues($validation, $name)
{
return ($validation->set_value($name) != '') ? $validation->set_value($name) : (!empty($_POST[$name])) ? $_POST[$name] : '';
}
?>
<link rel="stylesheet" href="<?php echo Tools\url('assets/css/notifications.css', __FILE__) ?>"/>
<link rel="stylesheet" href="<?php echo Tools\url('assets/css/notifications.css', __FILE__) ?>" />
<div class="wrap">
<h2>Notifications - Create New</h2>
<?php if (isset($flash) && $flash != ''): ?>
<?php if (isset($flash) && $flash != '') : ?>
<div class="post-success">
<?php echo $flash; ?>
</div>
<?php endif; ?>
<?php if ($validation->validation_errors() != "" || isset($form_error)): ?>
<?php if ($validation->validation_errors() != "" || isset($form_error)) : ?>
<div class="post-errors">
<div class="post-errors-title"><strong>Oops.</strong> There was an error saving your notification.</div>
<?php if (isset($form_error)): ?>
<?php if (isset($form_error)) : ?>
<p class="post-errors-content">You must include either an Email, System or SMS message.</p>
<?php endif; ?>
</div>
......@@ -30,7 +31,7 @@ function getInputFormValues($validation, $name) {
<form enctype="multipart/form-data" method="post" id="notifications-create-new" action="/wp-admin/admin.php?page=notifications-create-new">
<input type="hidden" name="_POSTED_" value="yes"/>
<input type="hidden" name="_POSTED_" value="yes" />
<table cellspacing="0" class="widefat post fixed" style="margin-top:15px;">
<thead>
......@@ -43,17 +44,16 @@ function getInputFormValues($validation, $name) {
<tr>
<td width="150">Notification Type</td>
<td>
<select name="type" id="notif_type" class="wide-input-field"
onchange="updateNotificationType();">
<select name="type" id="notif_type" class="wide-input-field" onchange="updateNotificationType();">
<option value="scheduled" <?php echo ($validation->set_value('type') == "scheduled" || $_POST['type'] == 'scheduled')
? 'selected="selected"' : ""; ?>>Scheduled Notification
? 'selected="selected"' : ""; ?>>Scheduled Notification
</option>
<option value="newsletter" <?php echo ($validation->set_value('type') == "newsletter" || $_POST['type'] == 'newsletter')
? 'selected="selected"' : ""; ?>>Newsletter
<option value="newsletter" <?php echo ($validation->set_value('type') == "newsletter" || $_POST['type'] == 'newsletter')
? 'selected="selected"' : ""; ?>>Newsletter
</option>
<?php if (current_user_can(Settings\MANAGE_SYSTEM_NOTIFICATIONS)): ?>
<?php if (current_user_can(Settings\MANAGE_SYSTEM_NOTIFICATIONS)) : ?>
<option value="triggered" <?php echo ($validation->set_value('type') == "triggered" || $_POST['type'] == 'triggered')
? 'selected="selected"' : ""; ?>>System Triggered Notification
? 'selected="selected"' : ""; ?>>System Triggered Notification
</option>
<?php endif; ?>
</select>
......@@ -62,8 +62,7 @@ function getInputFormValues($validation, $name) {
</tr>
<tr>
<td width="150">Notification Description</td>
<td><input type="text" name="title" class="wide-input-field"
value="<?php echo getInputFormValues($validation, 'title'); ?>"/>
<td><input type="text" name="title" class="wide-input-field" value="<?php echo getInputFormValues($validation, 'title'); ?>" />
<?php echo $validation->form_error('title'); ?>
</td>
</tr>
......@@ -72,17 +71,17 @@ function getInputFormValues($validation, $name) {
<td>
<select name="sendto" class="wide-input-field">
<option value="nousers" <?php echo ($validation->set_value('sendto') == "nousers")
? 'selected="selected"' : ""; ?>>No Users
? 'selected="selected"' : ""; ?>>No Users
</option>
<option value="allusers" <?php echo ($validation->set_value('sendto') == "allusers")
? 'selected="selected"' : ""; ?>>All Users
? 'selected="selected"' : ""; ?>>All Users
</option>
<optgroup label="By Group:">
<?php foreach (Notifications\getGroups() as $group_id => $group_name): ?>
<option value="<?php echo $group_id ?>" <?php echo ($validation->set_value(
'sendto'
) == $group_id) ? 'selected="selected"'
: ""; ?>><?php echo $group_name; ?></option>
<?php foreach (Notifications\getGroups() as $group_id => $group_name) : ?>
<option value="<?php echo $group_id ?>" <?php echo ($validation->set_value(
'sendto'
) == $group_id) ? 'selected="selected"'
: ""; ?>><?php echo $group_name; ?></option>
<?php endforeach; ?>
</optgroup>
</select>
......@@ -92,14 +91,12 @@ function getInputFormValues($validation, $name) {
<tr class="scheduled-extended">
<td>Execute Date / Time</td>
<td><input type="text" name="execute_date" id="execute_date" class="wide-input-field date-pick"
readonly="readonly" value="<?php echo getInputFormValues($validation, 'execute_date'); ?>"/><?php echo $validation->form_error('execute_date'); ?></td>
<td><input type="text" name="execute_date" id="execute_date" class="wide-input-field date-pick" readonly="readonly" value="<?php echo getInputFormValues($validation, 'execute_date'); ?>" /><?php echo $validation->form_error('execute_date'); ?></td>
</tr>
<tr class="trigger-extended">
<td>Trigger</td>
<td><input type="text" name="trigger" id="trigger" class="wide-input-field"
value="<?php echo getInputFormValues($validation, 'trigger'); ?>"/>
<td><input type="text" name="trigger" id="trigger" class="wide-input-field" value="<?php echo getInputFormValues($validation, 'trigger'); ?>" />
<?php echo $validation->form_error('trigger'); ?></td>
</tr>
......@@ -116,165 +113,164 @@ function getInputFormValues($validation, $name) {
</li>
</ul>
<?php foreach (['en', 'fr'] as $index => $lang): ?>
<?php foreach (['en', 'fr'] as $index => $lang) : ?>
<div id="tab-<?php echo $index + 1; ?>">
<table cellspacing="0" class="widefat post fixed expandable" style="margin-top: 15px;">
<thead>
<tr>
<th width="150" class="toggle"><h6>Email</h6></th>
<th class="action-bar">&nbsp;</th>
</tr>
<tr>
<th width="150" class="toggle">
<h6>Email</h6>
</th>
<th class="action-bar">&nbsp;</th>
</tr>
</thead>
<tbody style="<?php echo (getInputFormValues($validation, $lang . '_subject')) ||
getInputFormValues($validation, $lang . '_text') ||
getInputFormValues($validation, $lang . '_html') ? '' : 'display: none;'; ?>;">
<tr>
<td width="150">Subject Line</td>
<td>
<input type="text" name="<?php echo $lang; ?>_subject"
class="wide-input-field" style="width: 100%;"
value="<?php echo getInputFormValues($validation, $lang . '_subject'); ?>"/>
<?php echo $validation->form_error($lang.'_subject'); ?>
</td>
</tr>
<tr class="text_verson">
<td>Text Version</td>
<td>
<textarea name="<?php echo $lang; ?>_text"
class="wide-input-field text_verson" rows="10"
style="width: 100%;"><?php echo getInputFormValues($validation, $lang . '_text'); ?>
</textarea><?php echo $validation->form_error($lang.'_text'); ?>
</td>
</tr>
<tr>
<td>HTML Version (optional)</td>
<td>
<?php
$content = getInputFormValues($validation, $lang . '_html');
$settings = array('textarea_name' => $lang.'_html' , "media_buttons" => true );
wp_editor($content, $lang .'_html', $settings );
?><?php echo $validation->form_error($lang.'_html'); ?>
</td>
</tr>
<tr class="attachments">
<td width="150">Attachments</td>
<td>&nbsp;</td>
</tr>
<?php
$attachments = $entry->email[$lang.'_attachments'];
$allowedAttachments = 3;
foreach ($attachments as $attachment): ?>
getInputFormValues($validation, $lang . '_text') ||
getInputFormValues($validation, $lang . '_html') ? '' : 'display: none;'; ?>;">
<tr>
<td>&nbsp;</td>
<td width="150">Subject Line</td>
<td>
<?php echo $attachment; ?> &nbsp; (<a href="#"
entry_id="<?php echo $_GET['page_id'] ?>"
class="attachment"
rel="<?php echo $attachment; ?>">remove</a>)
<input type="text" name="<?php echo $lang; ?>_subject" class="wide-input-field" style="width: 100%;" value="<?php echo getInputFormValues($validation, $lang . '_subject'); ?>" />
<?php echo $validation->form_error($lang . '_subject'); ?>
</td>
</tr>
<tr class="text_verson">
<td>Text Version</td>
<td>
<textarea name="<?php echo $lang; ?>_text" class="wide-input-field text_verson" rows="10" style="width: 100%;"><?php echo getInputFormValues($validation, $lang . '_text'); ?>
</textarea><?php echo $validation->form_error($lang . '_text'); ?>
</td>
</tr>
<tr>
<td>HTML Version (optional)</td>
<td>
<?php
$content = getInputFormValues($validation, $lang . '_html');
$settings = array('textarea_name' => $lang . '_html', "media_buttons" => true);
wp_editor($content, $lang . '_html', $settings);
?><?php echo $validation->form_error($lang . '_html'); ?>
</td>
</tr>
<?php
$allowedAttachments--;
endforeach;
?>
<?php for ($a = 1; $a <= $allowedAttachments; $a++): ?>
<tr class="attachments">
<tr class="attachments">
<td width="150">Attachments</td>
<td>&nbsp;</td>
<td><input type="file" name="<?php echo $lang; ?>_attachment[]"/></td>
</tr>
<?php endfor; ?>
<?php
$attachments = $entry->email[$lang . '_attachments'];
$allowedAttachments = 3;
foreach ($attachments as $attachment) : ?>
<tr>
<td>&nbsp;</td>
<td>
<?php echo $attachment; ?> &nbsp; (<a href="#" entry_id="<?php echo $_GET['page_id'] ?>" class="attachment" rel="<?php echo $attachment; ?>">remove</a>)
</td>
</tr>
<?php
$allowedAttachments--;
endforeach;
?>
<?php for ($a = 1; $a <= $allowedAttachments; $a++) : ?>
<tr class="attachments">
<td>&nbsp;</td>
<td><input type="file" name="<?php echo $lang; ?>_attachment[]" /></td>
</tr>
<?php endfor; ?>
</tbody>
</table>
<table cellspacing="0" class="widefat post fixed expandable" style="margin-top: 15px;">
<thead>
<tr>
<th width="150" class="toggle"><h6>System Message</h6></th>
<th class="action-bar">&nbsp;</th>
</tr>
<tr>
<th width="150" class="toggle">
<h6>System Message</h6>
</th>
<th class="action-bar">&nbsp;</th>
</tr>
</thead>
<tbody style="<?php echo ($validation->set_value(
$lang.'_system',
$entry->system[$lang.'_message']
) == '')
? 'display: none'
: ''; ?>;">
<tr>
<td>Message Type</td>
<td>
<?php if ($lang == 'en'): ?>
<select name="system_message_type" class="wide-input-field">
<option value="none" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'none') ? 'selected="selected"' : ''; ?>>
General Message
</option>
<option value="action_required" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'action_required') ? 'selected="selected"' : ''; ?>>
Action Required
</option>
<option value="e-flash" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'e-flash') ? 'selected="selected"' : ''; ?>>
E-Flash
</option>
<option value="new_event" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'new_event') ? 'selected="selected"' : ''; ?>>
New Event
</option>
</select>
<?php else: ?>
<span class="system_message_type_value"></span>
<?php endif; ?>
</td>
</tr>
<tr>
<td>Message (Text/HTML)</td>
<td>
<textarea name="<?php echo $lang; ?>_system" class="wide-input-field" rows="4"
style="width:100%;"><?php echo $validation->set_value(
$lang.'_system',
isset($entry->system[$lang.'_message'])
? $entry->system[$lang.'_message']
: ''
); ?></textarea><?php echo $validation->form_error($lang.'_system'); ?>
</td>
</tr>
$lang . '_system',
$entry->system[$lang . '_message']
) == '')
? 'display: none'
: ''; ?>;">
<tr>
<td>Message Type</td>
<td>
<?php if ($lang == 'en') : ?>
<select name="system_message_type" class="wide-input-field">
<option value="none" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'none') ? 'selected="selected"' : ''; ?>>
General Message
</option>
<option value="action_required" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'action_required') ? 'selected="selected"' : ''; ?>>
Action Required
</option>
<option value="e-flash" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'e-flash') ? 'selected="selected"' : ''; ?>>
E-Flash
</option>
<option value="new_event" <?php echo ($validation->set_value(
'system_message_type',
$entry->system['system_message_type']
) == 'new_event') ? 'selected="selected"' : ''; ?>>
New Event
</option>
</select>
<?php else : ?>
<span class="system_message_type_value"></span>
<?php endif; ?>
</td>
</tr>
<tr>
<td>Message (Text/HTML)</td>
<td>
<textarea name="<?php echo $lang; ?>_system" class="wide-input-field" rows="4" style="width:100%;"><?php echo $validation->set_value(
$lang . '_system',
isset($entry->system[$lang . '_message'])
? $entry->system[$lang . '_message']
: ''
); ?></textarea><?php echo $validation->form_error($lang . '_system'); ?>
</td>
</tr>
</tbody>
</table>
<table cellspacing="0" class="widefat post fixed expandable" style="margin-top: 15px;">
<thead>
<tr>
<th width="150" class="toggle"><h6>Push Notification</h6></th>
<th width="300" class="action-bar">&nbsp;</th>
<th width="150">&nbsp;</th>
</tr>
<tr>
<th width="150" class="toggle">
<h6>Push Notification</h6>
</th>
<th width="300" class="action-bar">&nbsp;</th>
<th width="150">&nbsp;</th>
</tr>
</thead>
<tbody style="background-color: #f5f5f5; display: none;">
<tr class="package-row" style="vertical-align:top;width: 100% !important;background-color: #f5f5f5;">
<td style="background-color: #f5f5f5;width:20%">Time<br/><input style="width:100%;" id="time'" type="text" name="<?php echo $lang; ?>_push_notifications_time" value="" />
<br class="morespace"/>Title<br/><input type="text" style="width:100%;" name="<?php echo $lang; ?>_push_notifications_title" value="" /></td>
<td style="background-color: #f5f5f5; width:50%;">Message<br/><textarea style="width: 100%;" name="<?php echo $lang; ?>_push_notifications_message" rows="4" cols="50" ></textarea></td>
<td style="background-color: #f5f5f5;width:20%">Link<br/><input style="width:100%;" type="text" name="<?php echo $lang; ?>_push_notifications_link" value="" /><br/>
<input type="hidden" name="<?php echo $lang; ?>_push_notifications_status" value="pending" /><input type="hidden" name="<?php echo $lang; ?>_push_notifications_id" value="" /></p></td>
</tr>
<?php echo $validation->form_error($lang.'_push'); ?>
</tbody>
</table>
<tr class="package-row" style="vertical-align:top;width: 100% !important;background-color: #f5f5f5;">
<td style="background-color: #f5f5f5;width:20%">Time<br /><input style="width:100%;" id="time'" type="text" name="<?php echo $lang; ?>_push_notifications_time" value="" />
<br class="morespace" />Title<br /><input type="text" style="width:100%;" name="<?php echo $lang; ?>_push_notifications_title" value="" /></td>
<td style="background-color: #f5f5f5; width:50%;">Message<br /><textarea style="width: 100%;" name="<?php echo $lang; ?>_push_notifications_message" rows="4" cols="50"></textarea></td>
<td style="background-color: #f5f5f5;width:20%">Link<br /><input style="width:100%;" type="text" name="<?php echo $lang; ?>_push_notifications_link" value="" /><br />
<input type="hidden" name="<?php echo $lang; ?>_push_notifications_status" value="pending" /><input type="hidden" name="<?php echo $lang; ?>_push_notifications_id" value="" /></p>
</td>
</tr>
<?php echo $validation->form_error($lang . '_push'); ?>
</tbody>
</table>
......@@ -282,66 +278,65 @@ function getInputFormValues($validation, $name) {
<?php endforeach; ?>
</div>
<p>
<input type="submit" value=" Save "/>
<input type="button" value=" Cancel "
onclick="document.location.href='/wp-admin/admin.php?page=notifications';"/>
<input type="submit" value=" Save " />
<input type="button" value=" Cancel " onclick="document.location.href='/wp-admin/admin.php?page=notifications';" />
</p>
</form>
</div>
<script>
jQuery(document).ready(function ($) {
jQuery(document).ready(function($) {
var codeCleaned = false;
$("#notifications-create-new").on("submit", function(e){
if (!codeCleaned) {
e.preventDefault();
$('#fr_html_ifr').contents().find('td:last-child').each(function(){
$("#notifications-create-new").on("submit", function(e) {
if (!codeCleaned) {
e.preventDefault();
$('#fr_html_ifr').contents().find('td:last-child').each(function() {
$(this).addClass('tdlast-child');
});
$('#fr_html_ifr').contents().find('tr:last-child').each(function(){
});
$('#fr_html_ifr').contents().find('tr:last-child').each(function() {
$(this).addClass('trlast-child');
});
$('#en_html_ifr').contents().find('td:last-child').each(function(){
$('#en_html_ifr').contents().find('td:last-child').each(function() {
$(this).addClass('tdlast-child');
});
$('#en_html_ifr').contents().find('tr:last-child').each(function(){
});
$('#en_html_ifr').contents().find('tr:last-child').each(function() {
$(this).addClass('trlast-child');
});
codeCleaned = true;
// $(this).trigger('submit');
}
});
codeCleaned = true;
// $(this).trigger('submit');
}
});
$('#tabs').tabs();
// Update system message type clone when changing the message type
$('[name="system_message_type"]').change(function () {
$('[name="system_message_type"]').change(function() {
$('.system_message_type_value').text($(this).find(':selected').text());
}).change();
//
// jQuery('#execute_date').datetimepicker({
//stepMinute: 05,
//dateFormat: 'yy-mm-dd',
// timeFormat: 'hh:mm:ss'
// });
//
// jQuery('#execute_date').datetimepicker({
//stepMinute: 05,
//dateFormat: 'yy-mm-dd',
// timeFormat: 'hh:mm:ss'
// });
updateNotificationType();
$('.attachment').live('click', function (e) {
$('.attachment').live('click', function(e) {
e.preventDefault();
var $link = $(this);
var options = {
......@@ -361,7 +356,7 @@ function getInputFormValues($validation, $name) {
type: 'POST',
dataType: 'json',
success: function (data) {
success: function(data) {
if (data.success == "true") {
$link.parent().html(file_element);
}
......@@ -372,7 +367,7 @@ function getInputFormValues($validation, $name) {
return false;
});
jQuery('table.expandable thead th').click(function () {
jQuery('table.expandable thead th').click(function() {
var $table = jQuery(this).parent().parent().parent();
if (jQuery('tbody', $table).is(':visible')) {
jQuery('thead', $table).removeClass('open');
......@@ -383,47 +378,57 @@ function getInputFormValues($validation, $name) {
}
});
});
function updateNotificationType() {
var type = jQuery('#notif_type').val();
var date = new Date().toLocaleDateString("en-US", {year: 'numeric', month: 'long', day: 'numeric'});
// var header ='<div><span style="font-size: 9.5pt;">If you are unable to clearly view the below E-Flash, please click<b><a><span style="font-weight: normal;"> here</span></a></b></span><hr /><img class="alignnone" src="https://cbvinstitute.com/wp-content/uploads/2019/02/email_logo.png" alt="Logo" width="81" height="57" align="left" /><span style="font-size: 9.5pt; line-height: 115%; float: right;">'+date+'</span></div><br/><br/>';
//
// var footer ='<div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><p class="footer"><strong><span style="font-family: GothamLight; font-size: 12px;"> To opt out, please:<br />1. Log in to cicbv.ca<br />2. Click on your name<br />3. From the drop down menu select profile<br />4. Edit E-flash settings<br />If you have any questions, please contact us: admin@cicbv.ca<br /></span></strong></p>';
//
// var header_fr ='<div class="content"><div><span style="font-size: 9.5pt;">If you are unable to clearly view the below E-Flash, please click<b><a><span style="font-weight: normal;"> here</span></a></b></span><hr /><img class="alignnone" src="https://cbvinstitute.com/wp-content/uploads/2019/02/email_logo_fr.png" alt="Logo" width="81" height="57" align="left" /><span style="font-size: 9.5pt; line-height: 115%; float: right;">'+date+'</span></div>><br/><br/>';
//
// var footer_fr ='</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><p class="footer"><strong><span style="font-family: GothamLight; font-size: 12px;"> To opt out, please:<br />1. Log in to cicbv.ca<br />2. Click on your name<br />3. From the drop down menu select profile<br />4. Edit E-flash settings<br />If you have any questions, please contact us: admin@cicbv.ca<br /></span></strong></p>';
var date = new Date().toLocaleDateString("en-US", {
year: 'numeric',
month: 'long',
day: 'numeric'
});
// var header ='<div><span style="font-size: 9.5pt;">If you are unable to clearly view the below E-Flash, please click<b><a><span style="font-weight: normal;"> here</span></a></b></span><hr /><img class="alignnone" src="https://cbvinstitute.com/wp-content/uploads/2019/02/email_logo.png" alt="Logo" width="81" height="57" align="left" /><span style="font-size: 9.5pt; line-height: 115%; float: right;">'+date+'</span></div><br/><br/>';
//
// var footer ='<div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><p class="footer"><strong><span style="font-family: GothamLight; font-size: 12px;"> To opt out, please:<br />1. Log in to cicbv.ca<br />2. Click on your name<br />3. From the drop down menu select profile<br />4. Edit E-flash settings<br />If you have any questions, please contact us: admin@cicbv.ca<br /></span></strong></p>';
//
// var header_fr ='<div class="content"><div><span style="font-size: 9.5pt;">If you are unable to clearly view the below E-Flash, please click<b><a><span style="font-weight: normal;"> here</span></a></b></span><hr /><img class="alignnone" src="https://cbvinstitute.com/wp-content/uploads/2019/02/email_logo_fr.png" alt="Logo" width="81" height="57" align="left" /><span style="font-size: 9.5pt; line-height: 115%; float: right;">'+date+'</span></div>><br/><br/>';
//
// var footer_fr ='</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><p class="footer"><strong><span style="font-family: GothamLight; font-size: 12px;"> To opt out, please:<br />1. Log in to cicbv.ca<br />2. Click on your name<br />3. From the drop down menu select profile<br />4. Edit E-flash settings<br />If you have any questions, please contact us: admin@cicbv.ca<br /></span></strong></p>';
if (type == "triggered") {
jQuery('.scheduled-extended').hide();
jQuery('.scheduled_sendto').hide();
jQuery('.trigger-extended').show();
}else if (type == "newsletter") {
} else if (type == "newsletter") {
jQuery("#tabs").append('<input type="hidden" id="email_style" name="email_style" class="wide-input-field" />');
jQuery("#email_style").val('newsletter');
jQuery('.scheduled-extended').show();
jQuery("#tabs").append('<input type="hidden" id="email_style" name="email_style" class="wide-input-field" />');
jQuery("#email_style").val('newsletter');
jQuery('.scheduled-extended').show();
jQuery('.trigger-extended').hide();
jQuery(".text_verson").hide();
jQuery('.attachments').hide();
jQuery('.scheduled_sendto').show();
//$(tinymce.get('en_html').getBody()).html(header+footer);
//$(tinymce.get('fr_html').getBody()).html(header_fr+footer_fr);
jQuery(".text_verson").hide();
jQuery('.attachments').hide();
jQuery('.scheduled_sendto').show();
//$(tinymce.get('en_html').getBody()).html(header+footer);
//$(tinymce.get('fr_html').getBody()).html(header_fr+footer_fr);
$(tinymce.get('en_html').getBody()).html('<div id="newsletter"><p><img class="header-img alignnone wp-image-125416 size-full" src="https://cbvinstitute.com/wp-content/uploads/2019/02/image001.png" alt="" width="1691" height="441" /></p>' +
'<div class="content-block-header"><h2><span style="font-family: MyanmarMN;"><strong><span style="color: #ffffff;">BREAKING</span> <span style="color: #6ac9c8;">NEWS</span></strong></span></h2>');
$(tinymce.get('fr_html').getBody()).html('<div id="newsletter"><p><img class="header-img alignnone wp-image-125416 size-full" src="https://cbvinstitute.com/wp-content/uploads/2019/02/image002.png" alt="" width="1691" height="441" /></p>' +
'<div class="content-block-header"><h2><span style="font-family: MyanmarMN;"><strong><span style="color: #ffffff;">DERNIÈRES</span> <span style="color: #6ac9c8;">NOUVELLES</span></strong></span></h2>');
jQuery('#execute_date').datetimepicker({
format: 'Y-m-d, H:i',
defaultDate: new Date()
}).on('dp.change', function(e){
jQuery('#time').val(e.date);
console.log('changed');
}).on('dp.change', function(e) {
jQuery('#time').val(e.date);
console.log('changed');
});
} else {
jQuery('.scheduled-extended').show();
jQuery('.trigger-extended').hide();
......@@ -431,10 +436,10 @@ function getInputFormValues($validation, $name) {
jQuery('#execute_date').datetimepicker({
format: 'Y-m-d, H:i',
defaultDate: new Date()
}).on('dp.change', function(e){
jQuery('#time').val(e.date);
console.log('changed');
}).on('dp.change', function(e) {
jQuery('#time').val(e.date);
console.log('changed');
});
}
}
</script>
</script>
\ No newline at end of file
......