{* +--------------------------------------------------------------------+ | CiviCRM version 4.4 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2013 | +--------------------------------------------------------------------+ | 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 | +--------------------------------------------------------------------+ *} {** * This file provides the HTML for the on-behalf-of form. * Also used for related contact edit form. * FIXME: This is way more complex than it needs to be * FIXME: About 1% of this javascript is needed for contribution forms * FIXME: Why are we not just using the dynamic form tpl to display this profile? *} {if $buildOnBehalfForm or $onBehalfRequired}
{$fieldSetTitle} {if ( $relatedOrganizationFound or $onBehalfRequired ) and !$organizationName}
{$form.org_option.html}
{/if}
{foreach from=$onBehalfOfFields item=onBehaldField key=fieldName} {if $onBehalfOfFields.$fieldName.skipDisplay} {continue} {/if} {if $onBehalfOfFields.$fieldName.field_type eq "Formatting"} {$onBehalfOfFields.$fieldName.help_pre} {continue} {/if}
{if $onBehalfOfFields.$fieldName.help_pre}   {$onBehalfOfFields.$fieldName.help_pre} {/if} {if ( $fieldName eq 'organization_name' ) and $organizationName}
{$form.onbehalf.$fieldName.label}
{$form.onbehalf.$fieldName.html|crmAddClass:big} ( {ts}Enter a new organization{/ts} )
{ts}Organization details have been prefilled for you. If this is not the organization you want to use, click "Enter a new organization" above.{/ts}
{if $onBehalfOfFields.$fieldName.help_post} {$onBehalfOfFields.$fieldName.help_post} {/if}
{else} {if $onBehalfOfFields.$fieldName.options_per_line}
{$form.onbehalf.$fieldName.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.onbehalf.$fieldName} {if $index < 10} {assign var="index" value=`$index+1`} {else} {if $count == $onBehalfOfFields.$fieldName.options_per_line} {assign var="count" value="1"} {else} {assign var="count" value=`$count+1`} {/if} {/if} {/foreach}
{$form.onbehalf.$fieldName.$key.html}
{/strip} {if $onBehalfOfFields.$fieldName.help_post} {$onBehalfOfFields.$fieldName.help_post} {/if}
{else}
{$form.onbehalf.$fieldName.label}
{$form.onbehalf.$fieldName.html} {if $fieldName eq 'organization_name'}
{ts}Start typing the name of an organization that you have saved previously to use it again. Otherwise click "Enter a new organization" above.{/ts}
{/if} {if !empty($onBehalfOfFields.$fieldName.html_type) && $onBehalfOfFields.$fieldName.html_type eq 'Autocomplete-Select'} {assign var=elementName value=onbehalf[$fieldName]} {include file="CRM/Custom/Form/AutoComplete.tpl" element_name=$elementName} {/if} {if $onBehalfOfFields.$fieldName.name|substr:0:5 eq 'phone'} {assign var="phone_ext_field" value=$onBehalfOfFields.$fieldName.name|replace:'phone':'phone_ext'} {if $form.onbehalf.$phone_ext_field.html}  {$form.onbehalf.$phone_ext_field.html} {/if} {/if} {if $onBehalfOfFields.$fieldName.help_post}
{$onBehalfOfFields.$fieldName.help_post} {/if}
{/if} {/if}
{/foreach}
{$form.mode.html}
{/if} {if empty($snippet)} {literal} {/if}