+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
* $Id$
*
*/
$defaults['amount_granted'] = CRM_Utils_Money::format($defaults['amount_granted'], NULL, '%a');
}
}
+ else {
+ if ($this->_contactID) {
+ $defaults['contact_id'] = $this->_contactID;
+ }
+ }
return $defaults;
}
],
]);
- if ($this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Applicant'), ['create' => TRUE], TRUE);
+ $contactField = $this->addEntityRef('contact_id', ts('Applicant'), ['create' => TRUE], TRUE);
+ if ($this->_context != 'standalone') {
+ $contactField->freeze();
}
}