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

added event tokens, CRM-12965

parent b68bdb83
No related branches found
No related tags found
No related merge requests found
......@@ -64,14 +64,16 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'description'));
// get the tokens
$tokens = CRM_Core_SelectValues::contactTokens();
$contactTokens = CRM_Core_SelectValues::contactTokens();
$eventTokens = CRM_Core_SelectValues::eventTokens();
$tokens = array_merge($contactTokens, $eventTokens);
asort($tokens);
$fontSizes = CRM_Core_BAO_LabelFormat::getFontSizes();
$fontNames = CRM_Core_BAO_LabelFormat::getFontNames('name_badge');
$textAlignment = CRM_Core_BAO_LabelFormat::getTextAlignments();
$rowCount = 3;
$rowCount = 4;
for ( $i =1; $i <= $rowCount; $i++ ) {
$this->add('select', "token[$i]", ts('Token'), array('' => ts('- none -')) + $tokens);
$this->add('select', "font_name[$i]", ts('Font Name'), $fontNames);
......@@ -88,10 +90,6 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
$this->add('checkbox', 'is_default', ts('Default?'));
$this->add('checkbox', 'is_active', ts('Enabled?'));
$this->add('checkbox', 'is_reserved', ts('Reserved?'));
if ($this->_action == CRM_Core_Action::UPDATE && CRM_Core_DAO::getFieldValue('CRM_Core_DAO_PrintLabel', $this->_id, 'is_reserved')) {
$this->freeze(array('title', 'description', 'is_active'));
}
}
/**
......@@ -118,9 +116,8 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
$defaults[$field] = get_object_vars($data[$field]);
}
$defaults['add_barcode'] = $data['add_barcode'];
$defaults['barcode_alignment'] = $data['barcode_alignment'];
$defaults['label_format_id'] = $data['label_format_id'];
$defaults['add_barcode'] = CRM_Utils_Array::value('add_barcode', $data);
$defaults['barcode_alignment'] = CRM_Utils_Array::value('barcode_alignment', $data);
if ($this->_action == CRM_Core_Action::DELETE && isset($defaults['title'])) {
$this->assign('delName', $defaults['title']);
......
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