diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 72bd332241c6..cd8e06fb05cf 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -229,7 +229,7 @@ public function preProcess() { } // this was used prior to the cleverer this_>getContactID - unsure now - $this->_userID = CRM_Core_Session::singleton()->get('userID'); + $this->_userID = CRM_Core_Session::singleton()->getLoggedInContactID(); $this->_contactID = $this->_membershipContactID = $this->getContactID(); $this->_mid = NULL; diff --git a/templates/CRM/UF/Form/Fields.tpl b/templates/CRM/UF/Form/Fields.tpl index 7e1b872d07eb..155a936da111 100644 --- a/templates/CRM/UF/Form/Fields.tpl +++ b/templates/CRM/UF/Form/Fields.tpl @@ -2,6 +2,14 @@ {if $field.skipDisplay} {continue} {/if} + + {assign var=profileFieldName value=$field.name} + {if $prefix} + {assign var="formElement" value=$form.$prefix.$profileFieldName} + {else} + {assign var="formElement" value=$form.$profileFieldName} + {/if} + {if $field.groupTitle != $fieldset} {if $fieldset != $zeroField} {if $groupHelpPost && $action neq 4} @@ -26,8 +34,6 @@ {/if} {/if} - {assign var=profileFieldName value=$field.name} - {if $field.field_type eq "Formatting"} {if $action neq 4 && $action neq 1028} {$field.help_pre} @@ -41,19 +47,15 @@ {/if} {if $field.options_per_line != 0}
-
{if $prefix}{$form.$prefix.$profileFieldName.label}{else}{$form.$profileFieldName.label}{/if}
+
{$formElement.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"} - {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`} @@ -77,7 +79,7 @@ {else}
- {if $prefix}{$form.$prefix.$profileFieldName.label}{else}{$form.$profileFieldName.label}{/if} + {$formElement.label}
{if $profileFieldName|substr:0:3 eq 'im-'} @@ -91,15 +93,15 @@ {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$profileFieldName title=null context="profile"} {elseif $field.is_datetime_field && $action & 4} - {$form.$profileFieldName.value|crmDate:$field.smarty_view_format} + {$formElement.value|crmDate:$field.smarty_view_format} {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} + {$formElement.html} {if $form.$phone_ext_field.html}  {$form.$phone_ext_field.html} {/if} @@ -111,12 +113,12 @@ {if $field.html_type eq 'File' && $viewOnlyPrefixFileValues} {$viewOnlyPrefixFileValues.$prefix.$profileFieldName} {else} - {$form.$prefix.$profileFieldName.html} + {$formElement.html} {/if} {elseif $field.html_type eq 'File' && $viewOnlyFileValues} {$viewOnlyFileValues.$profileFieldName} {else} - {$form.$profileFieldName.html} + {$formElement.html} {/if} {/if}