Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4ec816b
update buttons
sreichel Apr 21, 2026
d1f8b99
added data-test id to login.
sreichel Apr 21, 2026
b500389
update
sreichel Apr 21, 2026
7e32637
update
sreichel Apr 21, 2026
15b4289
update
sreichel Apr 21, 2026
21798c7
update
sreichel Apr 21, 2026
df96102
update
sreichel Apr 21, 2026
0b450d8
varien elements
sreichel Apr 21, 2026
7f3afd9
update
sreichel Apr 21, 2026
f2c84af
update
sreichel Apr 21, 2026
69c4791
update
sreichel Apr 21, 2026
0949b09
update
sreichel Apr 21, 2026
47d2730
update
sreichel Apr 21, 2026
b5051ed
update
sreichel Apr 22, 2026
4c3f40f
Apply suggestion from @sreichel
sreichel Apr 22, 2026
670926a
Merge remote-tracking branch 'origin/feat/prepared-buttons' into feat…
sreichel Apr 22, 2026
a0b2c52
fix level
sreichel Apr 22, 2026
39f6367
phpmd
sreichel Apr 22, 2026
17fe823
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 22, 2026
dd36ca8
rector
sreichel Apr 22, 2026
e29fd2c
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 22, 2026
d756e49
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 22, 2026
91c86e8
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 22, 2026
b4aebca
minor
sreichel Apr 23, 2026
4dc677f
minor
sreichel Apr 23, 2026
23deac6
minor
sreichel Apr 23, 2026
5ad2499
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 23, 2026
cbeb2b5
cleanup
sreichel Apr 23, 2026
08c56c5
Merge branch 'main' into feat/prepared-buttons
sreichel Apr 24, 2026
6a26f5c
update buttons
sreichel Apr 24, 2026
fa20590
cs
sreichel Apr 24, 2026
1307305
update buttons
sreichel Apr 24, 2026
84ac5c8
update buttons
sreichel Apr 24, 2026
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
33 changes: 19 additions & 14 deletions app/code/core/Mage/Adminhtml/Block/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,25 @@ public function __construct()
$this->_headerText = Mage::helper('core')->__('Cache Storage Management');
parent::__construct();
$this->_removeButton(self::BUTTON_TYPE_ADD);
$this->_addButton('flush_magento', [
'label' => Mage::helper('core')->__('Flush & Apply Updates'),
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getFlushSystemUrl()),
'class' => 'delete cache',
]);

$this->_addButton('flush_system', [
'label' => Mage::helper('core')->__('Flush Cache Storage'),
'onclick' => Mage::helper('core/js')->getConfirmSetLocationJs(
$this->getFlushStorageUrl(),
Mage::helper('core')->__('Cache storage may contain additional data. Are you sure that you want flush it?'),
),
'class' => 'delete flush',
]);

$this->_addPreparedButton(
id: 'flush_magento',
label: Mage::helper('core')->__('Flush & Apply Updates'),
class: 'delete cache',
onClickUrl: $this->getFlushSystemUrl(),
);

$onClick = Mage::helper('core/js')->getConfirmSetLocationJs(
$this->getFlushStorageUrl(),
Mage::helper('core')->__('Are you sure you want to flush cache storage?'),
);

$this->_addPreparedButton(
id: 'flush_system',
label: Mage::helper('core')->__('Flush Cache Storage'),
class: 'delete flush',
onClick: $onClick,
);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public function __construct()
#[Override]
protected function _prepareLayout()
{
$this->_addButton('add_new', [
'label' => Mage::helper('catalog')->__('Add Product'),
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getUrl('*/*/new')),
'class' => 'add',
]);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_ADD,
label: Mage::helper('catalog')->__('Add Product'),
onClickUrl: $this->getUrl('*/*/new'),
);

$this->setChild('grid', $this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid'));
return parent::_prepareLayout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,15 @@ public function __construct()

if ($this->getRequest()->getParam('popup')) {
$this->_removeButton(self::BUTTON_TYPE_BACK);
$this->_addButton(
self::BUTTON_TYPE_CLOSE,
[
'label' => Mage::helper('catalog')->__('Close Window'),
'class' => 'cancel',
'onclick' => 'window.close()',
'level' => -1,
],
$this->_addPreparedButton(
id: self::BUTTON_TYPE_CLOSE,
module: 'catalog',
);
} else {
$this->_addButton(
'save_and_edit_button',
[
'label' => Mage::helper('catalog')->__('Save and Continue Edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save continue',
],
100,
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: 100,
module: 'catalog',
);
}

Expand Down
9 changes: 4 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ public function __construct()
parent::__construct();

if ($this->_isAllowedAction('save')) {
$this->_addButton(self::BUTTON_TYPE_SAVE_EDIT, [
'label' => Mage::helper('adminhtml')->__('Save and Continue Edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save continue',
], -100);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: -100,
);
} else {
$this->_removeButton(self::BUTTON_TYPE_SAVE);
}
Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function __construct()
parent::__construct();

if ($this->_isAllowedAction('save')) {
$this->_addButton(self::BUTTON_TYPE_SAVE_EDIT, [
'label' => Mage::helper('adminhtml')->__('Save and Continue Edit'),
'onclick' => Mage::helper('core/js')->getSaveAndContinueEditJs($this->_getSaveAndContinueUrl()),
'class' => 'save continue',
], -100);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: -100,
onClick: Mage::helper('core/js')->getSaveAndContinueEditJs($this->_getSaveAndContinueUrl()),
);
} else {
$this->_removeButton(self::BUTTON_TYPE_SAVE);
}
Expand Down
22 changes: 12 additions & 10 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ public function __construct()
if ($this->getCustomerId()
&& Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/create')
) {
$this->_addButton('order', [
'label' => Mage::helper('customer')->__('Create Order'),
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getCreateOrderUrl()),
'class' => 'add create-order',
], 0);
$this->_addPreparedButton(
id: 'order',
label: Mage::helper('customer')->__('Create Order'),
class: 'add create-order',
onClickUrl: $this->getCreateOrderUrl(),
);
}

parent::__construct();
Expand Down Expand Up @@ -95,11 +96,12 @@ public function getValidationUrl()
protected function _prepareLayout()
{
if (!Mage::registry('current_customer')->isReadonly()) {
$this->_addButton(self::BUTTON_TYPE_SAVE_EDIT, [
'label' => Mage::helper('customer')->__('Save and Continue Edit'),
'onclick' => Mage::helper('core/js')->getSaveAndContinueEditJs($this->_getSaveAndContinueUrl()),
'class' => 'save continue',
], 10);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: 10,
module: 'customer',
onClick: Mage::helper('core/js')->getSaveAndContinueEditJs($this->_getSaveAndContinueUrl()),
);
}

return parent::_prepareLayout();
Expand Down
11 changes: 6 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ class Mage_Adminhtml_Block_Promo_Catalog extends Mage_Adminhtml_Block_Widget_Gri
{
public function __construct()
{
$this->_addButton('apply_rules', [
'label' => Mage::helper('catalogrule')->__('Apply Rules'),
'onclick' => "location.href='" . $this->getUrl('*/*/applyRules') . "'",
'class' => 'apply',
]);
$this->_addPreparedButton(
id: 'apply_rules',
label: Mage::helper('catalogrule')->__('Apply Rules'),
class: 'apply',
onClick: "location.href='" . $this->getUrl('*/*/applyRules') . "'",
);

$this->_controller = 'promo_catalog';
$this->_headerText = Mage::helper('catalogrule')->__('Catalog Price Rules');
Expand Down
22 changes: 12 additions & 10 deletions app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ public function __construct()

parent::__construct();

$this->_addButton('save_apply', [
'class' => 'save apply',
'label' => Mage::helper('catalogrule')->__('Save and Apply'),
'onclick' => "$('rule_auto_apply').value=1; editForm.submit()",
]);
$this->_addPreparedButton(
id: 'save_apply',
label: Mage::helper('catalogrule')->__('Save and Apply'),
class: 'save apply',
onClick: "$('rule_auto_apply').value=1; editForm.submit()",
);

$this->_addButton('save_and_continue_edit', [
'class' => 'save continue',
'label' => Mage::helper('catalogrule')->__('Save and Continue Edit'),
'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')',
], 10);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: 10,
module: 'catalogrule',
onClick: 'editForm.submit($(\'edit_form\').action + \'back/edit/\')',
);
}

/**
Expand Down
11 changes: 6 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ public function __construct()

parent::__construct();

$this->_addButton('save_and_continue_edit', [
'class' => 'save continue',
'label' => Mage::helper('salesrule')->__('Save and Continue Edit'),
'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')',
], 10);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_SAVE_EDIT,
level: 10,
module: 'salesrule',
onClick: 'editForm.submit($(\'edit_form\').action + \'back/edit/\')',
);
}

/**
Expand Down
61 changes: 32 additions & 29 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,50 @@
$this->_removeButton(self::BUTTON_TYPE_DELETE);

if ($this->getCreditmemo()->canCancel()) {
$this->_addButton(self::BUTTON_TYPE_CANCEL, [
'label' => Mage::helper('sales')->__('Cancel'),
'class' => 'delete',
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getCancelUrl()),
]);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_CANCEL,
module: 'sales',
onClickUrl: $this->getCancelUrl(),
);
}

if ($this->_isAllowedAction('emails')) {
$this->addButton('send_notification', [
'label' => Mage::helper('sales')->__('Send Email'),
'onclick' => Mage::helper('core/js')->getConfirmSetLocationJs(
$this->getEmailUrl(),
Mage::helper('sales')->__('Are you sure you want to send Creditmemo email to customer?'),
),
'class' => 'send-email',
]);
$onClick = Mage::helper('core/js')->getConfirmSetLocationJs(

Check failure on line 42 in app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "core/js" 3 times.

See more on https://sonarcloud.io/project/issues?id=OpenMage_magento-lts&issues=AZ29guof1EVPJuqYnVSu&open=AZ29guof1EVPJuqYnVSu&pullRequest=5511
$this->getEmailUrl(),
Mage::helper('sales')->__('Are you sure you want to send Creditmemo email to customer?'),
);

$this->_addPreparedButton(
id: 'send_notification',
label: Mage::helper('sales')->__('Send Email'),
class: 'send-email',
onClick: $onClick,
);
}

if ($this->getCreditmemo()->canRefund()) {
$this->_addButton('refund', [
'label' => Mage::helper('sales')->__('Refund'),
'class' => 'save refund',
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getRefundUrl()),
]);
$this->_addPreparedButton(
id: 'refund',
label: Mage::helper('sales')->__('Refund'),
class: 'save refund',
onClickUrl: $this->getRefundUrl(),
);
}

if ($this->getCreditmemo()->canVoid()) {
$this->_addButton(self::BUTTON_TYPE_VOID, [
'label' => Mage::helper('sales')->__('Void'),
'class' => 'save void',
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getVoidUrl()),

]);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_VOID,
module: 'sales',
onClickUrl: $this->getVoidUrl(),
);
}

if ($this->getCreditmemo()->getId()) {
$this->_addButton(self::BUTTON_TYPE_PRINT, [
'label' => Mage::helper('sales')->__('Print'),
'class' => 'save print',
'onclick' => Mage::helper('core/js')->getSetLocationJs($this->getPrintUrl()),
]);
$this->_addPreparedButton(
id: self::BUTTON_TYPE_PRINT,
module: 'sales',
onClickUrl: $this->getPrintUrl(),
);
}
}

Expand Down
Loading
Loading