<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
/**
protected $_includeSoftCredits = FALSE;
/**
- * Class constructor
+ * Class constructor.
*
* @param array $queryParams
* Array of parameters for query.
}
/**
- * Returns all the rows in the given offset and rowCount
+ * Returns all the rows in the given offset and rowCount.
*
* @param string $action
* The action being performed.
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
while ($result->fetch()) {
+ $links = self::links($componentId,
+ $componentAction,
+ $qfKey,
+ $componentContext
+ );
+ $checkLineItem = FALSE;
$row = array();
+ // Now check for lineItems
+ $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($result->id);
+ foreach ($lineItems as $items) {
+ if (!CRM_Core_Permission::check('view contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ $checkLineItem = TRUE;
+ break;
+ }
+ if (!CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ unset($links[CRM_Core_Action::UPDATE]);
+ break;
+ }
+ if (!CRM_Core_Permission::check('delete contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ unset($links[CRM_Core_Action::DELETE]);
+ break;
+ }
+ }
+ if ($checkLineItem) {
+ continue;
+ }
+ if (!CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($result->financial_type_id))) {
+ unset($links[CRM_Core_Action::UPDATE]);
+ }
+ if (!CRM_Core_Permission::check('delete contributions of type ' . CRM_Contribute_PseudoConstant::financialType($result->financial_type_id))) {
+ unset($links[CRM_Core_Action::DELETE]);
+ }
// the columns we are interested in
foreach (self::$_properties as $property) {
if (property_exists($result, $property)) {
);
$row['action'] = CRM_Core_Action::formLink(
- self::links($componentId,
- $componentAction,
- $qfKey,
- $componentContext
- ),
+ $links,
$mask, $actions,
ts('more'),
FALSE,