$value = $row[$element];
// hack to fix date field display format
if (strpos($element, '_date')) {
- $value = CRM_Utils_Date::customFormat($value, "%e %b");
+ $value = CRM_Utils_Date::customFormat($value, "%B %E%f");
}
}
$badgeInfo = CRM_Badge_BAO_Layout::create($params);
if (isset($params['_qf_Layout_refresh'])) {
+ $this->set('id', $badgeInfo->id);
$params['badge_id'] = $badgeInfo->id;
self::buildPreview($params);
}
// get a max participant id
$participantID = CRM_Core_DAO::singleValueQuery('select max(id) from civicrm_participant');
+ if (!$participantID) {
+ CRM_Core_Session::setStatus(ts('Preview requires at least one event and one participant record.
+ If you are just getting started, you can add a test participant record.'), ts('Preview Requirements'), 'alert');
+ return;
+ }
+
$this->_single = TRUE;
$this->_participantIds = array($participantID);
$this->_componentClause = " civicrm_participant.id = $participantID ";