mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Cleanup related to phone country change
This commit is contained in:
parent
0e9ce525da
commit
1db4a9d752
9 changed files with 60 additions and 8 deletions
|
|
@ -167,6 +167,7 @@ $lang->msg_column_id_not_available = 'The ID already exists or is not usable.';
|
|||
$lang->msg_exists_user_id = 'This ID already exists. Please try another one.';
|
||||
$lang->msg_exists_email_address = 'This email address already exists. Please try another one.';
|
||||
$lang->msg_exists_phone_number = 'This phone number already exists. Please try another one.';
|
||||
$lang->msg_invalid_phone_country = 'The phone number belongs to an unsupported country.';
|
||||
$lang->msg_invalid_phone_number = 'The phone number you have entered is invalid.';
|
||||
$lang->msg_exists_nick_name = 'This nickname already exists. Please try another one.';
|
||||
$lang->msg_signup_disabled = 'You are not able to sign up';
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ $lang->msg_column_id_not_available = '이미 존재하거나 사용할 수 없
|
|||
$lang->msg_exists_user_id = '이미 존재하는 아이디입니다. 다른 아이디를 입력해주세요.';
|
||||
$lang->msg_exists_email_address = '이미 존재하는 메일 주소입니다. 다른 메일 주소를 입력해주세요.';
|
||||
$lang->msg_exists_phone_number = '이미 존재하는 전화번호입니다. 다른 전화번호를 입력해주세요.';
|
||||
$lang->msg_invalid_phone_country = '전화번호의 국가가 잘못 선택되었습니다.';
|
||||
$lang->msg_invalid_phone_number = '전화번호가 형식에 맞지 않습니다.';
|
||||
$lang->msg_exists_nick_name = '이미 존재하는 닉네임입니다. 다른 닉네임을 입력해주세요.';
|
||||
$lang->msg_signup_disabled = '회원 가입할 수 없습니다.';
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class memberAdminView extends member
|
|||
Context::set('country_list', $country_list);
|
||||
if(!$config->phone_number_default_country && Context::get('lang_type') === 'ko')
|
||||
{
|
||||
$config->phone_number_default_country = '82';
|
||||
$config->phone_number_default_country = 'KOR';
|
||||
}
|
||||
|
||||
$this->setTemplateFile('signup_config');
|
||||
|
|
|
|||
|
|
@ -218,9 +218,21 @@ class member extends ModuleObject {
|
|||
// Check scrap folder table
|
||||
if(!$oDB->isColumnExists("member_scrap", "folder_srl")) return true;
|
||||
|
||||
// Check signup form
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
|
||||
// Check members with phone country in old format
|
||||
if ($config->phone_number_default_country && !preg_match('/^[A-Z]{3}$/', $config->phone_number_default_country))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
$output = executeQuery('member.getMemberCountByPhoneCountry', (object)['phone_country' => '82']);
|
||||
if ($output->data->count)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check signup form
|
||||
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
||||
$phone_found = false;
|
||||
foreach($config->signupForm as $signupItem)
|
||||
|
|
@ -401,9 +413,26 @@ class member extends ModuleObject {
|
|||
$oDB->addIndex("member_scrap","idx_folder_srl", array("folder_srl"));
|
||||
}
|
||||
|
||||
// Check signup form
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
$changed = false;
|
||||
|
||||
// Check members with phone country in old format
|
||||
if ($config->phone_number_default_country && !preg_match('/^[A-Z]{3}$/', $config->phone_number_default_country))
|
||||
{
|
||||
$config->phone_number_default_country = Rhymix\Framework\i18n::getCountryCodeByCallingCode($config->phone_number_default_country);
|
||||
$changed = true;
|
||||
}
|
||||
$output = executeQuery('member.getMemberCountByPhoneCountry', (object)['phone_country' => '82']);
|
||||
if ($output->data->count)
|
||||
{
|
||||
executeQuery('member.updateMemberPhoneCountry', (object)array(
|
||||
'old_phone_country' => '82',
|
||||
'new_phone_country' => 'KOR',
|
||||
));
|
||||
}
|
||||
|
||||
// Check signup form
|
||||
$oModuleController = getController('module');
|
||||
$oMemberAdminController = getAdminController('member');
|
||||
if(!$config->identifier)
|
||||
|
|
@ -415,7 +444,6 @@ class member extends ModuleObject {
|
|||
$config->signupForm = $oMemberAdminController->createSignupForm($config);
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
$changed = false;
|
||||
$phone_number_found = false;
|
||||
foreach($config->signupForm as $no => $signupItem)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3366,12 +3366,12 @@ class memberController extends member
|
|||
$phone_country_calling_code = preg_replace('/[^0-9]/', '', Rhymix\Framework\i18n::getCallingCodeByCountryCode($phone_country));
|
||||
if (!$phone_country_calling_code)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_phone_number');
|
||||
return new BaseObject(-1, 'msg_invalid_phone_country');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_phone_number');
|
||||
return new BaseObject(-1, 'msg_invalid_phone_country');
|
||||
}
|
||||
|
||||
if (!preg_match('/[0-9]{2,}/', $phone_number))
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class memberView extends member
|
|||
{
|
||||
$item->value = Rhymix\Framework\i18n::formatPhoneNumber($item->value, $memberInfo->phone_country);
|
||||
}
|
||||
elseif(($memberConfig->phone_number_default_country === 'KOR' || $memberConfig->phone_number_default_country == '82') && ($memberInfo->phone_country === 'KOR' || $memberInfo->phone_country == '82'))
|
||||
elseif($memberConfig->phone_number_default_country === 'KOR' && ($memberInfo->phone_country === 'KOR' || $memberInfo->phone_country == '82'))
|
||||
{
|
||||
$item->value = Rhymix\Framework\Korea::formatPhoneNumber($item->value);
|
||||
}
|
||||
|
|
|
|||
11
modules/member/queries/getMemberCountByPhoneCountry.xml
Normal file
11
modules/member/queries/getMemberCountByPhoneCountry.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getMemberCountByPhoneCountry" action="select">
|
||||
<tables>
|
||||
<table name="member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="phone_country" var="phone_country" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/member/queries/updateMemberPhoneCountry.xml
Normal file
11
modules/member/queries/updateMemberPhoneCountry.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateMemberPhoneCountry" action="update">
|
||||
<tables>
|
||||
<table name="member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="phone_country" var="new_phone_country" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="phone_country" var="old_phone_country" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
<!--@elseif($name === 'phone_number' && $member_info['phone_number'])-->
|
||||
<!--@if($config->phone_number_hide_country !== 'Y')-->
|
||||
{\Rhymix\Framework\i18n::formatPhoneNumber($member_info['phone_number'], $member_info['phone_country'])}
|
||||
<!--@elseif(($config->phone_number_default_country === 'KOR' || $memberConfig->phone_number_default_country == '82') && ($member_info['phone_country'] === 'KOR' || $member_info['phone_country'] == '82'))-->
|
||||
<!--@elseif($config->phone_number_default_country === 'KOR' && ($member_info['phone_country'] === 'KOR' || $member_info['phone_country'] == '82'))-->
|
||||
{\Rhymix\Framework\Korea::formatPhoneNumber($member_info['phone_number'])}
|
||||
<!--@else-->
|
||||
{$member_info['phone_number']}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue