<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
- * Class CRM_Badge_Format_Badge
+ * Class CRM_Badge_Format_Badge.
*
* parent class for building name badges
*/
* Associated array with participant info.
* @param array $layoutInfo
* Associated array which contains meta data about format/layout.
- *
- * @return void
*/
public function createLabels(&$participants, &$layoutInfo) {
$this->pdf = new CRM_Utils_PDF_Label($layoutInfo['format'], 'mm');
}
/**
- * Funtion to create structure and add meta data according to layout.
+ * Function to create structure and add meta data according to layout.
*
* @param array $row
* Row element that needs to be formatted.
* @param string $y
* @param null $w
* @param null $h
- *
- * @return void
*/
public function printImage($img, $x = '', $y = '', $w = NULL, $h = NULL) {
if (!$x) {
* @param array $params
* Associated array of submitted values.
* @param CRM_Core_Form $form
- *
- * @return void
*/
public static function buildBadges(&$params, &$form) {
// get name badge layout info
$query->convertToPseudoNames($dao);
$rows[$dao->participant_id] = array();
foreach ($returnProperties as $key => $dontCare) {
- $rows[$dao->participant_id][$key] = isset($dao->$key) ? $dao->$key : NULL;
+ $value = isset($dao->$key) ? $dao->$key : NULL;
+ // Format custom fields
+ if (strstr($key, 'custom_') && isset($value)) {
+ $value = CRM_Core_BAO_CustomField::getDisplayValue($value, substr($key, 7), $query->_options, $dao->contact_id);
+ }
+ $rows[$dao->participant_id][$key] = $value;
}
}