Skip to content
Snippets Groups Projects
Commit d8753da5 authored by mattwire's avatar mattwire
Browse files

Search tasks (eg. Export) work with Member,Contribute,Participant,Case...

Search tasks (eg. Export) work with Member,Contribute,Participant,Case (already worked with activity)
parent 6089c730
No related branches found
No related tags found
1 merge request!35Search tasks (eg. Export) work with Member,Contribute,Participant,Case...
...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_ContributionSearch extends CRM_Core_Con ...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_ContributionSearch extends CRM_Core_Con
public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) {
parent::__construct($title, $modal); parent::__construct($title, $modal);
$this->set('component_mode', CRM_Contact_BAO_Query::MODE_CONTRIBUTE);
$this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_ContributionSearch($this, $action); $this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_ContributionSearch($this, $action);
// create and instantiate the pages // create and instantiate the pages
......
...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_MembershipSearch extends CRM_Core_Contr ...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_MembershipSearch extends CRM_Core_Contr
public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) {
parent::__construct($title, $modal); parent::__construct($title, $modal);
$this->set('component_mode', CRM_Contact_BAO_Query::MODE_MEMBER);
$this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_MembershipSearch($this, $action); $this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_MembershipSearch($this, $action);
// create and instantiate the pages // create and instantiate the pages
......
...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_ParticipantSearch extends CRM_Core_Cont ...@@ -26,6 +26,7 @@ class CRM_DataprocessorSearch_Controller_ParticipantSearch extends CRM_Core_Cont
public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) {
parent::__construct($title, $modal); parent::__construct($title, $modal);
$this->set('component_mode', CRM_Contact_BAO_Query::MODE_EVENT);
$this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_ParticipantSearch($this, $action); $this->_stateMachine = new CRM_DataprocessorSearch_StateMachine_ParticipantSearch($this, $action);
// create and instantiate the pages // create and instantiate the pages
......
...@@ -46,6 +46,20 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce ...@@ -46,6 +46,20 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
*/ */
protected $currentUrl; protected $currentUrl;
/**
* The params that are sent to the query.
*
* @var array
*/
protected $_queryParams;
/**
* The array of entity IDs from the form
*
* @var array
*/
protected $entityIDs;
/** /**
* Returns the name of the ID field in the dataset. * Returns the name of the ID field in the dataset.
* *
......
...@@ -8,16 +8,6 @@ use CRM_Dataprocessor_ExtensionUtil as E; ...@@ -8,16 +8,6 @@ use CRM_Dataprocessor_ExtensionUtil as E;
class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearch_Form_AbstractSearch { class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearch_Form_AbstractSearch {
/**
* The params that are sent to the query.
*
* @var array
*/
protected $_queryParams;
protected $activity_ids;
/** /**
* Returns the name of the default Entity * Returns the name of the default Entity
* *
...@@ -120,12 +110,12 @@ class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearc ...@@ -120,12 +110,12 @@ class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearc
* *
*/ */
protected function alterRows(&$rows, $ids) { protected function alterRows(&$rows, $ids) {
$this->activity_ids = $ids; $this->entityIDs = $ids;
$this->_queryParams[0] = array( $this->_queryParams[0] = array(
'activity_id', 'activity_id',
'=', '=',
array( array(
'IN' => $this->activity_ids, 'IN' => $this->entityIDs,
), ),
0, 0,
0 0
...@@ -133,4 +123,4 @@ class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearc ...@@ -133,4 +123,4 @@ class CRM_DataprocessorSearch_Form_ActivitySearch extends CRM_DataprocessorSearc
$this->controller->set('queryParams', $this->_queryParams); $this->controller->set('queryParams', $this->_queryParams);
} }
} }
\ No newline at end of file
...@@ -141,4 +141,29 @@ class CRM_DataprocessorSearch_Form_CaseSearch extends CRM_DataprocessorSearch_Fo ...@@ -141,4 +141,29 @@ class CRM_DataprocessorSearch_Form_CaseSearch extends CRM_DataprocessorSearch_Fo
return $hiddenFields; return $hiddenFields;
} }
} /**
\ No newline at end of file * Return altered rows
*
* Save the ids into the queryParams value. So that when an action is done on the selected record
* or on all records, the queryParams will hold all the activity ids so that in the next step only the selected record, or the first
* 50 records are populated.
*
* @param array $rows
* @param array $ids
*
*/
protected function alterRows(&$rows, $ids) {
$this->entityIDs = $ids;
$this->_queryParams[0] = array(
'case_id',
'=',
array(
'IN' => $this->entityIDs,
),
0,
0
);
$this->controller->set('queryParams', $this->_queryParams);
}
}
...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_ContributionSearch extends CRM_DataprocessorS ...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_ContributionSearch extends CRM_DataprocessorS
return $this->_taskList; return $this->_taskList;
} }
/**
* Return altered rows
*
* Save the ids into the queryParams value. So that when an action is done on the selected record
* or on all records, the queryParams will hold all the activity ids so that in the next step only the selected record, or the first
* 50 records are populated.
*
* @param array $rows
* @param array $ids
*
*/
protected function alterRows(&$rows, $ids) {
$this->entityIDs = $ids;
$this->_queryParams[0] = array(
'contribution_id',
'=',
array(
'IN' => $this->entityIDs,
),
0,
0
);
$this->controller->set('queryParams', $this->_queryParams);
}
} }
...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_MembershipSearch extends CRM_DataprocessorSea ...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_MembershipSearch extends CRM_DataprocessorSea
return $this->_taskList; return $this->_taskList;
} }
/**
* Return altered rows
*
* Save the ids into the queryParams value. So that when an action is done on the selected record
* or on all records, the queryParams will hold all the activity ids so that in the next step only the selected record, or the first
* 50 records are populated.
*
* @param array $rows
* @param array $ids
*
*/
protected function alterRows(&$rows, $ids) {
$this->entityIDs = $ids;
$this->_queryParams[0] = array(
'membership_id',
'=',
array(
'IN' => $this->entityIDs,
),
0,
0
);
$this->controller->set('queryParams', $this->_queryParams);
}
} }
...@@ -16,7 +16,7 @@ class CRM_DataprocessorSearch_Form_ParticipantSearch extends CRM_DataprocessorSe ...@@ -16,7 +16,7 @@ class CRM_DataprocessorSearch_Form_ParticipantSearch extends CRM_DataprocessorSe
public function getDefaultEntity() { public function getDefaultEntity() {
return 'Contact'; return 'Contact';
} }
/** /**
* Returns the url for view of the record action * Returns the url for view of the record action
* *
...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_ParticipantSearch extends CRM_DataprocessorSe ...@@ -107,4 +107,29 @@ class CRM_DataprocessorSearch_Form_ParticipantSearch extends CRM_DataprocessorSe
return $this->_taskList; return $this->_taskList;
} }
} /**
\ No newline at end of file * Return altered rows
*
* Save the ids into the queryParams value. So that when an action is done on the selected record
* or on all records, the queryParams will hold all the activity ids so that in the next step only the selected record, or the first
* 50 records are populated.
*
* @param array $rows
* @param array $ids
*
*/
protected function alterRows(&$rows, $ids) {
$this->entityIDs = $ids;
$this->_queryParams[0] = array(
'participant_id',
'=',
array(
'IN' => $this->entityIDs,
),
0,
0
);
$this->controller->set('queryParams', $this->_queryParams);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment