Add options to designate a default country code

This commit is contained in:
Kijin Sung 2019-08-03 20:22:08 +09:00
parent 2300f6e83a
commit b37e70a41e
6 changed files with 39 additions and 7 deletions

View file

@ -31,6 +31,8 @@ $lang->group_title = 'Group Name';
$lang->group_srl = 'Group Number';
$lang->group_order = 'Gropu Priority';
$lang->group_order_change = 'Change Group Priority';
$lang->phone_number_default_country = 'Default Country Code';
$lang->phone_number_hide_country = 'Hide Country Code Selection';
$lang->signature = 'Signature';
$lang->profile_image = 'Profile Image';
$lang->profile_image_max_width = 'Max Width';

View file

@ -31,6 +31,8 @@ $lang->group_title = '그룹 제목';
$lang->group_srl = '그룹 번호';
$lang->group_order = '그룹 우선순위';
$lang->group_order_change = '그룹 우선순위 변경';
$lang->phone_number_default_country = '기본 선택 국가';
$lang->phone_number_hide_country = '국가 목록 숨김';
$lang->signature = '서명';
$lang->profile_image = '프로필 사진';
$lang->profile_image_max_width = '가로 제한 길이';

View file

@ -296,6 +296,7 @@ class memberAdminController extends member
'limit_day_description',
'emailhost_check',
'redirect_url',
'phone_number_default_country', 'phone_number_hide_country',
'profile_image', 'profile_image_max_width', 'profile_image_max_height', 'profile_image_max_filesize',
'image_name', 'image_name_max_width', 'image_name_max_height', 'image_name_max_filesize',
'image_mark', 'image_mark_max_width', 'image_mark_max_height', 'image_mark_max_filesize',
@ -323,6 +324,8 @@ class memberAdminController extends member
$args->redirect_url = getNotEncodedFullUrl('','mid',$redirectModuleInfo->mid);
}
$args->phone_number_default_country = preg_replace('/[^0-9-]/', '', $args->phone_number_default_country);
$args->phone_number_hide_country = $args->phone_number_hide_country == 'Y' ? 'Y' : 'N';
$args->profile_image = $args->profile_image ? 'Y' : 'N';
$args->image_name = $args->image_name ? 'Y' : 'N';
$args->image_mark = $args->image_mark ? 'Y' : 'N';

View file

@ -110,6 +110,7 @@ class memberAdminView extends member
}
}
}
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
@ -228,6 +229,14 @@ class memberAdminView extends member
$managedEmailHost = $oMemberModel->getManagedEmailHosts();
Context::set('managedEmailHost', $managedEmailHost);
$oSecurity->encodeHTML('managedEmailHost..email_host');
// Get country calling code list
$country_list = Rhymix\Framework\i18n::listCountries(Context::get('lang_type') === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH);
Context::set('country_list', $country_list);
if(!$config->phone_number_default_country && Context::get('lang_type') === 'ko')
{
$config->phone_number_default_country = '82';
}
$this->setTemplateFile('signup_config');
}
@ -542,14 +551,14 @@ class memberAdminView extends member
else if($formInfo->name == 'phone_number')
{
$formTag->type = 'phone';
if(!$config->phone_number_hide_country)
if($member_config->phone_number_hide_country !== 'Y')
{
$inputTag = '<select name="phone_country" id="phone_country" class="phone_country">';
$country_list = Rhymix\Framework\i18n::listCountries(Context::get('lang_type') === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH);
$match_country = $memberInfo['phone_country'];
if(!$match_country && $config->phone_number_default_country)
if(!$match_country && $member_config->phone_number_default_country)
{
$match_country = $config->phone_number_default_country;
$match_country = $member_config->phone_number_default_country;
}
if(!$match_country && Context::get('lang_type') === 'ko')
{

View file

@ -69,8 +69,7 @@ jQuery(function($){
.find(':radio[value=option]').attr('checked', 'checked')
.end()
.prev('td')
.find(':input[value=Y]').removeAttr('disabled').attr('checked', 'checked');
.find(':input[value=Y]').not('[data-donotchange]').removeAttr('disabled').attr('checked', 'checked');
} else {
$i.parent('td').next('td').next('td')
.find('>._subItem').hide().end()
@ -78,7 +77,7 @@ jQuery(function($){
.next('label').css('fontWeight','normal').end()
.end()
.prev('td')
.find(':input[value=Y]').removeAttr('checked').attr('disabled', 'disabled');
.find(':input[value=Y]').not('[data-donotchange]').removeAttr('checked').attr('disabled', 'disabled');
}
}

View file

@ -136,7 +136,7 @@
</th>
<td style="text-align:center"><input type="radio" name="identifier" value="{$item->name}" cond="$item->name== 'email_address' || $item->name=='user_id'" /></td>
<td style="text-align:center"><input type="checkbox" name="usable_list[]" value="{$item->name}" title="{$lang->use}" checked="checked"|cond="$item->mustRequired || $item->isUse" disabled="disabled"|cond="$item->mustRequired" /></td>
<td style="text-align:center"><input type="checkbox" name="is_{$item->name}_public" value="Y" checked="checked"|cond="$item->isPublic == 'Y'" disabled="disabled"|cond="in_array($item->name, $fixed_public_list) || !$item->isUse" /></td>
<td style="text-align:center"><input type="checkbox" name="is_{$item->name}_public" value="Y" checked="checked"|cond="$item->isPublic == 'Y'" disabled="disabled"|cond="in_array($item->name, $fixed_public_list) || !$item->isUse" data-donotchange="Y"|cond="in_array($item->name, $fixed_public_list)" /></td>
<td class="nowr">
<label for="{$item->name}_re" class="x_inline"><input type="radio" id="{$item->name}_re" name="{$item->name}" value="required" checked="checked"|cond="$item->mustRequired || $item->required" disabled="disabled"|cond="$item->mustRequired || !$item->isUse" /> {$lang->cmd_required}</label>
<label for="{$item->name}_op" class="x_inline"><input type="radio" id="{$item->name}_op" name="{$item->name}" value="option" checked="checked"|cond="!$item->mustRequired && ($item->isUse && !$item->required)" disabled="disabled"|cond="$item->mustRequired || !$item->isUse" /> {$lang->cmd_optional}</label>
@ -147,6 +147,23 @@
<label for="{$item->name}_max_filesize">{$lang->allowed_filesize}: <input type="number" min="1" name="{$item->name}_max_filesize" id="{$item->name}_max_filesize" value="{$item->max_filesize}" /> KB</label>
</div>
<div cond="$item->name == 'phone_number'" class="_subItem" style="display:none"|cond="!$item->isUse">
<label for="phone_number_default_country" class="x_inline">{$lang->phone_number_default_country}</label>
<select id="phone_number_default_country" name="phone_number_default_country">
<option value=""></option>
<!--@foreach($country_list as $country_info)-->
<!--@if($country_info->calling_code)-->
<option value="{$country_info->calling_code}" selected="selected"|cond="$country_info->calling_code == $config->phone_number_default_country">
{$lang_type === 'ko' ? $country_info->name_korean : $country_info->name_english} (+{$country_info->calling_code})
</option>
<!--@endif-->
<!--@endforeach-->
</select><br />
<label class="x_inline">{$lang->phone_number_hide_country}</label>
<label class="x_inline"><input type="radio" name="phone_number_hide_country" value="Y" checked="checked"|cond="$config->phone_number_hide_country === 'Y'" /> {$lang->cmd_yes}</label>
<label class="x_inline"><input type="radio" name="phone_number_hide_country" value="N" checked="checked"|cond="$config->phone_number_hide_country !== 'Y'" /> {$lang->cmd_no}</label>
</div>
<div cond="$item->name == 'signature'" class="_subItem" style="display:none;padding-top:5px"|cond="!$item->isUse">
<select id="signature_editor" name="signature_editor_skin" onchange="getEditorSkinColorList(this.value)">
<!--@foreach($editor_skin_list as $editor_skin)-->