class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDFLetterCommon

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

Methods

static array
getLoggingOptions()

No description

static 
preProcess(CRM_Core_Form $form)

Build all the data structures needed to build the form.

static 
preProcessSingle(CRM_Core_Form $form, int $cid)

No description

static 
buildQuickForm($form)

Build the form object.

static 
setDefaultValues()

Set default values.

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

Form rule.

static array
processMessageTemplate(array $formValues)

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

static 
postProcess(CRM_Core_Form $form, array $formValues = NULL)

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

static array
createActivities(CRM_Core_Form $form, string $html_message, array $contactIds)

No description

static 
formatMessage($message)

No description

static bool
isValidHTMLWithTableSeparator($tokens, $html)

Check whether any of the tokens exist in the html outside a table cell.

static bool
isHtmlTokenInTableCell($token, $entity, $textToSearch)

Check that the token only appears in a table cell. The '' separator cannot otherwise work Calculate the number of times it appears IN the cell & the number of times it appears - should be the same!

static array
buildContributionArray(string $groupBy, array $contributionIDs, array $returnProperties, bool $skipOnHold, bool $skipDeceased, array $messageToken, string $task, string $separator, bool $isIncludeSoftCredits)

Generate the contribution array from the form, we fill in the contact details and determine any aggregation around contact_id of contribution_recur_id

static array
combineContributions(array $existing, array $contribution, string $separator)

We combine the contributions by adding the contribution to each field with the separator in between the existing value and the new one. We put the separator there even if empty so it is clear what the value for previous contributions was

static 
assignCombinedContributionValues(array $contact, array $contributions, $groupBy, int $groupByID)

We are going to retrieve the combined contribution and if smarty mail is enabled we will also assign an array of contributions for this contact to the smarty template

static bool
emailLetter(array $contact, string $html, $is_pdf, array $format = array(), array $params = array())

Send pdf by email.

Details

static array getLoggingOptions()

Return Value

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

static preProcess(CRM_Core_Form $form)

Build all the data structures needed to build the form.

Parameters

CRM_Core_Form $form

static preProcessSingle(CRM_Core_Form $form, int $cid)

Parameters

CRM_Core_Form $form
int $cid

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 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 15
static postProcess(CRM_Core_Form $form, array $formValues = NULL)

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

Parameters

CRM_Core_Form $form
array $formValues

static array createActivities(CRM_Core_Form $form, string $html_message, array $contactIds)

Parameters

CRM_Core_Form $form
string $html_message
array $contactIds

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

static formatMessage($message)

Parameters

$message

at line 166
static bool isValidHTMLWithTableSeparator($tokens, $html)

Check whether any of the tokens exist in the html outside a table cell.

If they do the table cell separator is not supported (return false) At this stage we are only anticipating contributions passed in this way but it would be easy to add others

Parameters

$tokens
$html

Return Value

bool

at line 190
static bool isHtmlTokenInTableCell($token, $entity, $textToSearch)

Check that the token only appears in a table cell. The '' separator cannot otherwise work Calculate the number of times it appears IN the cell & the number of times it appears - should be the same!

Parameters

$token
$entity
$textToSearch

Return Value

bool

at line 246
static array buildContributionArray(string $groupBy, array $contributionIDs, array $returnProperties, bool $skipOnHold, bool $skipDeceased, array $messageToken, string $task, string $separator, bool $isIncludeSoftCredits)

Generate the contribution array from the form, we fill in the contact details and determine any aggregation around contact_id of contribution_recur_id

Parameters

string $groupBy
array $contributionIDs
array $returnProperties
bool $skipOnHold
bool $skipDeceased
array $messageToken
string $task
string $separator
bool $isIncludeSoftCredits

Return Value

array

at line 320
static array combineContributions(array $existing, array $contribution, string $separator)

We combine the contributions by adding the contribution to each field with the separator in between the existing value and the new one. We put the separator there even if empty so it is clear what the value for previous contributions was

Parameters

array $existing
array $contribution
string $separator

Return Value

array

at line 337
static assignCombinedContributionValues(array $contact, array $contributions, $groupBy, int $groupByID)

We are going to retrieve the combined contribution and if smarty mail is enabled we will also assign an array of contributions for this contact to the smarty template

Parameters

array $contact
array $contributions
$groupBy
int $groupByID

at line 360
static bool emailLetter(array $contact, string $html, $is_pdf, array $format = array(), array $params = array())

Send pdf by email.

Parameters

array $contact
string $html
$is_pdf
array $format
array $params

Return Value

bool