Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml backups grid block
*
Expand Down Expand Up @@ -56,7 +58,7 @@ protected function _prepareMassaction()
$this->setMassactionIdField('id');
$this->getMassactionBlock()->setFormFieldName('ids');

$this->getMassactionBlock()->addItem('delete', [
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('adminhtml')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('backup')->__('Are you sure you want to delete the selected backup(s)?')
Expand Down
16 changes: 10 additions & 6 deletions app/code/core/Mage/Adminhtml/Block/Cache/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* @category Mage
* @package Mage_Adminhtml
Expand Down Expand Up @@ -63,7 +65,7 @@ protected function _afterLoadCollection()
}

/**
* Prepare grid columns
* @inheritDoc
*/
protected function _prepareColumns()
{
Expand Down Expand Up @@ -136,6 +138,8 @@ public function getRowUrl($row)

/**
* Add mass-actions to grid
*
* @return $this
*/
protected function _prepareMassaction()
{
Expand All @@ -144,15 +148,15 @@ protected function _prepareMassaction()

$modeOptions = Mage::getModel('index/process')->getModesOptions();

$this->getMassactionBlock()->addItem('enable', [
'label' => Mage::helper('index')->__('Enable'),
'url' => $this->getUrl('*/*/massEnable'),
$this->getMassactionBlock()->addItem(MassAction::ENABLE, [
'label' => Mage::helper('index')->__('Enable'),
'url' => $this->getUrl('*/*/massEnable'),
]);
$this->getMassactionBlock()->addItem('disable', [
$this->getMassactionBlock()->addItem(MassAction::DISABLE, [
'label' => Mage::helper('index')->__('Disable'),
'url' => $this->getUrl('*/*/massDisable'),
]);
$this->getMassactionBlock()->addItem('refresh', [
$this->getMassactionBlock()->addItem(MassAction::REFRESH, [
'label' => Mage::helper('index')->__('Refresh'),
'url' => $this->getUrl('*/*/massRefresh'),
'selected' => true,
Expand Down
11 changes: 6 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml customer grid block
*
Expand Down Expand Up @@ -310,16 +312,15 @@ protected function _prepareMassaction()
$this->setMassactionIdField('entity_id');
$this->getMassactionBlock()->setFormFieldName('product');

$this->getMassactionBlock()->addItem('delete', [
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('catalog')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('catalog')->__('Are you sure?')
'url' => $this->getUrl('*/*/massDelete')
]);

$statuses = Mage::getSingleton('catalog/product_status')->getOptionArray();

array_unshift($statuses, ['label' => '', 'value' => '']);
$this->getMassactionBlock()->addItem('status', [
$this->getMassactionBlock()->addItem(MassAction::STATUS, [
'label' => Mage::helper('catalog')->__('Change status'),
'url' => $this->getUrl('*/*/massStatus', ['_current' => true]),
'additional' => [
Expand All @@ -334,7 +335,7 @@ protected function _prepareMassaction()
]);

if (Mage::getSingleton('admin/session')->isAllowed('catalog/update_attributes')) {
$this->getMassactionBlock()->addItem('attributes', [
$this->getMassactionBlock()->addItem(MassAction::ATTRIBUTES, [
'label' => Mage::helper('catalog')->__('Update Attributes'),
'url' => $this->getUrl('*/catalog_product_action_attribute/edit', ['_current' => true])
]);
Expand Down
7 changes: 4 additions & 3 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* @category Mage
* @category Mage
Expand Down Expand Up @@ -152,10 +154,9 @@ protected function _prepareMassaction()
$this->setMassactionIdField('query_id');
$this->getMassactionBlock()->setFormFieldName('search');

$this->getMassactionBlock()->addItem('delete', [
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('catalog')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('catalog')->__('Are you sure?')
'url' => $this->getUrl('*/*/massDelete')
]);

return parent::_prepareMassaction();
Expand Down
13 changes: 7 additions & 6 deletions app/code/core/Mage/Adminhtml/Block/Customer/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml customer grid block
*
Expand Down Expand Up @@ -178,18 +180,17 @@ protected function _prepareMassaction()
$this->setMassactionIdField('entity_id');
$this->getMassactionBlock()->setFormFieldName('customer');

$this->getMassactionBlock()->addItem('delete', [
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('customer')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('customer')->__('Are you sure?')
'url' => $this->getUrl('*/*/massDelete')
]);

$this->getMassactionBlock()->addItem('newsletter_subscribe', [
$this->getMassactionBlock()->addItem(MassAction::NEWSLETTER_SUBSCRIBE, [
'label' => Mage::helper('customer')->__('Subscribe to Newsletter'),
'url' => $this->getUrl('*/*/massSubscribe')
]);

$this->getMassactionBlock()->addItem('newsletter_unsubscribe', [
$this->getMassactionBlock()->addItem(MassAction::NEWSLETTER_UNSUBSCRIBE, [
'label' => Mage::helper('customer')->__('Unsubscribe from Newsletter'),
'url' => $this->getUrl('*/*/massUnsubscribe')
]);
Expand All @@ -199,7 +200,7 @@ protected function _prepareMassaction()
$groups = $helper->getGroups()->toOptionArray();

array_unshift($groups, ['label' => '', 'value' => '']);
$this->getMassactionBlock()->addItem('assign_group', [
$this->getMassactionBlock()->addItem(MassAction::ASSIGN_GROUP, [
'label' => Mage::helper('customer')->__('Assign a Customer Group'),
'url' => $this->getUrl('*/*/massAssignGroup'),
'additional' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml newsletter subscribers grid block
*
Expand Down Expand Up @@ -201,12 +203,12 @@ protected function _prepareMassaction()
$this->getMassactionBlock()->setFormFieldName('subscriber');
$this->getMassactionBlock()->setUseSelectAll(false);

$this->getMassactionBlock()->addItem('unsubscribe', [
$this->getMassactionBlock()->addItem(MassAction::UNSUBSCRIBE, [
'label' => Mage::helper('newsletter')->__('Unsubscribe'),
'url' => $this->getUrl('*/*/massUnsubscribe')
]);

$this->getMassactionBlock()->addItem('delete', [
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('newsletter')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete')
]);
Expand Down
9 changes: 5 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Notification/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml AdminNotification inbox grid
*
Expand Down Expand Up @@ -95,15 +97,14 @@ protected function _prepareMassaction()
$this->setMassactionIdField('notification_id');
$this->getMassactionBlock()->setFormFieldName('notification');

$this->getMassactionBlock()->addItem('mark_as_read', [
$this->getMassactionBlock()->addItem(MassAction::MARK_AS_READ, [
'label' => Mage::helper('adminnotification')->__('Mark as Read'),
'url' => $this->getUrl('*/*/massMarkAsRead', ['_current' => true]),
]);

$this->getMassactionBlock()->addItem('remove', [
$this->getMassactionBlock()->addItem(MassAction::REMOVE, [
'label' => Mage::helper('adminnotification')->__('Remove'),
'url' => $this->getUrl('*/*/massRemove'),
'confirm' => Mage::helper('adminnotification')->__('Are you sure?')
'url' => $this->getUrl('*/*/massRemove')
]);

return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Coupon codes grid
*
Expand All @@ -38,7 +40,7 @@ public function __construct()
/**
* Prepare collection for grid
*
* @return Mage_Adminhtml_Block_Widget_Grid
* @inheritDoc
*/
protected function _prepareCollection()
{
Expand Down Expand Up @@ -114,10 +116,10 @@ protected function _prepareMassaction()
$this->getMassactionBlock()->setUseAjax(true);
$this->getMassactionBlock()->setHideFormElement(true);

$this->getMassactionBlock()->addItem('delete', [
'label' => Mage::helper('adminhtml')->__('Delete'),
'url' => $this->getUrl('*/*/couponsMassDelete', ['_current' => true]),
'confirm' => Mage::helper('salesrule')->__('Are you sure you want to delete the selected coupon(s)?'),
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
'label' => Mage::helper('adminhtml')->__('Delete'),
'url' => $this->getUrl('*/*/couponsMassDelete', ['_current' => true]),
'confirm' => Mage::helper('salesrule')->__('Are you sure you want to delete the selected coupon(s)?'),
'complete' => 'refreshCouponCodesGrid'
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;

/**
* Adminhtml sales report grid block
*
Expand All @@ -36,6 +38,11 @@ public function __construct()
$this->setUseAjax(false);
}

/**
* @param string $reportCode
* @return string
* @throws Zend_Date_Exception
*/
protected function _getUpdatedAt($reportCode)
{
$flag = Mage::getModel('reports/flag')->setReportFlagCode($reportCode)->loadSelf();
Expand All @@ -48,6 +55,9 @@ protected function _getUpdatedAt($reportCode)
: '';
}

/**
* @inheritDoc
*/
protected function _prepareCollection()
{
$collection = new Varien_Data_Collection();
Expand Down Expand Up @@ -114,6 +124,9 @@ protected function _prepareCollection()
return parent::_prepareCollection();
}

/**
* @inheritDoc
*/
protected function _prepareColumns()
{
$this->addColumn('report', [
Expand Down Expand Up @@ -142,18 +155,21 @@ protected function _prepareColumns()
return parent::_prepareColumns();
}

/**
* @return $this
*/
protected function _prepareMassaction()
{
$this->setMassactionIdField('id');
$this->getMassactionBlock()->setFormFieldName('code');

$this->getMassactionBlock()->addItem('refresh_lifetime', [
$this->getMassactionBlock()->addItem(MassAction::REFRESH_LIFETIME, [
'label' => Mage::helper('reports')->__('Refresh Lifetime Statistics'),
'url' => $this->getUrl('*/*/refreshLifetime'),
'confirm' => Mage::helper('reports')->__('Are you sure you want to refresh lifetime statistics? There can be performance impact during this operation.')
]);

$this->getMassactionBlock()->addItem('refresh_recent', [
$this->getMassactionBlock()->addItem(MassAction::REFRESH_RECENT, [
'label' => Mage::helper('reports')->__('Refresh Statistics for the Last Day'),
'url' => $this->getUrl('*/*/refreshRecent'),
'confirm' => Mage::helper('reports')->__('Are you sure?'),
Expand Down
Loading