Merge pull request #5680 from elinw/restauthenticationjoomla
[civicrm-core.git] / CRM / Contribute / Form / SoftCredit.php
index cfaca3e08f84354e8eb6f9d0fb4c1a851028d82f..3c1f3016a0ee7c62fb3ed5471e47152db98545dd 100644 (file)
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
- * This class build form elements for select existing or create new soft block
+ * This class build form elements for select existing or create new soft block.
  */
 class CRM_Contribute_Form_SoftCredit {
 
@@ -74,7 +72,7 @@ class CRM_Contribute_Form_SoftCredit {
    * @return void
    */
   public static function buildQuickForm(&$form) {
-    if ($form->_mode == 'live' && !empty($form->_honor_block_is_active)) {
+    if (!empty($form->_honor_block_is_active)) {
       $ufJoinDAO = new CRM_Core_DAO_UFJoin();
       $ufJoinDAO->module = 'soft_credit';
       $ufJoinDAO->entity_id = $form->_id;
@@ -145,8 +143,10 @@ class CRM_Contribute_Form_SoftCredit {
     $siteHasPCPs = CRM_Contribute_PseudoConstant::pcPage();
     if (!CRM_Utils_Array::crmIsEmptyArray($siteHasPCPs)) {
       $form->assign('siteHasPCPs', 1);
-      $form->add('hidden', 'pcp_made_through'); // stores the label
-      $form->add('text', 'pcp_made_through_id', ts('Credit to a Personal Campaign Page'), array('class' => 'twenty'));
+      // Fixme: Not a true entityRef field. Relies on PCP.js.tpl
+      $form->add('text', 'pcp_made_through_id', ts('Credit to a Personal Campaign Page'), array('class' => 'twenty', 'placeholder' => ts('- select -')));
+      // stores the label
+      $form->add('hidden', 'pcp_made_through');
       $form->addElement('checkbox', 'pcp_display_in_roll', ts('Display in Honor Roll?'), NULL);
       $form->addElement('text', 'pcp_roll_nickname', ts('Name (for Honor Roll)'));
       $form->addElement('textarea', 'pcp_personal_note', ts('Personal Note (for Honor Roll)'));