{* +--------------------------------------------------------------------+ | CiviCRM version 4.5 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | 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 | +--------------------------------------------------------------------+ *} {capture assign=infoTitle}{ts}Preview Mode{/ts}{/capture} {assign var="infoType" value="info"} {if $preview_type eq 'group'} {capture assign=infoMessage}{ts}Showing the custom data group (fieldset) as it will be displayed within an edit form.{/ts}{/capture} {capture name=legend} {foreach from=$groupTree item=fieldName} {$fieldName.title} {/foreach} {/capture} {else} {capture assign=infoMessage}{ts}Showing this field as it will be displayed in an edit form.{/ts}{/capture} {/if} {include file="CRM/common/info.tpl"}
{strip} {foreach from=$groupTree item=cd_edit key=group_id}

{if $preview_type eq 'group'}{$smarty.capture.legend}{/if} {if $cd_edit.help_pre}
{$cd_edit.help_pre}

{/if} {foreach from=$cd_edit.fields item=element key=field_id} {if $element.is_view eq 0}{* fix for CRM-2699 *} {if $element.help_pre} {/if} {if $element.options_per_line } {*assign var="element_name" value=$element.custom_group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*} {assign var="element_name" value=$element.element_name} {else} {assign var="name" value=`$element.name`} {*assign var="element_name" value=$group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*} {assign var="element_name" value=$element.element_name} {/if} {/if} {/foreach}
{$element.help_pre}
{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if} {assign var="count" value="1"} {* 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.$element_name} {if $index < 10} {assign var="index" value=`$index+1`} {else} {if $count == $element.options_per_line} {assign var="count" value="1"} {else} {assign var="count" value=`$count+1`} {/if} {/if} {/foreach}
{$form.$element_name.$key.html}
{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if} {if $element.data_type neq 'Date'} {$form.$element_name.html}  {elseif $element.skip_calendar NEQ true } {include file="CRM/common/jcalendar.tpl" elementName=$element_name} {/if} {if $element.html_type eq 'Autocomplete-Select'} {if $element.data_type eq 'ContactReference'} {include file="CRM/Custom/Form/ContactReference.tpl"} {/if} {/if}
{if $cd_edit.help_post}
{$cd_edit.help_post}
{/if}
{/foreach} {/strip}
{include file="CRM/common/formButtons.tpl" location="bottom"}