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

Merge pull request #1122 from kurund/CRM-12966

clean and notice fixes CRM-12966
parents 2d5e5ce1 8d5579e2
No related branches found
No related tags found
No related merge requests found
......@@ -86,10 +86,13 @@ class CRM_Badge_BAO_Badge {
if (CRM_Utils_Array::value('rowElements', $layout['data'])) {
foreach($layout['data']['rowElements'] as $key => $element) {
$value = $row[$element];
// hack to fix date field display format
if (strpos($element,'_date')) {
$value = CRM_Utils_Date::customFormat($value, "%e %b");
$value = '';
if ($element) {
$value = $row[$element];
// hack to fix date field display format
if (strpos($element, '_date')) {
$value = CRM_Utils_Date::customFormat($value, "%e %b");
}
}
$formattedRow['token'][$key] = array(
......@@ -131,8 +134,13 @@ class CRM_Badge_BAO_Badge {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
$this->printImage($formattedRow['image_1']);
//$this->printImage($formattedRow['image_2']);
if (CRM_Utils_Array::value('image_1', $formattedRow)) {
$this->printImage($formattedRow['image_1']);
}
if (CRM_Utils_Array::value('image_2', $formattedRow)) {
//$this->printImage($formattedRow['image_2']);
}
$this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round',
'dash' => '2,2', 'color' => array(0, 0, 200)));
......
......@@ -118,20 +118,23 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task {
$returnProperties = array();
if (!empty($layoutInfo['data']['token'])) {
foreach ($layoutInfo['data']['token'] as $index => $value) {
$token = CRM_Utils_Token::getTokens($value);
if (key($token) == 'contact') {
$element = $token['contact'][0];
}
else {
$element = $token['event'][0];
//FIX ME - we need to standardize event token names
if (!strpos($element, 'event_')) {
$element = 'event_' .$element;
$element = '';
if ($value) {
$token = CRM_Utils_Token::getTokens($value);
if (key($token) == 'contact') {
$element = $token['contact'][0];
}
else {
$element = $token['event'][0];
//FIX ME - we need to standardize event token names
if (!strpos($element, 'event_')) {
$element = 'event_' . $element;
}
}
}
// build returnproperties for query
$returnProperties[$element] = 1;
// build returnproperties for query
$returnProperties[$element] = 1;
}
// add actual field name to row element
$layoutInfo['data']['rowElements'][$index] = $element;
......
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