00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Tax_Class_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
00036 {
00037 public function __construct()
00038 {
00039 parent::__construct();
00040
00041 $this->setId('taxClassForm');
00042 }
00043
00044 protected function _prepareForm()
00045 {
00046 $model = Mage::registry('tax_class');
00047 $form = new Varien_Data_Form(array(
00048 'id' => 'edit_form',
00049 'action' => $this->getData('action'),
00050 'method' => 'post'
00051 ));
00052
00053 $classType = $this->getClassType();
00054
00055 $this->setTitle($classType == 'CUSTOMER'
00056 ? Mage::helper('cms')->__('Customer Tax Class Information')
00057 : Mage::helper('cms')->__('Product Tax Class Information')
00058 );
00059
00060 $fieldset = $form->addFieldset('base_fieldset', array(
00061 'legend' => $classType == 'CUSTOMER'
00062 ? Mage::helper('tax')->__('Customer Tax Class Information')
00063 : Mage::helper('tax')->__('Product Tax Class Information')
00064 ));
00065
00066 $fieldset->addField('class_name', 'text',
00067 array(
00068 'name' => 'class_name',
00069 'label' => Mage::helper('tax')->__('Class Name'),
00070 'class' => 'required-entry',
00071 'value' => $model->getClassName(),
00072 'required' => true,
00073 )
00074 );
00075
00076 $fieldset->addField('class_type', 'hidden',
00077 array(
00078 'name' => 'class_type',
00079 'value' => $classType,
00080 'no_span' => true
00081 )
00082 );
00083
00084 if ($model->getId()) {
00085 $fieldset->addField('class_id', 'hidden',
00086 array(
00087 'name' => 'class_id',
00088 'value' => $model->getId(),
00089 'no_span' => true
00090 )
00091 );
00092 }
00093
00094 $form->setAction($this->getUrl('*/tax_class/save'));
00095 $form->setUseContainer(true);
00096 $this->setForm($form);
00097
00098 return parent::_prepareForm();
00099 }
00100 }