Public Member Functions | |
getAddressCollection () | |
getAddressCollectionJson () | |
getForm () | |
getFormValues () | |
getAddressId () | |
getAddressAsString ($address) | |
Protected Member Functions | |
_prepareLayout () | |
_prepareForm () | |
Protected Attributes | |
$_form |
Definition at line 32 of file Address.php.
_prepareForm | ( | ) | [protected] |
Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address, and Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address.
Definition at line 69 of file Address.php.
00070 { 00071 if (!$this->_form) { 00072 $this->_form = new Varien_Data_Form(); 00073 $fieldset = $this->_form->addFieldset('main', array('no_container'=>true)); 00074 $addressModel = Mage::getModel('customer/address'); 00075 00076 foreach ($addressModel->getAttributes() as $attribute) { 00077 if (!$attribute->getIsVisible()) { 00078 continue; 00079 } 00080 if ($inputType = $attribute->getFrontend()->getInputType()) { 00081 $element = $fieldset->addField($attribute->getAttributeCode(), $inputType, 00082 array( 00083 'name' => $attribute->getAttributeCode(), 00084 'label' => $this->__($attribute->getFrontend()->getLabel()), 00085 'class' => $attribute->getFrontend()->getClass(), 00086 'required' => $attribute->getIsRequired(), 00087 ) 00088 ) 00089 ->setEntityAttribute($attribute); 00090 00091 if ($inputType == 'select' || $inputType == 'multiselect') { 00092 $element->setValues($attribute->getFrontend()->getSelectOptions()); 00093 } 00094 } 00095 } 00096 00097 if ($regionElement = $this->_form->getElement('region')) { 00098 $regionElement->setRenderer( 00099 $this->getLayout()->createBlock('adminhtml/customer_edit_renderer_region') 00100 ); 00101 } 00102 if ($regionElement = $this->_form->getElement('region_id')) { 00103 $regionElement->setNoDisplay(true); 00104 } 00105 $this->_form->setValues($this->getFormValues()); 00106 } 00107 return $this; 00108 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 36 of file Address.php.
00037 { 00038 Varien_Data_Form::setElementRenderer( 00039 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element') 00040 ); 00041 Varien_Data_Form::setFieldsetRenderer( 00042 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset') 00043 ); 00044 Varien_Data_Form::setFieldsetElementRenderer( 00045 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element') 00046 ); 00047 }
getAddressAsString | ( | $ | address | ) |
getAddressCollection | ( | ) |
Definition at line 49 of file Address.php.
00050 { 00051 return $this->getCustomer()->getAddresses(); 00052 }
getAddressCollectionJson | ( | ) |
Definition at line 54 of file Address.php.
00055 { 00056 $data = array(); 00057 foreach ($this->getAddressCollection() as $address) { 00058 $data[$address->getId()] = $address->getData(); 00059 } 00060 return Zend_Json::encode($data); 00061 }
getAddressId | ( | ) |
Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address, and Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address.
Definition at line 115 of file Address.php.
getForm | ( | ) |
Definition at line 63 of file Address.php.
00064 { 00065 $this->_prepareForm(); 00066 return $this->_form; 00067 }
getFormValues | ( | ) |
Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address, and Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address.
Definition at line 110 of file Address.php.
00111 { 00112 return array(); 00113 }
$_form [protected] |
Definition at line 34 of file Address.php.