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_Quote_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('salesrule')->__('Conditions');
47: }
48:
49: /**
50: * Prepare title for tab
51: *
52: * @return string
53: */
54: public function getTabTitle()
55: {
56: return Mage::helper('salesrule')->__('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_quote_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_quote/newConditionHtml/form/rule_conditions_fieldset'));
91:
92: $fieldset = $form->addFieldset('conditions_fieldset', array(
93: 'legend'=>Mage::helper('salesrule')->__('Apply the rule only if the following conditions are met (leave blank for all products)')
94: ))->setRenderer($renderer);
95:
96: $fieldset->addField('conditions', 'text', array(
97: 'name' => 'conditions',
98: 'label' => Mage::helper('salesrule')->__('Conditions'),
99: 'title' => Mage::helper('salesrule')->__('Conditions'),
100: ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/conditions'));
101: /*
102: $fieldset = $form->addFieldset('actions_fieldset', array(
103: 'legend'=>Mage::helper('salesrule')->__('Apply the rule to cart items matching the following conditions')
104: ))->setRenderer($renderer);
105:
106: $fieldset->addField('actions', 'text', array(
107: 'name' => 'actions',
108: 'label' => Mage::helper('salesrule')->__('Apply To'),
109: 'title' => Mage::helper('salesrule')->__('Apply To'),
110: 'required' => true,
111: ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/actions'));
112: */
113: $form->setValues($model->getData());
114:
115: //$form->setUseContainer(true);
116:
117: $this->setForm($form);
118:
119: return parent::_prepareForm();
120: }
121: }
122: