Skip to content

Commit

Permalink
CRM-21580 Get exportStatusId using api
Browse files Browse the repository at this point in the history
  • Loading branch information
JO0st committed Dec 26, 2017
1 parent f06b38e commit 7d68c10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CRM/Financial/Form/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ public function preProcess() {
$this->_batchIds = $this->_id;
}

$allBatchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
$this->_exportStatusId = CRM_Utils_Array::key('Exported', $allBatchStatus);
$this->_exportStatusId = civicrm_api3('OptionValue', 'getValue', array(
'option_group_id' => 'batch_status',
'name' => 'Exported',
'return' => 'value',
))['result'];

// check if batch status is valid, do not allow exported batches to export again
$batchStatus = CRM_Batch_BAO_Batch::getBatchStatuses($this->_batchIds);
Expand Down

0 comments on commit 7d68c10

Please sign in to comment.