X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FTask%2FStatus.php;h=bc291dc167b35b69b858d193e7b3f584c14628f9;hb=a0741dc66a56012dca28350f8c1ddaad5ec03918;hp=c3f4e9d9e63165f87dc065991d22bd9c86c9cb3a;hpb=fcec889477d4f97b987ae781bd6bb16a7d258c68;p=civicrm-core.git diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index c3f4e9d9e6..bc291dc167 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -40,7 +40,7 @@ class CRM_Contribute_Form_Task_Status extends CRM_Contribute_Form_Task { * Are we operating in "single mode", i.e. updating the task of only * one specific contribution? * - * @var boolean + * @var bool */ public $_single = FALSE; @@ -55,7 +55,7 @@ class CRM_Contribute_Form_Task_Status extends CRM_Contribute_Form_Task { ); if ($id) { - $this->_contributionIds = array($id); + $this->_contributionIds = [$id]; $this->_componentClause = " civicrm_contribution.id IN ( $id ) "; $this->_single = TRUE; $this->assign('totalSelectedContributions', 1); @@ -115,11 +115,11 @@ AND co.id IN ( $contribIDs )"; ); // build a row for each contribution id - $this->_rows = array(); + $this->_rows = []; $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution'); - $defaults = array(); + $defaults = []; $now = date("Y-m-d"); - $paidByOptions = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(); + $paidByOptions = ['' => ts('- select -')] + CRM_Contribute_PseudoConstant::paymentInstrument(); while ($dao->fetch()) { $row['contact_id'] = $dao->contact_id; @@ -131,7 +131,7 @@ AND co.id IN ( $contribIDs )"; $this->addRule("trxn_id_{$row['contribution_id']}", ts('This Transaction ID already exists in the database. Include the account number for checks.'), 'objectExists', - array('CRM_Contribute_DAO_Contribution', $dao->contribution_id, 'trxn_id') + ['CRM_Contribute_DAO_Contribution', $dao->contribution_id, 'trxn_id'] ); $row['fee_amount'] = &$this->add('text', "fee_amount_{$row['contribution_id']}", ts('Fee Amount'), @@ -154,20 +154,19 @@ AND co.id IN ( $contribIDs )"; $this->assign_by_ref('rows', $this->_rows); $this->setDefaults($defaults); - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Update Pending Status'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'back', - 'name' => ts('Cancel'), - ), - ) - ); - - $this->addFormRule(array('CRM_Contribute_Form_Task_Status', 'formRule')); + $this->addButtons([ + [ + 'type' => 'next', + 'name' => ts('Update Pending Status'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'back', + 'name' => ts('Cancel'), + ], + ]); + + $this->addFormRule(['CRM_Contribute_Form_Task_Status', 'formRule']); } /** @@ -180,7 +179,7 @@ AND co.id IN ( $contribIDs )"; * list of errors to be posted back to the form */ public static function formRule($fields) { - $seen = $errors = array(); + $seen = $errors = []; foreach ($fields as $name => $value) { if (strpos($name, 'trxn_id_') !== FALSE) { if ($fields[$name]) { @@ -237,7 +236,7 @@ AND co.id IN ( $contribIDs )"; // for each contribution id, we just call the baseIPN stuff foreach ($form->_rows as $row) { - $input = $ids = $objects = array(); + $input = $ids = $objects = []; $input['component'] = $details[$row['contribution_id']]['component']; $ids['contact'] = $row['contact_id']; @@ -292,7 +291,7 @@ AND co.id IN ( $contribIDs )"; else { $input['trxn_id'] = $contribution->invoice_id; } - $input['trxn_date'] = $params["trxn_date_{$row['contribution_id']}"] . ' ' . date('H:i:s'); + $input['trxn_date'] = $params["trxn_date_{$row['contribution_id']}"] . ' ' . date('H:i:s'); // @todo calling baseIPN like this is a pattern in it's last gasps. Call contribute.completetransaction api. $baseIPN->completeTransaction($input, $ids, $objects, $transaction, FALSE); @@ -323,7 +322,7 @@ LEFT JOIN civicrm_participant_payment pp ON pp.contribution_id = c.id LEFT JOIN civicrm_participant p ON pp.participant_id = p.id WHERE c.id IN ( $contributionIDs )"; - $rows = array(); + $rows = []; $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray ); @@ -333,7 +332,7 @@ WHERE c.id IN ( $contributionIDs )"; $rows[$dao->contribution_id]['contact'] = $dao->contact_id; if ($dao->membership_id) { if (!array_key_exists('membership', $rows[$dao->contribution_id])) { - $rows[$dao->contribution_id]['membership'] = array(); + $rows[$dao->contribution_id]['membership'] = []; } $rows[$dao->contribution_id]['membership'][] = $dao->membership_id; }