CRM-12965, notice fixes and cleanup
authorKurund Jalmi <kurund@civicrm.org>
Tue, 9 Jul 2013 18:06:02 +0000 (23:36 +0530)
committerKurund Jalmi <kurund@civicrm.org>
Tue, 9 Jul 2013 18:06:02 +0000 (23:36 +0530)
CRM/Badge/Form/Layout.php

index 3d663ec2307cc8367a1097db83e0e4d5bfbd962f..aa5005b2f2baef812c22f1774b8044ae6927d68d 100644 (file)
@@ -69,7 +69,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     $this->add('select', 'label_format_name', ts('Label Style'), array('' => ts('- select -')) + $labelStyle, TRUE);
 
     $this->add('text', 'description', ts('Description'),
-      CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'description'));
+      CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'title'));
 
     // get the tokens
     $contactTokens = CRM_Core_SelectValues::contactTokens();
@@ -119,11 +119,12 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     if (isset($this->_id) && empty($this->_values)) {
       $this->_values = array();
       $params = array('id' => $this->_id);
-      CRM_Badge_BAO_Layout::retrieve($params, $this->_values );
-    }
+      CRM_Badge_BAO_Layout::retrieve($params, $this->_values);
+
 
-    $defaults = array_merge($this->_values,
-      CRM_Badge_BAO_Layout::getDecodedData($this->_values['data']));
+      $defaults = array_merge($this->_values,
+        CRM_Badge_BAO_Layout::getDecodedData($this->_values['data']));
+    }
 
     if ($this->_action == CRM_Core_Action::DELETE && isset($defaults['title'])) {
       $this->assign('delName', $defaults['title']);