1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29:
30: class Mage_Adminhtml_Block_Sales_Order_Status_Assign_Form extends Mage_Adminhtml_Block_Widget_Form
31: {
32: public function __construct()
33: {
34: parent::__construct();
35: $this->setId('order_status_state');
36: }
37:
38: 39: 40: 41: 42:
43: protected function _prepareForm()
44: {
45: $form = new Varien_Data_Form(array(
46: 'id' => 'edit_form',
47: 'method' => 'post'
48: ));
49:
50: $fieldset = $form->addFieldset('base_fieldset', array(
51: 'legend' => Mage::helper('sales')->__('Assignment Information')
52: ));
53:
54: $statuses = Mage::getResourceModel('sales/order_status_collection')
55: ->toOptionArray();
56: array_unshift($statuses, array('value' => '', 'label' => ''));
57:
58: $states = Mage::getSingleton('sales/order_config')->getStates();
59: $states = array_merge(array('' => ''), $states);
60:
61: $fieldset->addField('status', 'select',
62: array(
63: 'name' => 'status',
64: 'label' => Mage::helper('sales')->__('Order Status'),
65: 'class' => 'required-entry',
66: 'values' => $statuses,
67: 'required' => true,
68: )
69: );
70:
71: $fieldset->addField('state', 'select',
72: array(
73: 'name' => 'state',
74: 'label' => Mage::helper('sales')->__('Order State'),
75: 'class' => 'required-entry',
76: 'values' => $states,
77: 'required' => true,
78: )
79: );
80:
81: $fieldset->addField('is_default', 'checkbox',
82: array(
83: 'name' => 'is_default',
84: 'label' => Mage::helper('sales')->__('Use Order Status As Default'),
85: 'value' => 1,
86: )
87: );
88:
89:
90: $form->setAction($this->getUrl('*/sales_order_status/assignPost'));
91: $form->setUseContainer(true);
92: $this->setForm($form);
93:
94: return parent::_prepareForm();
95: }
96: }
97: