diff --git a/modules/ncenterlite/lang/en.php b/modules/ncenterlite/lang/en.php index 4cbb02426..ebac9e365 100644 --- a/modules/ncenterlite/lang/en.php +++ b/modules/ncenterlite/lang/en.php @@ -128,6 +128,8 @@ $lang->dont_check_notify_delete = 'Unread notifications will be deleted, too.'; $lang->user_notify_setting = 'User notify setting.'; $lang->about_user_notify_setting = 'Each member can set a notify settings. Warning! If a member setting not use notifications, they will not be notified regardless of their default settings.'; $lang->msg_not_use_user_setting = 'user setting\'s not use. Please contact your administrator.'; +$lang->ncenterlite_push_before_sms = 'Try Push before SMS'; +$lang->ncenterlite_push_before_sms_about = 'Don\'t send SMS if the recipient has at least one device to which a push notification has been successfully sent.'; $lang->anonymous_voter = 'anonymous voter'; $lang->about_anonymous_voter = 'anonymize voter in vote notification'; $lang->anonymous_scrap = 'anonymous scrap'; diff --git a/modules/ncenterlite/lang/ko.php b/modules/ncenterlite/lang/ko.php index f60833145..7bc320b2b 100644 --- a/modules/ncenterlite/lang/ko.php +++ b/modules/ncenterlite/lang/ko.php @@ -145,8 +145,10 @@ $lang->member_menu_view = '회원 메뉴 표시'; $lang->member_menu_on = '표시'; $lang->member_menu_off = '표시하지 않음'; $lang->about_member_menu_view = '각 회원이 알림 설정을 변경할 수 있는 메뉴를 추가합니다.'; -$lang->user_notify_setting = '회원알림설정'; +$lang->user_notify_setting = '회원 알림 설정'; $lang->about_user_notify_setting = '각 맴버회원들의 알림을 설정할 수 있습니다. 회원들이 알림을 받지 않도록 설정되어 있다면 해당 회원이 알림센터를 통해서 알림을 못받을 수 있습니다.'; +$lang->ncenterlite_push_before_sms = '푸시 성공시 문자 미발송'; +$lang->ncenterlite_push_before_sms_about = '1개 이상의 기기로 푸시 알림을 발송하는 데 성공한 경우, 해당 회원에게는 문자를 발송하지 않습니다.'; $lang->ncenterlite_no_notify = '알림 내역이 없습니다.'; $lang->ncenterlite_all_delete = '전체 삭제'; $lang->ncenterlite_month_before_delete = '한 달 이전의 알림 삭제'; diff --git a/modules/ncenterlite/ncenterlite.admin.controller.php b/modules/ncenterlite/ncenterlite.admin.controller.php index e8c3a35d2..19516f99f 100644 --- a/modules/ncenterlite/ncenterlite.admin.controller.php +++ b/modules/ncenterlite/ncenterlite.admin.controller.php @@ -24,6 +24,7 @@ class ncenterliteAdminController extends ncenterlite 'colorset', 'zindex', 'anonymous_name', + 'push_before_sms', 'document_read', 'layout_srl', 'mlayout_srl', diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index 916464c7a..62080caa8 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -1331,7 +1331,7 @@ class ncenterliteController extends ncenterlite function _insertNotify($args, $anonymous = FALSE) { - $config = getModel('ncenterlite')->getConfig(); + $config = NcenterliteModel::getConfig(); if(is_array($config->hide_module_srls) && in_array($args->module_srl, $config->hide_module_srls)) { @@ -1411,8 +1411,11 @@ class ncenterliteController extends ncenterlite if($output->toBool()) { ModuleHandler::triggerCall('ncenterlite._insertNotify', 'after', $args); - $this->sendPushMessage($args); - $this->sendSmsMessage($args); + $push_success = $this->sendPushMessage($args); + if (!$push_success || !isset($config->push_before_sms) || $config->push_before_sms !== 'Y') + { + $this->sendSmsMessage($args); + } $this->sendMailMessage($args); $this->removeFlagFile($args->member_srl); } @@ -1601,7 +1604,9 @@ class ncenterliteController extends ncenterlite $oPush->setData($args->extra_data); $oPush->setURL(strval($target_url)); $oPush->addTo(intval($args->member_srl)); - $oPush->send(); + $output = $oPush->send(); + + return $output; } function sendSmsMessage($args) diff --git a/modules/ncenterlite/tpl/config.html b/modules/ncenterlite/tpl/config.html index 23db2587e..4d9af3a31 100644 --- a/modules/ncenterlite/tpl/config.html +++ b/modules/ncenterlite/tpl/config.html @@ -75,6 +75,14 @@
{$lang->about_user_notify_setting}
+{$lang->ncenterlite_push_before_sms_about}
+