CRM-12463
authoryashodha <yashodha.chaku@webaccess.co.in>
Tue, 30 Apr 2013 18:39:09 +0000 (00:09 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Tue, 30 Apr 2013 18:39:09 +0000 (00:09 +0530)
CRM/Contribute/Form/SoftCredit.php
templates/CRM/Contribute/Form/SoftCredit.tpl

index dc4ffa7b58ed62af6eb495b0ce50dc92e15178f1..01b3c6b8111fa212cd2807d4415de762d5cea91e 100644 (file)
@@ -47,10 +47,13 @@ class CRM_Contribute_Form_SoftCredit {
    * @return void
    */
   static function buildQuickForm(&$form) {
+    $prefix = 'soft_credit_';
+    $form->_softCredit['item_count'] = 10;
     for ($rowNumber = 1; $rowNumber <= $form->_softCredit['item_count']; $rowNumber++) {
-      CRM_Contact_Form_NewContact::buildQuickForm($form, $rowNumber, NULL, TRUE, 'soft_credit_');
+      CRM_Contact_Form_NewContact::buildQuickForm($form, $rowNumber, NULL, FALSE, $prefix);
+      $form->add('text', "{$prefix}contact[{$rowNumber}][amount]");
     }
-
+    
     // If we have a contact for this contribution, pass cid= to the dataUrl to exclude current contact from autocomplete results
     if ($form->_contactID) {
       $dataUrl = CRM_Utils_System::url('civicrm/ajax/rest',
index 27ba3801e1b3e9e7346462de6dc149ffd05ee5bf..42213b893e0162f0b3ddffb6328ed4892b3512b2 100644 (file)
@@ -24,7 +24,9 @@
  +--------------------------------------------------------------------+
 *}
 {* template for adding form elements for soft credit form*}
-  <tr id="softCreditID" class="crm-contribution-form-block-soft_credit_to"><td class="label">{$form.soft_credit_to.label}</td>
+
+  {include file="CRM/Contact/Form/NewContact.tpl"}
+{*  <tr id="softCreditID" class="crm-contribution-form-block-soft_credit_to"><td class="label">{$form.soft_credit_to.label}</td>
     <td {$valueStyle}>
       {$form.soft_credit_to.html} {help id="id-soft_credit"}
       {if $siteHasPCPs}
@@ -32,7 +34,7 @@
       {/if}
     </td>
   </tr>
-    {if $siteHasPCPs}{* Credit contribution to PCP. *}
+    {if $siteHasPCPs}
     <tr id="pcpID" class="crm-contribution-form-block-pcp_made_through_id">
       <td class="label">{$form.pcp_made_through.label}</td>
       <td>
@@ -61,7 +63,7 @@
       </td>
     </tr>
     {/if}
-
+*}
  {literal}
  <script type="text/javascript">
  var url = "{/literal}{$dataUrl}{literal}";