X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FSearch.php;h=99d3543d587aa6d23baac45adc82e526fe340135;hb=c410490adc68ecf57eae672b4c905731be472925;hp=ead42ffdc1819ec02d833cb8f0a8ce04062f4272;hpb=557f8788cc00ea7b4269c41cdbca49128bf77174;p=civicrm-core.git diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index ead42ffdc1..99d3543d58 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -1,7 +1,7 @@ _searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -223,9 +214,8 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { } function setDefaultValues() { - if (!CRM_Utils_Array::value('contribution_status', - $this->_defaults - )) { + if (empty($this->_defaults +['contribution_status'])) { $this->_defaults['contribution_status'][1] = 1; } return $this->_defaults; @@ -253,17 +243,16 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { // multiselect for groups if ($this->_group) { $this->add('select', 'group', ts('Groups'), $this->_group, FALSE, - array('id' => 'group', 'multiple' => 'multiple', 'title' => ts('- select -')) + array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2') ); } // multiselect for tags - require_once 'CRM/Core/BAO/Tag.php'; $contactTags = CRM_Core_BAO_Tag::getTags(); if ($contactTags) { $this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE, - array('id' => 'contact_tags', 'multiple' => 'multiple', 'title' => ts('- select -')) + array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2') ); } @@ -281,12 +270,12 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { 'toggleSelect', NULL, NULL, - array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);") + array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows') ); foreach ($rows as $row) { $this->addElement('checkbox', $row['checkbox'], NULL, NULL, - array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');") + array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row') ); } } @@ -295,7 +284,12 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { $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( @@ -305,16 +299,9 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); - $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); + $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );")); } // add buttons @@ -358,8 +345,8 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { $this->fixFormValues(); - // we don't show test contributions in Contact Summary / User Dashboard - if (empty($this->_formValues['contribution_test']) && $this->_single) { + // We don't show test records in summaries or dashboards + if (empty($this->_formValues['contribution_test']) && $this->_force) { $this->_formValues["contribution_test"] = 0; } @@ -371,6 +358,15 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { } $config = CRM_Core_Config::singleton(); + // CRM-13848 + $financialType = CRM_Utils_Array::value('financial_type_id', $this->_formValues); + if ($financialType && is_array($financialType)) { + unset($this->_formValues['financial_type_id']); + foreach($financialType as $notImportant => $typeID) { + $this->_formValues['financial_type_id'][$typeID] = 1; + } + } + $tags = CRM_Utils_Array::value('contact_tags', $this->_formValues); if ($tags && !is_array($tags)) { unset($this->_formValues['contact_tags']); @@ -380,7 +376,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { if ($tags && is_array($tags)) { unset($this->_formValues['contact_tags']); foreach($tags as $notImportant => $tagID) { - $this->_formValues['contact_tags'][$tagID] = 1; + $this->_formValues['contact_tags'][$tagID] = 1; } } @@ -395,7 +391,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { if ($group && is_array($group)) { unset($this->_formValues['group']); foreach($group as $notImportant => $groupID) { - $this->_formValues['group'][$groupID] = 1; + $this->_formValues['group'][$groupID] = 1; } } @@ -409,7 +405,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values