Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 35 of file Price.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Price.php.

00038     {
00039         parent::__construct();
00040 
00041         $this->setId('alertPrice');
00042         $this->setDefaultSort('add_date');
00043         $this->setDefaultSort('desc');
00044         $this->setUseAjax(true);
00045         $this->setFilterVisibility(false);
00046         $this->setEmptyText(Mage::helper('catalog')->__('There are no customers for this alert'));
00047     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 49 of file Price.php.

00050     {
00051         $productId = $this->getRequest()->getParam('id');
00052         $websiteId = 0;
00053         if ($store = $this->getRequest()->getParam('store')) {
00054             $websiteId = Mage::app()->getStore($store)->getWebsiteId();
00055         }
00056         $collection = Mage::getModel('productalert/price')
00057             ->getCustomerCollection()
00058             ->join($productId, $websiteId);
00059         $this->setCollection($collection);
00060         return parent::_prepareCollection();
00061     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 63 of file Price.php.

00064     {
00065         $this->addColumn('firstname', array(
00066             'header'    => Mage::helper('catalog')->__('First Name'),
00067             'index'     => 'firstname',
00068         ));
00069 
00070         $this->addColumn('lastname', array(
00071             'header'    => Mage::helper('catalog')->__('Last Name'),
00072             'index'     => 'lastname',
00073         ));
00074 
00075         $this->addColumn('email', array(
00076             'header'    => Mage::helper('catalog')->__('Email'),
00077             'index'     => 'email',
00078         ));
00079 
00080         $this->addColumn('price', array(
00081             'header'    => Mage::helper('catalog')->__('Price'),
00082             'index'     => 'price',
00083             'type'      => 'currency',
00084             'currency_code'
00085                         => Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE)
00086         ));
00087 
00088         $this->addColumn('add_date', array(
00089             'header'    => Mage::helper('catalog')->__('Date Subscribed'),
00090             'index'     => 'add_date',
00091             'type'      => 'date'
00092         ));
00093 
00094         $this->addColumn('last_send_date', array(
00095             'header'    => Mage::helper('catalog')->__('Last Notification'),
00096             'index'     => 'last_send_date',
00097             'type'      => 'date'
00098         ));
00099 
00100         $this->addColumn('send_count', array(
00101             'header'    => Mage::helper('catalog')->__('Send Count'),
00102             'index'     => 'send_count',
00103         ));
00104 
00105         return parent::_prepareColumns();
00106     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 108 of file Price.php.

00109     {
00110         $productId = $this->getRequest()->getParam('id');
00111         $storeId   = $this->getRequest()->getParam('store', 0);
00112         if ($storeId) {
00113             $storeId = Mage::app()->getStore($storeId)->getId();
00114         }
00115         return $this->getUrl('*/catalog_product/alertsPriceGrid', array(
00116             'id'    => $productId,
00117             'store' => $storeId
00118         ));
00119     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:44 2009 for Magento by  doxygen 1.5.8