Contribution Pages - Allow checksum contact to select employer
authorColeman Watts <coleman@civicrm.org>
Thu, 1 May 2014 18:50:18 +0000 (11:50 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 1 May 2014 18:50:18 +0000 (11:50 -0700)
CRM/Contribute/Form/Contribution/OnBehalfOf.php
CRM/Contribute/Form/ContributionBase.php

index bde03401571c15a928690a7be9390de7f40f86df..7da9e8cae43ff268379e83480831a58ba844cd35 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf {
    */
   static function preProcess(&$form) {
     $session = CRM_Core_Session::singleton();
-    $contactID = $session->get('userID');
+    $contactID = $form->_contactID;
 
     $ufJoinParams = array(
       'module' => 'onBehalf',
@@ -117,8 +117,7 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf {
     $form->assign('fieldSetTitle', ts('Organization Details'));
     $form->assign('buildOnBehalfForm', TRUE);
 
-    $session = CRM_Core_Session::singleton();
-    $contactID = $session->get('userID');
+    $contactID = $form->_contactID;
 
     if ($contactID && count($form->_employers) >= 1) {
       $form->add('text', 'organization_id', ts('Select an existing related Organization OR enter a new one'));
index f4d409e18ad368f4324fdb130ba5e8af667510c4..36a6913f853f61683cb8a27e1fc6ef1e93813f6a 100644 (file)
@@ -155,9 +155,9 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
   /**
    * The contact id of the person for whom membership is being added or renewed based on the cid in the url,
    * checksum, or session
-   * @var unknown_type
+   * @var int
    */
-  protected $_contactID;
+  public $_contactID;
 
   protected $_userID;