Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Actions Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Actions:

Mage_Adminhtml_Block_Widget_Form Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _prepareForm ()


Detailed Description

Definition at line 35 of file Actions.php.


Member Function Documentation

_prepareForm (  )  [protected]

Prepare form before rendering HTML

Returns:
Mage_Adminhtml_Block_Widget_Form

Reimplemented from Mage_Adminhtml_Block_Widget_Form.

Definition at line 38 of file Actions.php.

00039     {
00040         $model = Mage::registry('current_promo_catalog_rule');
00041 
00042         //$form = new Varien_Data_Form(array('id' => 'edit_form1', 'action' => $this->getData('action'), 'method' => 'post'));
00043         $form = new Varien_Data_Form();
00044 
00045         $form->setHtmlIdPrefix('rule_');
00046 
00047         $fieldset = $form->addFieldset('action_fieldset', array('legend'=>Mage::helper('salesrule')->__('Update prices using the following information')));
00048 
00049         $fieldset->addField('simple_action', 'select', array(
00050             'label'     => Mage::helper('salesrule')->__('Apply'),
00051             'name'      => 'simple_action',
00052             'options'    => array(
00053                 'by_percent' => Mage::helper('salesrule')->__('By Percentage of the original price'),
00054                 'by_fixed' => Mage::helper('salesrule')->__('By Fixed Amount'),
00055                 'to_percent' => Mage::helper('salesrule')->__('To Percentage of the original price'),
00056                 'to_fixed' => Mage::helper('salesrule')->__('To Fixed Amount'),
00057             ),
00058         ));
00059 
00060         $fieldset->addField('discount_amount', 'text', array(
00061             'name' => 'discount_amount',
00062             'required' => true,
00063             'class' => 'validate-not-negative-number',
00064             'label' => Mage::helper('salesrule')->__('Discount amount'),
00065         ));
00066 
00067         $fieldset->addField('stop_rules_processing', 'select', array(
00068             'label'     => Mage::helper('salesrule')->__('Stop further rules processing'),
00069             'title'     => Mage::helper('salesrule')->__('Stop further rules processing'),
00070             'name'      => 'stop_rules_processing',
00071             'options'    => array(
00072                 '1' => Mage::helper('salesrule')->__('Yes'),
00073                 '0' => Mage::helper('salesrule')->__('No'),
00074             ),
00075         ));
00076 
00077         $form->setValues($model->getData());
00078 
00079         //$form->setUseContainer(true);
00080 
00081         if ($model->isReadonly()) {
00082             foreach ($fieldset->getElements() as $element) {
00083                 $element->setReadonly(true, true);
00084             }
00085         }
00086 
00087         $this->setForm($form);
00088 
00089         return parent::_prepareForm();
00090     }


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

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