Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-08-12-15-44-44
[civicrm-core.git] / templates / CRM / Contribute / Form / SoftCredit.tpl
index d78bdb1f89729f929f95505007c7ef8f3b1a33c0..a1780524e82adc8a0ff9d6c65c3d4d5b82845d12 100644 (file)
       return false;
     });
 
-    // FIXME: This could be much simpler as an entityRef field but pcp doesn't have a searchable api :(
-    var pcpURL = CRM.url('civicrm/ajax/rest', 'className=CRM_Contact_Page_AJAX&fnName=getPCPList&json=1&context=contact&reset=1');
-    $('#pcp_made_through_id').crmSelect2({
-      placeholder: {/literal}'{ts escape="js"}- select -{/ts}'{literal},
-      minimumInputLength: 1,
-      ajax: {
-        url: pcpURL,
-        data: function(term) {
-          return {term: term};
-        },
-        results: function(response) {
-          return {results: response};
-        }
-      },
-      initSelection: function(el, callback) {
-        callback({id: $(el).val(), text: $('[name=pcp_made_through]', $form).val()});
-      }
-    })
-      // This is just a cheap trick to store the name in case of a formrule error
-      .on('change', function() {
-        $('[name=pcp_made_through]', $form).val($(this).select2('data').text || '');
-      });
-
     $('.crm-soft-credit-block tr span').each(function () {
       if ($(this).hasClass('crm-error')) {
         $(this).parents('tr').show();