-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented Magento Validator library in order to have clear solid mechanism and formal rules of input data validation * Moved translations to module directories, so that it is much more convenient to manage module resources * Updated inline translation mechanism to support locales inheritance * Implemented ability to navigate through pending reviews with Prev/Next buttons, no need to switch to grid and back * Fixed issues: * Unable to use shell-installer after changes in Backend area routing process * Incorrect redirect after entering wrong captcha on the "Forgot your user name or password?" backend page * Translation is absent for several strings in Sales module `guest/form.phtml` template * Exception during installation process, when `var` directory is not empty * Node `modules` is merged to all modules' config XML-files, although it must be merged to `config.xml` only * GitHub requests: * [#39](#39) -- added `composer.json`, which was announced at previous update, but mistakenly omitted from publishing
- Loading branch information
1 parent
1617a6e
commit a27835b
Showing
507 changed files
with
1,809 additions
and
1,368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,23 +27,53 @@ | |
/** | ||
* Adminhtml reviews grid | ||
* | ||
* @method int getProductId() getProductId() | ||
* @method Mage_Adminhtml_Block_Review_Grid setProductId() setProductId(int $productId) | ||
* @method int getCustomerId() getCustomerId() | ||
* @method Mage_Adminhtml_Block_Review_Grid setCustomerId() setCustomerId(int $customerId) | ||
* @method Mage_Adminhtml_Block_Review_Grid setMassactionIdFieldOnlyIndexValue() setMassactionIdFieldOnlyIndexValue(bool $onlyIndex) | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid | ||
class Mage_Adminhtml_Block_Review_Grid extends Mage_Backend_Block_Widget_Grid | ||
{ | ||
|
||
/** | ||
* Initialize grid | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->setId('reviwGrid'); | ||
$this->setDefaultSort('created_at'); | ||
} | ||
|
||
/** | ||
* Save search results | ||
* | ||
* @return Mage_Backend_Block_Widget_Grid | ||
*/ | ||
protected function _afterLoadCollection() | ||
{ | ||
/** @var $actionPager Mage_Review_Helper_Action_Pager */ | ||
$actionPager = Mage::helper('Mage_Review_Helper_Action_Pager'); | ||
$actionPager->setStorageId('reviews'); | ||
$actionPager->setItems($this->getCollection()->getResultingIds()); | ||
|
||
return parent::_afterLoadCollection(); | ||
} | ||
|
||
/** | ||
* Prepare collection | ||
* | ||
* @return Mage_Adminhtml_Block_Review_Grid | ||
*/ | ||
protected function _prepareCollection() | ||
{ | ||
/** @var $model Mage_Review_Model_Review */ | ||
$model = Mage::getModel('Mage_Review_Model_Review'); | ||
/** @var $collection Mage_Review_Model_Resource_Review_Product_Collection */ | ||
$collection = $model->getProductCollection(); | ||
|
||
if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) { | ||
|
@@ -74,18 +104,25 @@ protected function _prepareCollection() | |
return parent::_prepareCollection(); | ||
} | ||
|
||
/** | ||
* Prepare grid columns | ||
* | ||
* @return Mage_Backend_Block_Widget_Grid | ||
*/ | ||
protected function _prepareColumns() | ||
{ | ||
/** @var $helper Mage_Review_Helper_Data */ | ||
$helper = Mage::helper('Mage_Review_Helper_Data'); | ||
$this->addColumn('review_id', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('ID'), | ||
'header' => $helper->__('ID'), | ||
'align' => 'right', | ||
'width' => '50px', | ||
'filter_index' => 'rt.review_id', | ||
'index' => 'review_id', | ||
)); | ||
|
||
$this->addColumn('created_at', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Created On'), | ||
'header' => $helper->__('Created On'), | ||
'align' => 'left', | ||
'type' => 'datetime', | ||
'width' => '100px', | ||
|
@@ -95,18 +132,18 @@ protected function _prepareColumns() | |
|
||
if( !Mage::registry('usePendingFilter') ) { | ||
$this->addColumn('status', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Status'), | ||
'header' => $helper->__('Status'), | ||
'align' => 'left', | ||
'type' => 'options', | ||
'options' => Mage::helper('Mage_Review_Helper_Data')->getReviewStatuses(), | ||
'options' => $helper->getReviewStatuses(), | ||
'width' => '100px', | ||
'filter_index' => 'rt.status_id', | ||
'index' => 'status_id', | ||
)); | ||
} | ||
|
||
$this->addColumn('title', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Title'), | ||
'header' => $helper->__('Title'), | ||
'align' => 'left', | ||
'width' => '100px', | ||
'filter_index' => 'rdt.title', | ||
|
@@ -117,7 +154,7 @@ protected function _prepareColumns() | |
)); | ||
|
||
$this->addColumn('nickname', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Nickname'), | ||
'header' => $helper->__('Nickname'), | ||
'align' => 'left', | ||
'width' => '100px', | ||
'filter_index' => 'rdt.nickname', | ||
|
@@ -128,7 +165,7 @@ protected function _prepareColumns() | |
)); | ||
|
||
$this->addColumn('detail', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Review'), | ||
'header' => $helper->__('Review'), | ||
'align' => 'left', | ||
'index' => 'detail', | ||
'filter_index' => 'rdt.detail', | ||
|
@@ -143,31 +180,31 @@ protected function _prepareColumns() | |
*/ | ||
if (!Mage::app()->isSingleStoreMode()) { | ||
$this->addColumn('visible_in', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Visible In'), | ||
'header' => $helper->__('Visible In'), | ||
'index' => 'stores', | ||
'type' => 'store', | ||
'store_view' => true, | ||
)); | ||
} | ||
|
||
$this->addColumn('type', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Type'), | ||
'header' => $helper->__('Type'), | ||
'type' => 'select', | ||
'index' => 'type', | ||
'filter' => 'Mage_Adminhtml_Block_Review_Grid_Filter_Type', | ||
'renderer' => 'Mage_Adminhtml_Block_Review_Grid_Renderer_Type' | ||
)); | ||
|
||
$this->addColumn('name', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Product Name'), | ||
'header' => $helper->__('Product Name'), | ||
'align' =>'left', | ||
'type' => 'text', | ||
'index' => 'name', | ||
'escape' => true | ||
)); | ||
|
||
$this->addColumn('sku', array( | ||
'header' => Mage::helper('Mage_Review_Helper_Data')->__('Product SKU'), | ||
'header' => $helper->__('Product SKU'), | ||
'align' => 'right', | ||
'type' => 'text', | ||
'width' => '50px', | ||
|
@@ -204,8 +241,16 @@ protected function _prepareColumns() | |
return parent::_prepareColumns(); | ||
} | ||
|
||
/** | ||
* Prepare grid mass actions | ||
* | ||
* @return Mage_Backend_Block_Widget_Grid|void | ||
*/ | ||
protected function _prepareMassaction() | ||
{ | ||
/** @var $helper Mage_Review_Helper_Data */ | ||
$helper = Mage::helper('Mage_Review_Helper_Data'); | ||
|
||
$this->setMassactionIdField('review_id'); | ||
$this->setMassactionIdFilter('rt.review_id'); | ||
$this->setMassactionIdFieldOnlyIndexValue(true); | ||
|
@@ -220,10 +265,10 @@ protected function _prepareMassaction() | |
'confirm' => Mage::helper('Mage_Review_Helper_Data')->__('Are you sure?') | ||
)); | ||
|
||
$statuses = Mage::helper('Mage_Review_Helper_Data')->getReviewStatusesOptionArray(); | ||
$statuses = $helper->getReviewStatusesOptionArray(); | ||
array_unshift($statuses, array('label'=>'', 'value'=>'')); | ||
$this->getMassactionBlock()->addItem('update_status', array( | ||
'label' => Mage::helper('Mage_Review_Helper_Data')->__('Update Status'), | ||
'label' => $helper->__('Update Status'), | ||
'url' => $this->getUrl( | ||
'*/*/massUpdateStatus', | ||
array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index') | ||
|
@@ -233,13 +278,19 @@ protected function _prepareMassaction() | |
'name' => 'status', | ||
'type' => 'select', | ||
'class' => 'required-entry', | ||
'label' => Mage::helper('Mage_Review_Helper_Data')->__('Status'), | ||
'label' => $helper->__('Status'), | ||
'values' => $statuses | ||
) | ||
) | ||
)); | ||
} | ||
|
||
/** | ||
* Get row url | ||
* | ||
* @param Mage_Review_Model_Review|Varien_Object $row | ||
* @return string | ||
*/ | ||
public function getRowUrl($row) | ||
{ | ||
return $this->getUrl('*/catalog_product_review/edit', array( | ||
|
@@ -250,6 +301,11 @@ public function getRowUrl($row) | |
)); | ||
} | ||
|
||
/** | ||
* Get grid url | ||
* | ||
* @return string | ||
*/ | ||
public function getGridUrl() | ||
{ | ||
if( $this->getProductId() || $this->getCustomerId() ) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.