public function preProcess() {
$this->skipOnHold = $this->skipDeceased = FALSE;
CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
- // store case id if present
- $this->_caseId = CRM_Utils_Request::retrieve('caseid', 'CommaSeparatedIntegers', $this, FALSE);
- if (!empty($this->_caseId) && strpos($this->_caseId, ',')) {
- $this->_caseIds = explode(',', $this->_caseId);
- unset($this->_caseId);
- }
-
- // retrieve contact ID if this is 'single' mode
- $cid = CRM_Utils_Request::retrieve('cid', 'CommaSeparatedIntegers', $this, FALSE);
-
- $this->_activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
-
- if ($cid) {
- CRM_Contact_Form_Task_PDFLetterCommon::preProcessSingle($this, $cid);
- $this->_single = TRUE;
- }
- else {
- parent::preProcess();
- }
- $this->assign('single', $this->_single);
+ parent::preProcess();
+ $this->assign('single', $this->isSingle());
}
/**
return ' civicrm_contribution.id IN ( ' . implode(',', $this->getIDs()) . ' ) ';
}
+ /**
+ * Is only one entity being processed?
+ *
+ * @return false
+ */
+ public function isSingle() {
+ return $this->_single ?? FALSE;
+ }
+
}