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

Merge pull request #1156 from kurund/CRM-12967

patched Pratik's work on barcode position fixes, CRM-12967
parents 0e0c375b 8afbd311
No related branches found
No related tags found
No related merge requests found
...@@ -180,8 +180,8 @@ class CRM_Badge_BAO_Badge { ...@@ -180,8 +180,8 @@ class CRM_Badge_BAO_Badge {
if (CRM_Utils_Array::value('barcode', $formattedRow)) { if (CRM_Utils_Array::value('barcode', $formattedRow)) {
$style = array( $style = array(
'position' => $formattedRow['barcode'], 'position' => '',
'align' => $formattedRow['barcode'], 'align' => '',
'stretch' => FALSE, 'stretch' => FALSE,
'fitwidth' => TRUE, 'fitwidth' => TRUE,
'cellfitalign' => '', 'cellfitalign' => '',
...@@ -196,13 +196,25 @@ class CRM_Badge_BAO_Badge { ...@@ -196,13 +196,25 @@ class CRM_Badge_BAO_Badge {
'stretchtext' => 0, 'stretchtext' => 0,
); );
// barcode position
$xAlign = $x;
if ($formattedRow['barcode'] == 'L') {
$xAlign += -12;
}
elseif ($formattedRow['barcode'] == 'R') {
$xAlign += 30;
}
elseif ($formattedRow['barcode'] == 'C') {
$xAlign += 15;
}
$data = $formattedRow['values']; $data = $formattedRow['values'];
$data['current_value'] = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id']; $data['current_value'] = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id'];
// call hook alterBarcode // call hook alterBarcode
CRM_Utils_Hook::alterBarcode($data); CRM_Utils_Hook::alterBarcode($data);
$this->pdf->write1DBarcode($data['current_value'], 'C128', $x, $y + $this->pdf->height - 10, '', $this->pdf->write1DBarcode($data['current_value'], 'C128', $xAlign, $y + $this->pdf->height - 10, '',
12, 0.4, $style, 'B'); 12, 0.4, $style, 'B');
} }
} }
......
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