From: Andrew Hunt Date: Thu, 4 Feb 2016 18:42:30 +0000 (-0500) Subject: CRM-17969 petitions should use common profile block template X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dfd8fe643e2308a5311df7038b52387c9b189a53;p=civicrm-core.git CRM-17969 petitions should use common profile block template ---------------------------------------- * CRM-17969: Free HTML field shows entry box in petitions https://issues.civicrm.org/jira/browse/CRM-17969 --- diff --git a/templates/CRM/Campaign/Form/Petition/Block.tpl b/templates/CRM/Campaign/Form/Petition/Block.tpl deleted file mode 100644 index d11b8acb18..0000000000 --- a/templates/CRM/Campaign/Form/Petition/Block.tpl +++ /dev/null @@ -1,156 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.7 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{* Edit or display Profile fields, when embedded in an online contribution or event registration form. *} -{if ! empty( $fields )} - {strip} - {if $help_pre && $action neq 4}
{$help_pre}
{/if} - {assign var=zeroField value="Initial Non Existent Fieldset"} - {assign var=fieldset value=$zeroField} - {foreach from=$fields item=field key=fieldName} - {if $field.groupTitle != $fieldset} - {if $fieldset != $zeroField} - {if $groupHelpPost && $action neq 4} -
{$groupHelpPost}
- {/if} - {if $mode ne 8} - - {/if} - {/if} - - - {assign var=fieldset value=`$field.groupTitle`} - {assign var=groupHelpPost value=`$field.groupHelpPost`} - {if $field.groupHelpPre && $action neq 4 && $action neq 1028} -
{$field.groupHelpPre}
- {/if} - {/if} - - {assign var=n value=$field.name} - - {if $field.options_per_line != 0} -
- {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_pre && $action neq 4 && $action neq 1028} -   {$field.help_pre} - {/if} -
{$form.$n.label}
-
- {assign var="count" value="1"} - {strip} - - - {* sort by fails for option per line. Added a variable to iterate through the element array*} - {assign var="index" value="1"} - {foreach name=outer key=key item=item from=$form.$n} - {if $index < 10} - {assign var="index" value=`$index+1`} - {else} - - {if $count == $field.options_per_line} - - - {assign var="count" value="1"} - {else} - {assign var="count" value=`$count+1`} - {/if} - {/if} - {/foreach} - -
{$form.$n.$key.html}
- {/strip} - {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_post && $action neq 4 && $action neq 1028} - {$field.help_post} - {/if} -
-
-
- {else} -
- {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_pre && $action neq 4 && $action neq 1028} -   {$field.help_pre} - {/if} -
{$form.$n.label}
-
- {if $n|substr:0:3 eq 'im-'} - {assign var="provider" value=$n|cat:"-provider_id"} - {$form.$provider.html}  - {/if} - {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} - {include file="CRM/Profile/Form/GreetingType.tpl"} - {elseif $n eq 'group'} - - *} -
{$form.$n.html}{* quickform add closing
- {elseif ( $field.data_type eq 'Date' or - ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) ) ) ) } - {include file="CRM/common/jcalendar.tpl" elementName=$n} - {else} - {$form.$n.html} - {/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 = $n} - {/if} - {/if} - {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_post && $action neq 4 && $action neq 1028} -
{$field.help_post} - {/if} -
-
-
- {/if} - {/foreach} - - {if $field.groupHelpPost && $action neq 4 && $action neq 1028} -
{$field.groupHelpPost}
- {/if} - - {if $mode eq 4} -
- {$form.buttons.html} -
- {/if} - - - {if $help_post && $action neq 4}
{$help_post}
{/if} - {/strip} - -{/if} {* fields array is not empty *} - -{literal} - -{/literal} diff --git a/templates/CRM/Campaign/Form/Petition/Signature.tpl b/templates/CRM/Campaign/Form/Petition/Signature.tpl index c073e3b972..c492db7b6b 100644 --- a/templates/CRM/Campaign/Form/Petition/Signature.tpl +++ b/templates/CRM/Campaign/Form/Petition/Signature.tpl @@ -50,11 +50,11 @@ {/if} {else}
- {include file="CRM/Campaign/Form/Petition/Block.tpl" fields=$petitionContactProfile} + {include file="CRM/UF/Form/Block.tpl" fields=$petitionContactProfile hideFieldset=true}
- {include file="CRM/Campaign/Form/Petition/Block.tpl" fields=$petitionActivityProfile} + {include file="CRM/UF/Form/Block.tpl" fields=$petitionActivityProfile hideFieldset=true}
{if $isCaptcha} diff --git a/templates/CRM/UF/Form/Block.tpl b/templates/CRM/UF/Form/Block.tpl index 106e560599..33dcd7519a 100644 --- a/templates/CRM/UF/Form/Block.tpl +++ b/templates/CRM/UF/Form/Block.tpl @@ -43,7 +43,7 @@ {/if} {/if} - {if $mode ne 8 && $action ne 1028 && $action ne 4} + {if $mode ne 8 && $action ne 1028 && $action ne 4 && !$hideFieldset}
{$field.groupTitle} {/if} @@ -171,7 +171,7 @@ {/if} - {if $mode ne 8 && $action neq 1028} + {if $mode ne 8 && $action neq 1028 && !$hideFieldset}
{/if}