From: Kurund Jalmi Date: Wed, 1 May 2013 00:26:41 +0000 (-0700) Subject: worked on CRM-12463, fixed add more X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=291f6bec4d88808dde48fe321c61bd0deb120c50;p=civicrm-core.git worked on CRM-12463, fixed add more --- diff --git a/CRM/Contribute/Form/SoftCredit.php b/CRM/Contribute/Form/SoftCredit.php index 14ac883c4f..c4a82a64c9 100644 --- a/CRM/Contribute/Form/SoftCredit.php +++ b/CRM/Contribute/Form/SoftCredit.php @@ -52,8 +52,7 @@ class CRM_Contribute_Form_SoftCredit { $form->_softCredit['item_count'] = 6; for ($rowNumber = 1; $rowNumber <= $form->_softCredit['item_count']; $rowNumber++) { CRM_Contact_Form_NewContact::buildQuickForm($form, $rowNumber, NULL, FALSE, $prefix); - $form->addMoney("{$prefix}amount[{$rowNumber}]", ts('Amount'), FALSE, NULL, TRUE, - "{$prefix}currency[{$rowNumber}]", NULL, TRUE); + $form->addMoney("{$prefix}amount[{$rowNumber}]", ts('Amount')); } $form->assign('rowCount', $form->_softCredit['item_count']); diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index ca2cef2eaf..aa8e405a29 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -353,6 +353,8 @@ {if $customDataSubType} CRM.buildCustomData( '{$customDataType}', {$customDataSubType} ); {/if} + + {if $buildPriceSet}{literal}buildAmount( );{/literal}{/if} {literal} }); diff --git a/templates/CRM/Contribute/Form/SoftCredit.js b/templates/CRM/Contribute/Form/SoftCredit.js index d5b7319388..548c4bcb95 100644 --- a/templates/CRM/Contribute/Form/SoftCredit.js +++ b/templates/CRM/Contribute/Form/SoftCredit.js @@ -19,54 +19,12 @@ cj(function($) { } return false; }); -}); -/* - var url = "{/literal}{$dataUrl}{literal}"; - cj('#soft_credit_to').autocomplete( url, { width : 180, selectFirst : false, matchContains: true - }).result( function(event, data, formatted) { - cj( "#soft_contact_id" ).val( data[1] ); - }); - {/literal} - -// load form during form rule. -{if $buildPriceSet}{literal}buildAmount( );{/literal}{/if} - -{if $siteHasPCPs} - {literal} - var pcpUrl = "{/literal}{$pcpDataUrl}{literal}"; - - cj('#pcp_made_through').autocomplete( pcpUrl, { width : 360, selectFirst : false, matchContains: true + var pcpURL = CRM.url('civicrm/ajax/rest', + 'className=CRM_Contact_Page_AJAX&fnName=getPCPList&json=1&context=contact&reset=1'); + $('#pcp_made_through').autocomplete(pcpURL, + { width : 360, selectFirst : false, matchContains: true }).result( function(event, data, formatted) { cj( "#pcp_made_through_id" ).val( data[1] ); - }); -{/literal} - - {if $pcpLinked} - {literal}hideSoftCredit( );{/literal}{* hide soft credit on load if we have PCP linkage *} - {else} - {literal}cj('#pcpID').hide();{/literal}{* hide PCP section *} - {/if} - - {literal} - function hideSoftCredit ( ){ - cj("#softCreditID").hide(); - } - function showPCP( ) { - cj('#pcpID').show(); - cj("#softCreditID").hide(); - } - function showSoftCredit( ) { - cj('#pcp_made_through_id').val(''); - cj('#pcp_made_through').val(''); - cj('#pcp_roll_nickname').val(''); - cj('#pcp_personal_note').val(''); - cj('#pcp_display_in_roll').attr('checked', false); - cj("#pcpID").hide(); - cj('#softCreditID').show(); - } - {/literal} -{/if} - - -*/ + }); +}); diff --git a/templates/CRM/Contribute/Form/SoftCredit.tpl b/templates/CRM/Contribute/Form/SoftCredit.tpl index 13d0814b0b..53ac6fadc4 100644 --- a/templates/CRM/Contribute/Form/SoftCredit.tpl +++ b/templates/CRM/Contribute/Form/SoftCredit.tpl @@ -35,7 +35,7 @@ prefix="soft_credit_"} - {$form.soft_credit_currency.$blockNo.html|crmAddClass:eight} {$form.soft_credit_amount.$blockNo.html|crmAddClass:eight} + {$form.soft_credit_amount.$rowNumber.label} {$form.soft_credit_amount.$rowNumber.html|crmAddClass:eight} {/section}