Merge pull request #3943 from civicrm/master
[civicrm-core.git] / CRM / Event / Form / ParticipantFeeSelection.php
index abc6018588133809e1d342625db389e9ddeb563c..7ff20fb1ac92e1ec2d55535f496cdaf36343aaf6 100644 (file)
@@ -197,12 +197,13 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
       'isDefault' => TRUE,
     );
 
-    $buttons[] = array(
-      'type' => 'upload',
-      'name' => ts('Save and Record Payment'),
-      'subName' => 'new'
-    );
-
+    if (CRM_Event_BAO_Participant::isPrimaryParticipant($this->_participantId)) {
+      $buttons[] = array(
+        'type' => 'upload',
+        'name' => ts('Save and Record Payment'),
+        'subName' => 'new'
+      );
+    }
     $buttons[] = array(
       'type' => 'cancel',
       'name' => ts('Cancel'),
@@ -212,6 +213,13 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     $this->addFormRule(array('CRM_Event_Form_ParticipantFeeSelection', 'formRule'), $this);
   }
 
+  /**
+   * @param $fields
+   * @param $files
+   * @param $self
+   *
+   * @return array
+   */
   static function formRule($fields, $files, $self) {
     $errors = array();
     return $errors;
@@ -255,6 +263,11 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     }
   }
 
+  /**
+   * @param $params
+   *
+   * @return mixed
+   */
   function emailReceipt(&$params) {
     $updatedLineItem = CRM_Price_BAO_LineItem::getLineItems($this->_participantId, 'participant', NULL, FALSE);
     $lineItem = array();