1bfffaf5 by Insu Mun

Check the notification language when user creates a notification.

1 parent 4772fe24
...@@ -24,7 +24,6 @@ call_user_func( ...@@ -24,7 +24,6 @@ call_user_func(
24 24
25 function display_page() 25 function display_page()
26 { 26 {
27
28 if (isset($_GET['action']) && $_GET['action'] == "edit") { 27 if (isset($_GET['action']) && $_GET['action'] == "edit") {
29 /** @var \StdClass $entry */ 28 /** @var \StdClass $entry */
30 $entry = get_post($_GET['page_id']); 29 $entry = get_post($_GET['page_id']);
...@@ -201,8 +200,8 @@ function display_page() ...@@ -201,8 +200,8 @@ function display_page()
201 $entry->type = $details['type']; 200 $entry->type = $details['type'];
202 $entry->sendto = $details['sendto']; 201 $entry->sendto = $details['sendto'];
203 202
204 $entry->is_email = (($email['en_text'] != '' || $email['en_html'] != '')) ? true : false; 203 $entry->is_email = (($email['en_text'] != '' || $email['en_html'] != '')) || (($email['fr_text'] != '' || $email['fr_html'] != '')) ? true : false;
205 $entry->is_system = (isset($system['en_message']) && $system['en_message'] != '') ? true : false; 204 $entry->is_system = (isset($system['en_message']) && $system['en_message'] != '') || (isset($system['fr_message']) && $system['fr_message'] != '') ? true : false;
206 205
207 $entry->execute_date = $details['execute_date']; 206 $entry->execute_date = $details['execute_date'];
208 207
...@@ -296,10 +295,10 @@ function create_notification() ...@@ -296,10 +295,10 @@ function create_notification()
296 $validation->set_rules($lang.'_system', 'System Message', 'trim|min_length[16]'); 295 $validation->set_rules($lang.'_system', 'System Message', 'trim|min_length[16]');
297 } 296 }
298 297
299 // if ($_POST && ($_POST['subject'] == '' && $_POST['system'] == '')) { 298 if ($_POST && ($_POST['en_subject'] == '' && $_POST['fr_subject'] == '' && $_POST['en_system'] == '' && $_POST['fr_system'] == '')) {
300 // $form_error = true; 299 $form_error = true;
301 // require_once(__DIR__.'/views/create.php'); 300 require_once(__DIR__.'/views/create.php');
302 // } else { 301 } else {
303 if ($validation->run() == true) { 302 if ($validation->run() == true) {
304 303
305 // Clean up the data before saving 304 // Clean up the data before saving
...@@ -401,5 +400,5 @@ function create_notification() ...@@ -401,5 +400,5 @@ function create_notification()
401 } else { 400 } else {
402 require_once(__DIR__.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'create.php'); 401 require_once(__DIR__.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'create.php');
403 } 402 }
404 // } 403 }
405 } 404 }
......
...@@ -249,16 +249,12 @@ function getInputFormValues($validation, $name) { ...@@ -249,16 +249,12 @@ function getInputFormValues($validation, $name) {
249 </div> 249 </div>
250 <?php endforeach; ?> 250 <?php endforeach; ?>
251 </div> 251 </div>
252
253
254 <p> 252 <p>
255 <input type="submit" value=" Save "/> 253 <input type="submit" value=" Save "/>
256 <input type="button" value=" Cancel " 254 <input type="button" value=" Cancel "
257 onclick="document.location.href='/wp-admin/admin.php?page=notifications';"/> 255 onclick="document.location.href='/wp-admin/admin.php?page=notifications';"/>
258 </p> 256 </p>
259
260 </form> 257 </form>
261
262 </div> 258 </div>
263 259
264 <script> 260 <script>
......