CRM-17425 Batch PCP: cleanup
authorAndrew Hunt <andrew@aghstrategies.com>
Tue, 20 Oct 2015 16:57:25 +0000 (12:57 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Tue, 20 Oct 2015 17:06:10 +0000 (13:06 -0400)
----------------------------------------
* CRM-17425: Allow PCP selection in contribution batch entry
  https://issues.civicrm.org/jira/browse/CRM-17425

CRM/Batch/Form/Entry.php
templates/CRM/Batch/Form/Entry.js

index 6a09ed9d17013a78f98a2bff12cac82d86cadd5e..e498baf8a39189ffbfdf5f39e530190a402d7cf4 100755 (executable)
@@ -306,8 +306,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
         $errors["soft_credit_amount[$key]"] = ts('Soft credit amount should not be greater than the total amount');
       }
 
-      // TODO: validate for PCP
-
       //membership type is required for membership batch entry
       if ($self->_batchInfo['type_id'] == $batchTypes['Membership']) {
         if (empty($value['membership_type'][1])) {
index 50bcb09f75a950b5cddc9e159696adf65abcaeff..23bf05aef91fc5a6d28fd5afd781384bade9d809 100755 (executable)
@@ -31,6 +31,8 @@ CRM.$(function($) {
     $('#soft_credit_type_'+ rowNum).val($('#sct_default_id').val());
   });
 
+  // Could be replaced if there ever is a PCP API.
+  // See templates/CRM/Contribute/Form/PCP.js.tpl
   var pcpURL = CRM.url('civicrm/ajax/rest', 'className=CRM_Contact_Page_AJAX&fnName=getPCPList&json=1&context=contact&reset=1');
   $('input[name^="pcp_made_through_id"]').each(function() {
     // Figure out the name of the corresponding pcp_made_through[X] field
@@ -58,7 +60,7 @@ CRM.$(function($) {
       }
       $('[name="'+thisMadeThroughName+'"]').val(fieldNameVal.text);
     });
-  })
+  });
 
   $('input[name^="pcp_display_in_roll"]').each(function() {
     showHidePCPRoll(this);