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: 31: 32: 33:
34: class Mage_Adminhtml_Block_Newsletter_Problem_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36: public function __construct()
37: {
38: parent::__construct();
39: $this->setId('problemGrid');
40: $this->setSaveParametersInSession(true);
41: $this->setMessageBlockVisibility(true);
42: $this->setUseAjax(true);
43: $this->setEmptyText(Mage::helper('newsletter')->__('No problems found.'));
44: }
45:
46: protected function _prepareCollection()
47: {
48: $collection = Mage::getResourceModel('newsletter/problem_collection')
49: ->addSubscriberInfo()
50: ->addQueueInfo();
51:
52: $this->setCollection($collection);
53:
54: return parent::_prepareCollection();
55: }
56:
57: protected function _prepareColumns()
58: {
59: $this->addColumn('checkbox', array(
60: 'sortable' => false,
61: 'filter' => 'adminhtml/newsletter_problem_grid_filter_checkbox',
62: 'renderer' => 'adminhtml/newsletter_problem_grid_renderer_checkbox',
63: 'width' => '20px'
64: ));
65:
66: $this->addColumn('problem_id', array(
67: 'header' => Mage::helper('newsletter')->__('ID'),
68: 'index' => 'problem_id',
69: 'width' => '50px'
70: ));
71:
72: $this->addColumn('subscriber', array(
73: 'header' => Mage::helper('newsletter')->__('Subscriber'),
74: 'index' => 'subscriber_id',
75: 'format' => '#$subscriber_id $customer_name ($subscriber_email)'
76: ));
77:
78: $this->addColumn('queue_start', array(
79: 'header' => Mage::helper('newsletter')->__('Queue Date Start'),
80: 'index' => 'queue_start_at',
81: 'gmtoffset' => true,
82: 'type' => 'datetime'
83: ));
84:
85: $this->addColumn('queue', array(
86: 'header' => Mage::helper('newsletter')->__('Queue Subject'),
87: 'index' => 'template_subject'
88: ));
89:
90: $this->addColumn('problem_code', array(
91: 'header' => Mage::helper('newsletter')->__('Error Code'),
92: 'index' => 'problem_error_code',
93: 'type' => 'number'
94: ));
95:
96: $this->addColumn('problem_text', array(
97: 'header' => Mage::helper('newsletter')->__('Error Text'),
98: 'index' => 'problem_error_text'
99: ));
100: return parent::_prepareColumns();
101: }
102: }
103: