Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable & do single field metadata conversion for defaultContactCountry #19697

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions templates/CRM/Admin/Form/Setting/Localization.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<td class="label">{$form.moneyformat.label} {help id='moneyformat' title=$form.moneyformat.label}</td>
<td>{$form.moneyformat.html}</td>
</tr>
<tr class="crm-localization-form-block-customTranslateFunction">
<tr class="crm-localization-form-block-customTranslateFunction">
<td class="label">{$form.customTranslateFunction.label} {help id='customTranslateFunction' title=$form.customTranslateFunction.label}</td>
<td>{$form.customTranslateFunction.html}</td>
</tr>
Expand All @@ -84,10 +84,7 @@
</table>
<h3>{ts}Contact Address Fields - Selection Values{/ts}</h3>
<table class="form-layout-compressed">
<tr class="crm-localization-form-block-defaultContactCountry">
<td class="label">{$form.defaultContactCountry.label} {help id='defaultContactCountry' title=$form.defaultContactCountry.label}</td>
<td>{$form.defaultContactCountry.html}</td>
</tr>
{include file='CRM/Admin/Form/Setting/SettingField.tpl' setting_name='defaultContactCountry' fieldSpec=$settings_fields.defaultContactCountry}
<tr class="crm-localization-form-block-pinnedContactCountries">
<td class="label">{$form.pinnedContactCountries.label} {help id='pinnedContactCountries' title=$form.pinnedContactCountries.label}</td>
<td>{$form.pinnedContactCountries.html}</td>
Expand Down
18 changes: 18 additions & 0 deletions templates/CRM/Admin/Form/Setting/SettingField.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{* Display setting field from metadata - todo consolidate with CRM_Core_Form_Field.tpl *}
<tr class="crm-setting-form-block-{$setting_name}">
<td class="label">{$form.$setting_name.label}</td>
<td>
{if !empty($fieldSpec.wrapper_element)}
{$fieldSpec.wrapper_element.0}{$form.$setting_name.html}{$fieldSpec.wrapper_element.1}
{else}
{$form.$setting_name.html}
{/if}
<div class="description">
{$fieldSpec.description}
</div>
{if $fieldSpec.help_text}
{* @todo the appended -id here appears to be inconsistent in the hlp files *}
{assign var='tplhelp_id' value = $setting_name|cat:'-id'|replace:'_':'-'}{help id="$tplhelp_id"}
{/if}
</td>
</tr>
19 changes: 2 additions & 17 deletions templates/CRM/Admin/Form/Setting/SettingForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@
*}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
{foreach from=$settings_fields key="setting_name" item="setting_detail"}
<tr class="crm-mail-form-block-{$setting_name}">
<td class="label">{$form.$setting_name.label}</td>
<td>
{if !empty($setting_detail.wrapper_element)}
{$setting_detail.wrapper_element.0}{$form.$setting_name.html}{$setting_detail.wrapper_element.1}
{else}
{$form.$setting_name.html}
{/if}
<div class="description">
{$setting_detail.description}
</div>
{if $setting_detail.help_text}
{assign var='tplhelp_id' value = $setting_name|cat:'-id'|replace:'_':'-'}{help id="$tplhelp_id"}
{/if}
</td>
</tr>
{foreach from=$settings_fields key="setting_name" item="fieldSpec"}
{include file="CRM/Admin/Form/Setting/SettingField.tpl"}
{/foreach}
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
Expand Down