1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Adminhtml
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * description
29: *
30: * @category Mage
31: * @category Mage
32: * @package Mage_Adminhtml
33: * @author Magento Core Team <core@magentocommerce.com>
34: */
35: class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Conditions
36: extends Mage_Adminhtml_Block_Widget_Form
37: implements Mage_Adminhtml_Block_Widget_Tab_Interface
38: {
39: /**
40: * Prepare content for tab
41: *
42: * @return string
43: */
44: public function getTabLabel()
45: {
46: return Mage::helper('catalogrule')->__('Conditions');
47: }
48:
49: /**
50: * Prepare title for tab
51: *
52: * @return string
53: */
54: public function getTabTitle()
55: {
56: return Mage::helper('catalogrule')->__('Conditions');
57: }
58:
59: /**
60: * Returns status flag about this tab can be showen or not
61: *
62: * @return true
63: */
64: public function canShowTab()
65: {
66: return true;
67: }
68:
69: /**
70: * Returns status flag about this tab hidden or not
71: *
72: * @return true
73: */
74: public function isHidden()
75: {
76: return false;
77: }
78:
79: protected function _prepareForm()
80: {
81: $model = Mage::registry('current_promo_catalog_rule');
82:
83: //$form = new Varien_Data_Form(array('id' => 'edit_form1', 'action' => $this->getData('action'), 'method' => 'post'));
84: $form = new Varien_Data_Form();
85:
86: $form->setHtmlIdPrefix('rule_');
87:
88: $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset')
89: ->setTemplate('promo/fieldset.phtml')
90: ->setNewChildUrl($this->getUrl('*/promo_catalog/newConditionHtml/form/rule_conditions_fieldset'));
91:
92: $fieldset = $form->addFieldset('conditions_fieldset', array(
93: 'legend'=>Mage::helper('catalogrule')->__('Conditions (leave blank for all products)'))
94: )->setRenderer($renderer);
95:
96: $fieldset->addField('conditions', 'text', array(
97: 'name' => 'conditions',
98: 'label' => Mage::helper('catalogrule')->__('Conditions'),
99: 'title' => Mage::helper('catalogrule')->__('Conditions'),
100: 'required' => true,
101: ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/conditions'));
102: /*
103: $fieldset = $form->addFieldset('actions_fieldset', array('legend'=>Mage::helper('catalogrule')->__('Actions')));
104:
105: $fieldset->addField('actions', 'text', array(
106: 'name' => 'actions',
107: 'label' => Mage::helper('catalogrule')->__('Actions'),
108: 'title' => Mage::helper('catalogrule')->__('Actions'),
109: 'required' => true,
110: ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/actions'));
111:
112: $fieldset = $form->addFieldset('options_fieldset', array('legend'=>Mage::helper('catalogrule')->__('Options')));
113:
114: $fieldset->addField('stop_rules_processing', 'select', array(
115: 'label' => Mage::helper('catalogrule')->__('Stop Further Rules Processing'),
116: 'title' => Mage::helper('catalogrule')->__('Stop Further Rules Processing'),
117: 'name' => 'stop_rules_processing',
118: 'required' => true,
119: 'options' => array(
120: '1' => Mage::helper('catalogrule')->__('Yes'),
121: '0' => Mage::helper('catalogrule')->__('No'),
122: ),
123: ));
124: */
125: $form->setValues($model->getData());
126:
127: //$form->setUseContainer(true);
128:
129: $this->setForm($form);
130:
131: return parent::_prepareForm();
132: }
133: }
134: