From ba772269a5a1eb5cf3eab92e828b1afc2ec311db Mon Sep 17 00:00:00 2001 From: BJRambo Date: Wed, 24 Apr 2019 16:38:10 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EB=8D=94=EB=AF=B8=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=8B=9C=20ajax=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EC=95=8C=EB=A6=BC=EC=9D=84=20=EC=83=9D=EC=84=B1=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EA=B3=A0=20XE=EC=97=90=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EC=9A=94=EC=B2=AD=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 일반 테스트 발송시 다음과 같이 문제 발생시 해당 문제를 파악할 수 없습니다. 문제 : https://xetown.com/questions/1212317 이는 JS의 ajax전송 방식을 사용함에 따라 알림 생성시 백그라운드에서 실행이후 새로고침 하는 형태이다 보니 해당 알림과정에서 에러가 발생시 해당 에러를 확인하는 부분이 js에 요청한 쪽에서 받게 됩니다. 이 경우 사용자가 테스트가 정상적으로 되지 않앗을 때 왜 오류가 발생되는지 알기 어렵습니다. 따라서 테스트 목적에 부합한 방법으로 수정합니다. --- .../ncenterlite.admin.controller.php | 32 +++++++++++++++++-- modules/ncenterlite/tpl/js/ncenter_admin.js | 11 ------- modules/ncenterlite/tpl/test.html | 18 +++++++++-- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/modules/ncenterlite/ncenterlite.admin.controller.php b/modules/ncenterlite/ncenterlite.admin.controller.php index c38056768..fd3b2e5fa 100644 --- a/modules/ncenterlite/ncenterlite.admin.controller.php +++ b/modules/ncenterlite/ncenterlite.admin.controller.php @@ -127,11 +127,24 @@ class ncenterliteAdminController extends ncenterlite $args->type = $this->_TYPE_TEST; $args->target_type = $this->_TYPE_TEST; $args->target_url = getUrl(''); - $args->target_summary = Context::getLang('ncenterlite_thisistest') . rand(); + $args->target_summary = Context::getLang('ncenterlite_thisistest'); $args->target_nick_name = $logged_info->nick_name; $args->regdate = date('YmdHis'); $args->notify = $oNcenterliteController->_getNotifyId($args); - $oNcenterliteController->_insertNotify($args); + $output = $oNcenterliteController->_insertNotify($args); + if(!$output->toBool()) + { + return $output; + } + } + + if (Context::get('success_return_url')) + { + $this->setRedirectUrl(Context::get('success_return_url')); + } + else + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNcenterliteAdminTest')); } } @@ -154,7 +167,20 @@ class ncenterliteAdminController extends ncenterlite $args->target_nick_name = $logged_info->nick_name; $args->regdate = date('YmdHis'); $args->notify = $oNcenterliteController->_getNotifyId($args); - $oNcenterliteController->_insertNotify($args); + $output = $oNcenterliteController->_insertNotify($args); + if(!$output->toBool()) + { + return $output; + } + + if (Context::get('success_return_url')) + { + $this->setRedirectUrl(Context::get('success_return_url')); + } + else + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNcenterliteAdminTest')); + } } function procNcenterliteAdminDeleteNofity() diff --git a/modules/ncenterlite/tpl/js/ncenter_admin.js b/modules/ncenterlite/tpl/js/ncenter_admin.js index d0e656977..70a2b03a5 100644 --- a/modules/ncenterlite/tpl/js/ncenter_admin.js +++ b/modules/ncenterlite/tpl/js/ncenter_admin.js @@ -29,14 +29,3 @@ function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) sel.selectedIndex = selected_index; } - -function doDummyDataInsert() -{ - jQuery.exec_json('ncenterlite.procNcenterliteAdminInsertDummyData', {}, function completeGetDummyInfo(ret_obj){alert(ret_obj.message)}); -} - -function doDummyPushDataInsert() -{ - jQuery.exec_json('ncenterlite.procNcenterliteAdminInsertPushData', {}, function completeGetDummyPushInfo(ret_obj){alert(ret_obj.message)}); -} - diff --git a/modules/ncenterlite/tpl/test.html b/modules/ncenterlite/tpl/test.html index 9940af531..4952064b8 100644 --- a/modules/ncenterlite/tpl/test.html +++ b/modules/ncenterlite/tpl/test.html @@ -8,14 +8,28 @@
- +
+
+ + + +
+
+

{$lang->ncenterlite_test_mention_about}

- +
+
+ + + +
+
+

{$lang->ncenterlite_test_push_about}