$permission = CRM_Core_Permission::getPermission();
- $tasks = array('' => ts('- actions -')) + CRM_Contribute_Task::permissionedTaskTitles($permission);
+ $queryParams = $this->get('queryParams');
+ $softCreditFiltering = FALSE;
+ if (!empty($queryParams)) {
+ $softCreditFiltering = CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled($queryParams);
+ }
+ $tasks = array('' => ts('- actions -')) + CRM_Contribute_Task::permissionedTaskTitles($permission, $softCreditFiltering);
$this->add('select', 'task', ts('Actions:') . ' ', $tasks);
$this->add('submit', $this->_actionButtonName, ts('Go'),
array(
* @return array set of tasks that are valid for the user
* @access public
*/
- static function &permissionedTaskTitles($permission) {
+ static function &permissionedTaskTitles($permission, $softCreditFiltering = FALSE) {
$tasks = array();
if (($permission == CRM_Core_Permission::EDIT)
|| CRM_Core_Permission::check('edit contributions')
$tasks[1] = self::$_tasks[1]['title'];
}
}
+ if ($softCreditFiltering) {
+ unset($tasks[4], $tasks[7]);
+ }
return $tasks;
}