<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
*/
public function preProcess() {
$id = $this->get('id');
- $params = array('id' => $id);
+ $params = ['id' => $id];
$context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this);
$this->assign('context', $context);
$this->assign('canDelete', TRUE);
}
if (!CRM_Core_Permission::check('view contributions of type ' . $financialTypeID)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}
elseif ($this->_action & CRM_Core_Action::VIEW) {
if (!empty($values['contribution_recur_id'])) {
$sql = "SELECT installments, frequency_interval, frequency_unit FROM civicrm_contribution_recur WHERE id = %1";
- $params = array(1 => array($values['contribution_recur_id'], 'Integer'));
+ $params = [1 => [$values['contribution_recur_id'], 'Integer']];
$dao = CRM_Core_DAO::executeQuery($sql, $params);
if ($dao->fetch()) {
$values['recur_installments'] = $dao->installments;
// show billing address location details, if exists
if (!empty($values['address_id'])) {
- $addressParams = array('id' => CRM_Utils_Array::value('address_id', $values));
+ $addressParams = ['id' => CRM_Utils_Array::value('address_id', $values)];
$addressDetails = CRM_Core_BAO_Address::getValues($addressParams, FALSE, 'id');
$addressDetails = array_values($addressDetails);
$values['billing_address'] = $addressDetails[0]['display'];
$this->assign($name, $value);
}
- $lineItems = array();
+ $lineItems = [];
$displayLineItems = FALSE;
if ($id) {
- $lineItems = array(CRM_Price_BAO_LineItem::getLineItemsByContributionID(($id)));
+ $lineItems = [CRM_Price_BAO_LineItem::getLineItemsByContributionID(($id))];
$firstLineItem = reset($lineItems[0]);
if (empty($firstLineItem['price_set_id'])) {
// CRM-20297 All we care is that it's not QuickConfig, so no price set
}
else {
try {
- $priceSet = civicrm_api3('PriceSet', 'getsingle', array(
+ $priceSet = civicrm_api3('PriceSet', 'getsingle', [
'id' => $firstLineItem['price_set_id'],
'return' => 'is_quick_config, id',
- ));
+ ]);
$displayLineItems = !$priceSet['is_quick_config'];
}
catch (CiviCRM_API3_Exception $e) {
$title = $displayName . ' - (' . CRM_Utils_Money::format($values['total_amount'], $values['currency']) . ' ' . ' - ' . $values['financial_type'] . ')';
- $recentOther = array();
+ $recentOther = [];
if (CRM_Core_Permission::checkActionPermission('CiviContribute', CRM_Core_Action::UPDATE)) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/view/contribution',
"action=update&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home"
$recentOther
);
$contributionStatus = $status[$values['contribution_status_id']];
- if (in_array($contributionStatus, array('Partially paid', 'Pending refund'))
+ if (in_array($contributionStatus, ['Partially paid', 'Pending refund'])
|| ($contributionStatus == 'Pending' && $values['is_pay_later'])
) {
if ($contributionStatus == 'Pending refund') {
* Build the form object.
*/
public function buildQuickForm() {
- $this->addButtons(array(
- array(
+ $this->addButtons([
+ [
'type' => 'cancel',
'name' => ts('Done'),
'spacing' => ' ',
'isDefault' => TRUE,
- ),
- ));
+ ],
+ ]);
}
/**
*
* @param int $id
*
- * @return string $title
+ * @return string
* Block title.
*/
protected function assignPaymentInfoBlock($id) {