Public Member Functions | |
__construct () | |
getCreateOrderUrl () | |
getCustomerId () | |
getHeaderText () | |
getValidationUrl () | |
Protected Member Functions | |
_prepareLayout () | |
_getSaveAndContinueUrl () |
Definition at line 34 of file Edit.php.
__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 }
_getSaveAndContinueUrl | ( | ) | [protected] |
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
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
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 | ( | ) |