Added extension to add address format for country

This commit is contained in:
2018-07-10 03:44:48 +05:30
commit eb00473adb
13 changed files with 1832 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<div class="crm-block crm-form-block crm-address_format-form-block">
{if $action eq 8}
<div class="messages status">
<div class="icon inform-icon"></div>
{ts}WARNING: Deleting a address format cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
</div>
{else}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
<tr class="crm-contribution-form-block-name">
<td class="label">{$form.country_id.label}</td>
<td class="html-adjust">{$form.country_id.html}</td>
</tr>
<tr class="crm-contribution-form-block-description">
<td class="label">{$form.format.label} {help id='label-tokens' file="CRM/Admin/Form/Preferences/Address.hlp}</td>
<td class="html-adjust">
<div class="helpIcon" id="helphtml">
<input class="crm-token-selector big" data-field="format" />
{help id="id-token-text" file="CRM/Contact/Form/Task/Email.hlp"}
</div>
{$form.format.html|crmAddClass:huge12}<br />
<span class="description">{ts}Content and format for mailing labels.{/ts}</span>
</td>
</tr>
</table>
{/if}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
</div>
{include file="CRM/Mailing/Form/InsertTokens.tpl"}

View File

@ -0,0 +1,45 @@
{if $action eq 1 or $action eq 2 or $action eq 8}
{include file="CRM/AddressFormat/Form/Address.tpl"}
{else}
<div class="help">
<p>{ts}CiviCRM lets you store multiple postal addFormatress formats, so you can set it to the preferred format of your country{/ts}</p>
</div>
<div class="crm-content-block crm-block">
{if $rows}
<div id="ltype">
<p></p>
<div class="form-item">
{strip}
{include file="CRM/common/jsortable.tpl"}
<table cellpadding="0" cellspacing="0" border="0" class="row-highlight">
<thead class="sticky">
<th>{ts}Country{/ts}</th>
<th>{ts}Address Format{/ts}</th>
<th></th>
</thead>
{foreach from=$rows item=row}
<tr id="address_formats-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}">
<td>{$row.name}</td>
<td class="crm-editable" data-field="format" data-type="textarea">{$row.format}</td>
<td>{$row.action|replace:'xx':$row.id}</td>
</tr>
{/foreach}
</table>
{/strip}
</div>
</div>
{else}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
{ts}None found.{/ts}
</div>
{/if}
{if $action ne 1 and $action ne 2}
<div class="action-link">
{crmButton q="action=add&reset=1" id="newFAddressType" icon="plus-circle"}{ts}Add Address Format{/ts}{/crmButton}
{crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
</div>
{/if}
</div>
{/if}