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_System_Email_Template_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36:
37: protected function _construct()
38: {
39: $this->setEmptyText(Mage::helper('adminhtml')->__('No Templates Found'));
40: $this->setId('systemEmailTemplateGrid');
41: $this->setUseAjax(true);
42: $this->setSaveParametersInSession(true);
43: }
44:
45: protected function _prepareCollection()
46: {
47: $collection = Mage::getResourceSingleton('core/email_template_collection');
48:
49: $this->setCollection($collection);
50:
51: return parent::_prepareCollection();
52: }
53:
54: protected function _prepareColumns()
55: {
56: $this->addColumn('template_id',
57: array(
58: 'header'=>Mage::helper('adminhtml')->__('ID'),
59: 'index'=>'template_id'
60: )
61: );
62:
63: $this->addColumn('code',
64: array(
65: 'header'=>Mage::helper('adminhtml')->__('Template Name'),
66: 'index'=>'template_code'
67: ));
68:
69: $this->addColumn('added_at',
70: array(
71: 'header'=>Mage::helper('adminhtml')->__('Date Added'),
72: 'index'=>'added_at',
73: 'gmtoffset' => true,
74: 'type'=>'datetime'
75: ));
76:
77: $this->addColumn('modified_at',
78: array(
79: 'header'=>Mage::helper('adminhtml')->__('Date Updated'),
80: 'index'=>'modified_at',
81: 'gmtoffset' => true,
82: 'type'=>'datetime'
83: ));
84:
85: $this->addColumn('subject',
86: array(
87: 'header'=>Mage::helper('adminhtml')->__('Subject'),
88: 'index'=>'template_subject'
89: ));
90: 91: 92: 93: 94: 95: 96: 97:
98: $this->addColumn('type',
99: array(
100: 'header'=>Mage::helper('adminhtml')->__('Template Type'),
101: 'index'=>'template_type',
102: 'filter' => 'adminhtml/system_email_template_grid_filter_type',
103: 'renderer' => 'adminhtml/system_email_template_grid_renderer_type'
104: ));
105:
106: $this->addColumn('action',
107: array(
108: 'header' => Mage::helper('adminhtml')->__('Action'),
109: 'index' => 'template_id',
110: 'sortable' => false,
111: 'filter' => false,
112: 'width' => '100px',
113: 'renderer' => 'adminhtml/system_email_template_grid_renderer_action'
114: ));
115: return $this;
116: }
117:
118: public function getRowUrl($row)
119: {
120: return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
121: }
122:
123: }
124:
125: