* Build all the data structures needed to build the form.
*/
public function preProcess() {
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
+ $this->preProcessPDF();
$this->skipOnHold = $this->skipDeceased = FALSE;
parent::preProcess();
$this->setContactIDs();
public function preProcess() {
$this->skipOnHold = $this->skipDeceased = FALSE;
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
+ $this->preProcessPDF();
// store case id if present
$this->_caseId = CRM_Utils_Request::retrieve('caseid', 'CommaSeparatedIntegers', $this, FALSE);
/**
* Build all the data structures needed to build the form.
*
+ * @deprecated
+ *
* @param CRM_Core_Form $form
*/
public static function preProcess(&$form) {
+ CRM_Core_Error::deprecatedFunctionWarning('no alternative');
$defaults = [];
$form->_fromEmails = CRM_Core_BAO_Email::getFromEmail();
if (is_numeric(key($form->_fromEmails))) {
$form->addFormRule(['CRM_Core_Form_Task_PDFLetterCommon', 'formRule'], $form);
}
+ /**
+ * Prepare form.
+ */
+ public function preProcessPDF(): void {
+ $form = $this;
+ $defaults = [];
+ $form->_fromEmails = CRM_Core_BAO_Email::getFromEmail();
+ if (is_numeric(key($form->_fromEmails))) {
+ $emailID = (int) key($form->_fromEmails);
+ $defaults = CRM_Core_BAO_Email::getEmailSignatureDefaults($emailID);
+ }
+ if (!Civi::settings()->get('allow_mail_from_logged_in_contact')) {
+ $defaults['from_email_address'] = current(CRM_Core_BAO_Domain::getNameAndEmail(FALSE, TRUE));
+ }
+ $form->setDefaults($defaults);
+ $form->setTitle('Print/Merge Document');
+ }
+
}
*/
public function preProcess() {
$this->skipOnHold = $this->skipDeceased = FALSE;
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
+ $this->preProcessPDF();
parent::preProcess();
$this->assign('single', $this->isSingle());
}
* Build all the data structures needed to build the form.
*/
public function preProcess() {
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
+ $this->preProcessPDF();
parent::preProcess();
// we have all the participant ids, so now we get the contact ids
$this->skipOnHold = $this->skipDeceased = FALSE;
parent::preProcess();
$this->setContactIDs();
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
+ $this->preProcessPDF();
}
/**