*
* @return void
*/
- public function preProcess() {
+ public function preProcess(): void {
parent::preProcess();
$this->setContactIDs();
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Member/Form/Task/Label.js');
*
* @return void
*/
- public function buildQuickForm() {
+ public function buildQuickForm(): void {
CRM_Contact_Form_Task_Label::buildLabelForm($this);
$this->addElement('checkbox', 'per_membership', ts('Print one label per Membership (rather than per contact)'));
}
* @return array
* array of default values
*/
- public function setDefaultValues() {
+ public function setDefaultValues(): array {
$defaults = [];
$format = CRM_Core_BAO_LabelFormat::getDefaultValues();
$defaults['label_name'] = $format['name'] ?? NULL;
*
* @return void
*/
- public function postProcess() {
+ public function postProcess(): void {
$formValues = $this->controller->exportValues($this->_name);
$locationTypeID = $formValues['location_type_id'];
$respectDoNotMail = $formValues['do_not_mail'] ?? NULL;
// so no-one is tempted to refer to this again after relevant values are extracted
unset($formValues);
- list($rows, $tokenFields) = CRM_Contact_Form_Task_LabelCommon::getRows($this->_contactIds, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold);
+ [$rows, $tokenFields] = CRM_Contact_Form_Task_LabelCommon::getRows($this->_contactIds, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold);
- $individualFormat = FALSE;
if ($mergeSameAddress) {
CRM_Core_BAO_Address::mergeSameAddress($rows);
- $individualFormat = TRUE;
}
if ($mergeSameHousehold) {
$rows = CRM_Contact_Form_Task_LabelCommon::mergeSameHousehold($rows);
- $individualFormat = TRUE;
}
// format the addresses according to CIVICRM_ADDRESS_FORMAT (CRM-1327)
foreach ((array) $rows as $id => $row) {