Skip to content
Snippets Groups Projects
Commit 1132eff3 authored by jaapjansma's avatar jaapjansma
Browse files

improved export performance

parent 738c45f0
No related branches found
No related tags found
No related merge requests found
......@@ -77,13 +77,17 @@ class CRM_DataprocessorOutputExport_Form_OutputExport extends CRM_Core_Form {
}
protected function getSelectedIds(): array {
if (!empty($this->selectedIds) && is_array($this->selectedIds)) {
if (is_array($this->selectedIds)) {
return $this->selectedIds;
}
if ($this->searchForm instanceof CRM_DataprocessorSearch_Form_AbstractSearch) {
$this->selectedIds = $this->searchForm->getSelectedIds();
if ($this->searchForm->allRecordsSelected()) {
$this->selectedIds = [];
} else {
$this->selectedIds = $this->searchForm->getSelectedIds();
}
}
if (empty($this->selectedIds)) {
if (!is_array($this->selectedIds)) {
$this->selectedIds = $this->get('entityIds') ?? array();
}
return $this->selectedIds;
......
......@@ -644,4 +644,13 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
return 0;
}
public function allRecordsSelected(): bool {
if (isset($this->_formValues['radio_ts']) && $this->_formValues['radio_ts'] == 'ts_all') {
return true;
} elseif (!$this->usePrevNextCache() && !isset($this->_formValues['radio_ts'])) {
return true;
}
return false;
}
}
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