00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Helper_Dashboard_Order extends Mage_Adminhtml_Helper_Dashboard_Abstract
00035 {
00036
00037 protected function _initCollection()
00038 {
00039 $isFilter = $this->getParam('store') || $this->getParam('website') || $this->getParam('group');
00040
00041 $this->_collection = Mage::getResourceSingleton('reports/order_collection')
00042 ->prepareSummary($this->getParam('period'), 0, 0, $isFilter);
00043
00044 if ($this->getParam('store')) {
00045 $this->_collection->addAttributeToFilter('store_id', $this->getParam('store'));
00046 } else if ($this->getParam('website')){
00047 $storeIds = Mage::app()->getWebsite($this->getParam('website'))->getStoreIds();
00048 $this->_collection->addAttributeToFilter('store_id', array('in' => implode(',', $storeIds)));
00049 } else if ($this->getParam('group')){
00050 $storeIds = Mage::app()->getGroup($this->getParam('group'))->getStoreIds();
00051 $this->_collection->addAttributeToFilter('store_id', array('in' => implode(',', $storeIds)));
00052 }
00053
00054 $this->_collection->load();
00055 }
00056
00057 }