From: Kurund Jalmi Date: Thu, 4 Jul 2013 09:28:23 +0000 (+0530) Subject: added event tokens, CRM-12965 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=012ee9a859742da6684f1ce64ce9a7bd0849d835;p=civicrm-core.git added event tokens, CRM-12965 --- diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index 351811f92a..b851e6b358 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -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']);