Mage_Adminhtml_Block_Customer_Edit Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_Edit:

Mage_Adminhtml_Block_Widget_Form_Container Mage_Adminhtml_Block_Widget_Container Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getCreateOrderUrl ()
 getCustomerId ()
 getHeaderText ()
 getValidationUrl ()

Protected Member Functions

 _prepareLayout ()
 _getSaveAndContinueUrl ()


Detailed Description

Definition at line 34 of file Edit.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 36 of file Edit.php.

00037     {
00038         $this->_objectId = 'id';
00039         $this->_controller = 'customer';
00040 
00041         if ($this->getCustomerId() &&
00042             Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/create')) {
00043             $this->_addButton('order', array(
00044                 'label' => Mage::helper('customer')->__('Create Order'),
00045                 'onclick' => 'setLocation(\'' . $this->getCreateOrderUrl() . '\')',
00046                 'class' => 'add',
00047             ), 0);
00048         }
00049 
00050         parent::__construct();
00051 
00052         $this->_updateButton('save', 'label', Mage::helper('customer')->__('Save Customer'));
00053         $this->_updateButton('delete', 'label', Mage::helper('customer')->__('Delete Customer'));
00054 
00055         if (Mage::registry('current_customer')->isReadonly()) {
00056             $this->_removeButton('save');
00057             $this->_removeButton('reset');
00058         }
00059 
00060         if (!Mage::registry('current_customer')->isDeleteable()) {
00061             $this->_removeButton('delete');
00062         }
00063     }


Member Function Documentation

_getSaveAndContinueUrl (  )  [protected]

Definition at line 103 of file Edit.php.

00104     {
00105         return $this->getUrl('*/*/save', array(
00106             '_current'  => true,
00107             'back'      => 'edit',
00108             'tab'       => '{{tab_id}}'
00109         ));
00110     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 90 of file Edit.php.

00091     {
00092         if (!Mage::registry('current_customer')->isReadonly()) {
00093             $this->_addButton('save_and_continue', array(
00094                 'label'     => Mage::helper('customer')->__('Save And Continue Edit'),
00095                 'onclick'   => 'saveAndContinueEdit(\''.$this->_getSaveAndContinueUrl().'\')',
00096                 'class' => 'save'
00097             ), 10);
00098         }
00099 
00100         return parent::_prepareLayout();
00101     }

getCreateOrderUrl (  ) 

Definition at line 65 of file Edit.php.

00066     {
00067         return $this->getUrl('*/sales_order_create/start', array('customer_id' => $this->getCustomerId()));
00068     }

getCustomerId (  ) 

Definition at line 70 of file Edit.php.

00071     {
00072         return Mage::registry('current_customer')->getId();
00073     }

getHeaderText (  ) 

Get header text

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Definition at line 75 of file Edit.php.

00076     {
00077         if (Mage::registry('current_customer')->getId()) {
00078             return $this->htmlEscape(Mage::registry('current_customer')->getName());
00079         }
00080         else {
00081             return Mage::helper('customer')->__('New Customer');
00082         }
00083     }

getValidationUrl (  ) 

Definition at line 85 of file Edit.php.

00086     {
00087         return $this->getUrl('*/*/validate', array('_current'=>true));
00088     }


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

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