919ef20b by Insu Mun

Add language selection for new notification page.

1 parent 7cc54a60
......@@ -132,7 +132,8 @@ function display_page()
);
update_post_meta($id, 'send_status', $entry->details['status']);
update_post_meta($id, 'notif_type', $type);
update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
// update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
update_post_meta($id, 'execute_date', strtotime($executeDate));
update_post_meta($id, 'trigger', $trigger);
update_post_meta($id, 'email', $emailData);
......@@ -288,15 +289,17 @@ function create_notification()
foreach (['en', 'fr'] as $lang) {
$validation->set_rules($lang.'_subject', 'Subject', 'trim');
$validation->set_rules($lang.'_text', 'Text Version', 'trim|min_length[16]');
$validation->set_rules($lang.'_html', 'HTML Version', 'trim|min_length[16]');
// $validation->set_rules($lang.'_text', 'Text Version', 'trim|min_length[16]');
// $validation->set_rules($lang.'_html', 'HTML Version', 'trim|min_length[16]');
$validation->set_rules($lang.'_text', 'Text Version', 'trim');
$validation->set_rules($lang.'_html', 'HTML Version', 'trim');
$validation->set_rules($lang.'_system', 'System Message', 'trim|min_length[16]');
}
if ($_POST && ($_POST['subject'] == '' && $_POST['system'] == '')) {
$form_error = true;
require_once(__DIR__.'/views/create.php');
} else {
// if ($_POST && ($_POST['subject'] == '' && $_POST['system'] == '')) {
// $form_error = true;
// require_once(__DIR__.'/views/create.php');
// } else {
if ($validation->run() == true) {
// Clean up the data before saving
......@@ -385,7 +388,9 @@ function create_notification()
);
update_post_meta($id, 'send_status', 'pending');
update_post_meta($id, 'notif_type', $type);
update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
// update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
update_post_meta($id, 'execute_date', strtotime($executeDate));
update_post_meta($id, 'trigger', $trigger);
update_post_meta($id, 'email', $emailData);
......@@ -396,5 +401,5 @@ function create_notification()
} else {
require_once(__DIR__.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'create.php');
}
}
// }
}
......
......@@ -309,7 +309,6 @@ class Validation
// Did we end up with any errors?
$total_errors = count($this->_error_array);
if ($total_errors > 0) {
$this->_safe_form_data = true;
}
......