class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetterCommon

This class provides the common functionality for creating PDF letter for one or a group of contact ids.

Properties

static protected $tokenCategories

Methods

static 
preProcess($form)

Build all the data structures needed to build the form.

static 
buildQuickForm($form)

Build the form object.

static 
setDefaultValues()

Set default values.

static bool
formRule(array $fields, array $files, array $self)

Form rule.

static 
processTemplate($formValues)

Handle the template processing part of the form

static 
formatMessage($message)

No description

static array
getLoggingOptions()

No description

static 
preProcessSingle(CRM_Core_Form $form, int $cid)

No description

static array
processMessageTemplate(array $formValues)

Part of the post process which prepare and extract information from the template.

static 
postProcess(CRM_Core_Form $form)

Process the form after the input has been submitted and validated.

static array
createActivities(CRM_Core_Form $form, string $html_message, array $contactIds, string $subject, int $campaign_id, array $perContactHtml = [])

No description

static array
getTokenCategories()

Get the categories required for rendering tokens.

static bool
isLiveMode(CRM_Core_Form $form)

Is the form in live mode (as opposed to being run as a preview).

Details

at line 60
static preProcess($form)

Build all the data structures needed to build the form.

Parameters

$form

static buildQuickForm($form)

Build the form object.

Parameters

$form

static setDefaultValues()

Set default values.

static bool formRule(array $fields, array $files, array $self)

Form rule.

Parameters

array $fields The input form values.
array $files
array $self Additional values form 'this'.

Return Value

bool TRUE if no errors, else array of errors.

static processTemplate($formValues)

Handle the template processing part of the form

Parameters

$formValues

static formatMessage($message)

Parameters

$message

at line 45
static array getLoggingOptions()

Return Value

array Array(string $machineName => string $label).

at line 81
static preProcessSingle(CRM_Core_Form $form, int $cid)

Parameters

CRM_Core_Form $form
int $cid

at line 98
static array processMessageTemplate(array $formValues)

Part of the post process which prepare and extract information from the template.

Parameters

array $formValues

Return Value

array [$categories, $html_message, $messageToken, $returnProperties]

at line 126
static postProcess(CRM_Core_Form $form)

Process the form after the input has been submitted and validated.

Parameters

CRM_Core_Form $form

Exceptions

CRM_Core_Exception

at line 246
static array createActivities(CRM_Core_Form $form, string $html_message, array $contactIds, string $subject, int $campaign_id, array $perContactHtml = [])

Parameters

CRM_Core_Form $form
string $html_message
array $contactIds
string $subject
int $campaign_id
array $perContactHtml

Return Value

array List of activity IDs. There may be 1 or more, depending on the system-settings and use-case.

Exceptions

CRM_Core_Exception

at line 337
static protected array getTokenCategories()

Get the categories required for rendering tokens.

Return Value

array

at line 359
static protected bool isLiveMode(CRM_Core_Form $form)

Is the form in live mode (as opposed to being run as a preview).

Returns true if the user has clicked the Download Document button on a Print/Merge Document (PDF Letter) search task form, or false if the Preview button was clicked.

Parameters

CRM_Core_Form $form

Return Value

bool TRUE if the Download Document button was clicked (also defaults to TRUE if the form controller does not exist), else FALSE