forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request civicrm#9830 from eileenmcnaughton/cust_date_nfc
[nfc] refactoring towards CRM-19490
- Loading branch information
Showing
5 changed files
with
146 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{foreach from=$fields item=field key=fieldName} | ||
{if $field.skipDisplay} | ||
{continue} | ||
{/if} | ||
{if $field.groupTitle != $fieldset} | ||
{if $fieldset != $zeroField} | ||
{if $groupHelpPost && $action neq 4} | ||
<div class="messages help">{$groupHelpPost}</div> | ||
{/if} | ||
{if $mode ne 8} | ||
</fieldset> | ||
{/if} | ||
{/if} | ||
|
||
{if $mode ne 8 && $action ne 1028 && $action ne 4 && !$hideFieldset} | ||
<fieldset class="crm-profile crm-profile-id-{$field.group_id} crm-profile-name-{$field.groupName}"><legend>{$field.groupTitle}</legend> | ||
{/if} | ||
|
||
{if ($form.formName eq 'Confirm' OR $form.formName eq 'ThankYou') AND $prefix neq 'honor'} | ||
<div class="header-dark">{$field.groupTitle} </div> | ||
{/if} | ||
{assign var=fieldset value=`$field.groupTitle`} | ||
{assign var=groupHelpPost value=`$field.groupHelpPost`} | ||
{if $field.groupHelpPre && $action neq 4 && $action neq 1028} | ||
<div class="messages help">{$field.groupHelpPre}</div> | ||
{/if} | ||
{/if} | ||
|
||
{assign var=profileFieldName value=$field.name} | ||
|
||
{if $field.field_type eq "Formatting"} | ||
{if $action neq 4 && $action neq 1028} | ||
{$field.help_pre} | ||
{/if} | ||
{elseif $profileFieldName} | ||
{* Show explanatory text for field if not in 'view' or 'preview' modes *} | ||
{if $field.help_pre && $action neq 4 && $action neq 1028} | ||
<div class="crm-section helprow-{$profileFieldName}-section helprow-pre" id="helprow-{$profileFieldName}"> | ||
<div class="content description">{$field.help_pre}</div> | ||
</div> | ||
{/if} | ||
{if $field.options_per_line != 0} | ||
<div class="crm-section editrow_{$profileFieldName}-section form-item" id="editrow-{$profileFieldName}"> | ||
<div class="label option-label">{if $prefix}{$form.$prefix.$profileFieldName.label}{else}{$form.$profileFieldName.label}{/if}</div> | ||
<div class="content 3"> | ||
{assign var="count" value="1"} | ||
{strip} | ||
<table class="form-layout-compressed"> | ||
<tr> | ||
{* sort by fails for option per line. Added a variable to iterate through the element array*} | ||
{assign var="index" value="1"} | ||
{if $prefix} | ||
{assign var="formElement" value=$form.$prefix.$profileFieldName} | ||
{else} | ||
{assign var="formElement" value=$form.$profileFieldName} | ||
{/if} | ||
{foreach name=outer key=key item=item from=$formElement} | ||
{if $index < 10} | ||
{assign var="index" value=`$index+1`} | ||
{else} | ||
<td class="labels font-light">{$formElement.$key.html}</td> | ||
{if $count == $field.options_per_line} | ||
</tr> | ||
<tr> | ||
{assign var="count" value="1"} | ||
{else} | ||
{assign var="count" value=`$count+1`} | ||
{/if} | ||
{/if} | ||
{/foreach} | ||
</tr> | ||
</table> | ||
{/strip} | ||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
{else} | ||
<div class="crm-section editrow_{$profileFieldName}-section form-item" id="editrow-{$profileFieldName}"> | ||
<div class="label"> | ||
{if $prefix}{$form.$prefix.$profileFieldName.label}{else}{$form.$profileFieldName.label}{/if} | ||
</div> | ||
<div class="content"> | ||
{if $profileFieldName|substr:0:3 eq 'im-'} | ||
{assign var="provider" value=profileFieldNamen|cat:"-provider_id"} | ||
{$form.$provider.html} | ||
{/if} | ||
|
||
{if $profileFieldName eq 'email_greeting' or $profileFieldName eq 'postal_greeting' or $profileFieldName eq 'addressee'} | ||
{include file="CRM/Profile/Form/GreetingType.tpl"} | ||
{elseif ($profileFieldName eq 'group' && $form.group) || ($profileFieldName eq 'tag' && $form.tag)} | ||
{include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$profileFieldName title=null context="profile"} | ||
{elseif ( $profileFieldName|substr:-5:5 eq '_date' ) AND | ||
( $form.formName neq 'Confirm' ) AND | ||
( $form.formName neq 'ThankYou' ) } | ||
{include file="CRM/common/jcalendar.tpl" elementName=$profileFieldName} | ||
{elseif ( $profileFieldName|substr:-5:5 eq '_date' ) } | ||
{assign var="date_value" value=$form.$profileFieldName.value} | ||
<span class="crm-frozen-field"> | ||
{$date_value|date_format:"%Y-%m-%d"|crmDate:$config->dateformatshortdate} | ||
<input type="hidden" name="{$form.$profileFieldName.name}" value="{$form.$profileFieldName.value}" id="{$form.$profileFieldName.name}"> | ||
</span> | ||
{elseif $profileFieldName|substr:0:5 eq 'phone'} | ||
{assign var="phone_ext_field" value=$profileFieldName|replace:'phone':'phone_ext'} | ||
{if $prefix}{$form.$prefix.$profileFieldName.html}{else}{$form.$profileFieldName.html}{/if} | ||
{if $form.$phone_ext_field.html} | ||
{$form.$phone_ext_field.html} | ||
{/if} | ||
{else} | ||
{if $prefix} | ||
{if $profileFieldName eq 'organization_name' && !empty($form.onbehalfof_id)} | ||
{$form.onbehalfof_id.html} | ||
{/if} | ||
{if $field.html_type eq 'File' && $viewOnlyPrefixFileValues} | ||
{$viewOnlyPrefixFileValues.$prefix.$profileFieldName} | ||
{else} | ||
{$form.$prefix.$profileFieldName.html} | ||
{/if} | ||
{elseif $field.html_type eq 'File' && $viewOnlyFileValues} | ||
{$viewOnlyFileValues.$profileFieldName} | ||
{else} | ||
{$form.$profileFieldName.html} | ||
{/if} | ||
{/if} | ||
|
||
{*CRM-4564*} | ||
{if $field.html_type eq 'Autocomplete-Select'} | ||
{if $field.data_type eq 'ContactReference'} | ||
{include file="CRM/Custom/Form/ContactReference.tpl" element_name = $profileFieldName} | ||
{/if} | ||
{/if} | ||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
{/if} | ||
{* Show explanatory text for field if not in 'view' or 'preview' modes *} | ||
{if $field.help_post && $action neq 4 && $action neq 1028} | ||
<div class="crm-section helprow-{$profileFieldName}-section helprow-post" id="helprow-{$profileFieldName}"> | ||
<div class="content description">{$field.help_post}</div> | ||
</div> | ||
{/if} | ||
{/if} | ||
{/foreach} |
Oops, something went wrong.