Mage_Adminhtml_Block_Sales_Order_Create_Form_Address Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Create_Form_Address:

Mage_Adminhtml_Block_Sales_Order_Create_Abstract Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address

List of all members.

Public Member Functions

 getAddressCollection ()
 getAddressCollectionJson ()
 getForm ()
 getFormValues ()
 getAddressId ()
 getAddressAsString ($address)

Protected Member Functions

 _prepareLayout ()
 _prepareForm ()

Protected Attributes

 $_form


Detailed Description

Order create address form

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Address.php.


Member Function Documentation

_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

Returns:
Mage_Core_Block_Abstract

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  ) 

Definition at line 120 of file Address.php.

00121     {
00122         return $address->format('oneline');
00123     }

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.

00116     {
00117         return false;
00118     }

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     }


Member Data Documentation

$_form [protected]

Definition at line 34 of file Address.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:59 2009 for Magento by  doxygen 1.5.8