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_Promo_Catalog_Edit_Tab_Actions extends Mage_Adminhtml_Block_Widget_Form
00036 {
00037
00038 protected function _prepareForm()
00039 {
00040 $model = Mage::registry('current_promo_catalog_rule');
00041
00042
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
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 }
00091 }