CRM-13329, add 2 more rows
authorkurund <kurund@civicrm.org>
Wed, 4 Sep 2013 11:44:21 +0000 (17:14 +0530)
committerkurund <kurund@civicrm.org>
Tue, 10 Sep 2013 05:57:36 +0000 (11:27 +0530)
----------------------------------------
* CRM-13329: Add 2 more rows to the Badge Layout form (for a total of 6 rows)
  http://issues.civicrm.org/jira/browse/CRM-13329

CRM/Badge/Form/Layout.php

index 43247d27df37698976f8cfd28633f381bff8465a..9c6963ec8872bab0391fb3b813e946886b361b95 100644 (file)
@@ -39,6 +39,7 @@
  */
 class CRM_Badge_Form_Layout extends CRM_Admin_Form {
 
+  const FIELD_ROWCOUNT = 6;
   /**
    * Function to build the form
    *
@@ -94,7 +95,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     $fontNames = CRM_Core_BAO_LabelFormat::getFontNames('name_badge');
     $textAlignment = CRM_Core_BAO_LabelFormat::getTextAlignments();
 
-    $rowCount = 4;
+    $rowCount = self::FIELD_ROWCOUNT;
     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);
@@ -190,7 +191,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
         CRM_Badge_BAO_Layout::getDecodedData($this->_values['data']));
     }
     else {
-      for ($i = 1; $i <= 4; $i++) {
+      for ($i = 1; $i <= self::FIELD_ROWCOUNT; $i++) {
         $defaults['text_alignment'][$i] = "C";
       }
     }