$contribution->id = $contributionID;
- if (!CRM_Utils_Rule::currencyCode($contribution->currency)) {
- $config = CRM_Core_Config::singleton();
- $contribution->currency = $config->defaultCurrency;
+ if (empty($contribution->id)) {
+ // (only) on 'create', make sure that a valid currency is set (CRM-16845)
+ if (!CRM_Utils_Rule::currencyCode($contribution->currency)) {
+ $config = CRM_Core_Config::singleton();
+ $contribution->currency = $config->defaultCurrency;
+ }
}
- if ($contributionID && $setPrevContribution) {
- $params['prevContribution'] = self::getValues(array('id' => $contributionID), CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullArray);
- }
-
$result = $contribution->save();
// Add financial_trxn details as part of fix for CRM-4724
+--------------------------------------------------------------------+
*}
{* Callback snippet: Load payment processor *}
-
-{if $snippet}
- {include file="CRM/Core/BillingBlock.tpl"}
- <div id="paypalExpress">
- {* Put PayPal Express button after customPost block since it's the submit button in this case. *}
- {if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
- {assign var=expressButtonName value='_qf_Register_upload_express'}
- <fieldset class="crm-public-form-item crm-group payPalExpress-group">
- <legend>{ts}Checkout with PayPal{/ts}</legend>
- <div class="description">{ts}Click the PayPal button to continue.{/ts}</div>
- <div>{$form.$expressButtonName.html} <span style="font-size:11px; font-family: Arial, Verdana;">Checkout securely. Pay without sharing your financial information. </span>
- </div>
- </fieldset>
- {/if}
- </div>
-{else}
{if $action & 1024}
{include file="CRM/Event/Form/Registration/PreviewHeader.tpl"}
{/if}
{/if}
{if $form.additional_participants.html}
- <div class="crm-section additional_participants-section" id="noOfparticipants">
+ <div class="crm-public-form-item crm-section additional_participants-section" id="noOfparticipants">
- <div class="label">{$form.additional_participants.label}</div>
+ <div class="label">{$form.additional_participants.label} <span class="crm-marker" title="{ts}This field is required.{/ts}">*</span></div>
<div class="content">
{$form.additional_participants.html}{if $contact_id || $contact_id == NULL} ({ts}including yourself{/ts}){/if}
<br/>
</fieldset>
{/if}
- {if $form.payment_processor.label}
+ {if $form.payment_processor_id.label}
- <fieldset class="crm-group payment_options-group" style="display:none;">
+ <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
<legend>{ts}Payment Options{/ts}</legend>
- <div class="crm-public-form-item crm-section payment_processor-section">
- <div class="label">{$form.payment_processor.label}</div>
- <div class="content">{$form.payment_processor.html}</div>
+ <div class="crm-section payment_processor-section">
+ <div class="label">{$form.payment_processor_id.label}</div>
+ <div class="content">{$form.payment_processor_id.html}</div>
<div class="clear"></div>
</div>
</fieldset>
case CRM_Utils_Type::T_TEXT:
case CRM_Utils_Type::T_LONGTEXT:
case CRM_Utils_Type::T_EMAIL:
- $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
- // typecast with array to satisfy changes made in CRM-13160
- if ($entityName == 'MembershipType' && in_array($fieldName, array('relationship_type_id', 'relationship_direction'))) {
- $entity[$fieldName] = (array) $entity[$fieldName];
+ if ($fieldName == 'form_values' && $entityName == 'SavedSearch') {
+ // This is a hack for the SavedSearch API.
+ // It expects form_values to be an array.
+ // If you want to fix this, you should definitely read this forum
+ // post.
+ // http://forum.civicrm.org/index.php/topic,33990.0.html
+ // See also my question on the CiviCRM Stack Exchange:
+ // https://civicrm.stackexchange.com/questions/3437
+ $entity[$fieldName] = array('sort_name' => "SortName2");
+ }
+ else {
+ $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
++ // typecast with array to satisfy changes made in CRM-13160
++ if ($entityName == 'MembershipType' && in_array($fieldName, array(
++ 'relationship_type_id',
++ 'relationship_direction',
++ ))
++ ) {
++ $entity[$fieldName] = (array) $entity[$fieldName];
++ }
}
break;