Skip to content
Snippets Groups Projects
Commit 7fd8017a authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

added barcode support, CRM-12966

parent fab99312
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,9 @@ class CRM_Badge_BAO_Badge {
$formattedRow['barcode'] = $layout['data']['barcode_alignment'];
}
// finally assign all the row values, so that we can use it for barcode etc
$formattedRow['values'] = $row;
return $formattedRow;
}
......@@ -161,6 +164,29 @@ class CRM_Badge_BAO_Badge {
$this->pdf->SetXY($x, $y + $this->pdf->height - 5);
$this->pdf->Cell($this->pdf->width, 0, $formattedRow['token'][4]['value'], $this->border, 2,
$formattedRow['token'][4]['text_alignment']);
if (CRM_Utils_Array::value('barcode', $formattedRow)) {
$style = array(
'position' => $formattedRow['barcode'],
'align' => $formattedRow['barcode'],
'stretch' => FALSE,
'fitwidth' => TRUE,
'cellfitalign' => '',
'border' => FALSE,
'hpadding' => 'auto',
'vpadding' => 'auto',
'fgcolor' => array(0, 0, 0),
'bgcolor' => FALSE,
'text' => FALSE,
'font' => 'helvetica',
'fontsize' => 8,
'stretchtext' => 0,
);
$payload = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id'];
$this->pdf->SetXY($x, $y + $this->pdf->height - 5);
$this->pdf->write1DBarcode($payload, "C128A", $x, $this->pdf->getY() - 6, 50, 10, 0.4, $style, 'B');
}
}
/**
......
......@@ -142,7 +142,7 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task {
}
// add additional required fields for query execution
$additionalFields = array('participant_register_date', 'participant_id');
$additionalFields = array('participant_register_date', 'participant_id', 'event_id', 'contact_id');
foreach ($additionalFields as $field) {
$returnProperties[$field] = 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment