Skip to content

Commit

Permalink
Merge branch '1.9.4.x' into split-Mage_All
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored Aug 24, 2022
2 parents eddcbd6 + 620cc0a commit f9a1a86
Show file tree
Hide file tree
Showing 293 changed files with 1,613 additions and 1,990 deletions.
699 changes: 0 additions & 699 deletions .github/phpstan-baseline.neon

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)
->group('severity')
->where('is_remove=?', 0)
->where('is_read=?', 0);
$return = $adapter->fetchPairs($select);
return $return;
return $adapter->fetchPairs($select);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public function getResTreeJson()

$rootArray = $this->_getNodeJson($resources,1);

$json = Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : []);

return $json;
return Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : []);
}

protected function _sortTree($a, $b)
Expand Down
6 changes: 2 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,13 @@ public function getMoveUrl()
public function getTree($parenNodeCategory=null)
{
$rootArray = $this->_getNodeJson($this->getRoot($parenNodeCategory));
$tree = isset($rootArray['children']) ? $rootArray['children'] : [];
return $tree;
return isset($rootArray['children']) ? $rootArray['children'] : [];
}

public function getTreeJson($parenNodeCategory=null)
{
$rootArray = $this->_getNodeJson($this->getRoot($parenNodeCategory));
$json = Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : []);
return $json;
return Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : []);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public function getIsLastFieldset()
*/
public function getCurrencyPrice($price)
{
/** @var Mage_Core_Helper_Data $helper */
$helper = $this->helper('core');
$store = $this->getProduct()->getStore();
return $this->helper('core')->currencyByStore($price, $store, false);
return $helper::currencyByStore($price, $store, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public function getProduct()
if (!$this->hasData('product')) {
$this->setData('product', Mage::registry('product'));
}
$product = $this->getData('product');

return $product;
return $this->getData('product');
}

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


/**
* Adminhtml catalog product edit action attributes update tab block
*
Expand All @@ -36,6 +35,9 @@ protected function _construct()
$this->setShowGlobalIcon(true);
}

/**
* @return $this
*/
protected function _prepareForm()
{
$this->setFormExcludedFieldList([
Expand Down Expand Up @@ -64,7 +66,9 @@ protected function _prepareForm()
*/
public function getAttributes()
{
return $this->helper('adminhtml/catalog_product_edit_action_attribute')->getAttributes()->getItems();
/** @var Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute $helper */
$helper = $this->helper('adminhtml/catalog_product_edit_action_attribute');
return $helper->getAttributes()->getItems();
}

/**
Expand Down Expand Up @@ -101,23 +105,32 @@ protected function _getAdditionalElementHtml($element)
}

/**
* ######################## TAB settings #################################
* @return string
*/
public function getTabLabel()
{
return Mage::helper('catalog')->__('Attributes');
}

/**
* @return string
*/
public function getTabTitle()
{
return Mage::helper('catalog')->__('Attributes');
}

/**
* @return true
*/
public function canShowTab()
{
return true;
}

/**
* @return false
*/
public function isHidden()
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ protected function _prepareLayout()

public function getAddButtonId()
{
$buttonId = $this->getLayout()
return $this->getLayout()
->getBlock('admin.product.options')
->getChild('add_button')->getId();
return $buttonId;
}

public function getDeleteButtonHtml()
Expand Down Expand Up @@ -199,12 +198,10 @@ public function getTemplatesHtml()
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);

$templates = $this->getChildHtml('text_option_type') . "\n" .
return $this->getChildHtml('text_option_type') . "\n" .
$this->getChildHtml('file_option_type') . "\n" .
$this->getChildHtml('select_option_type') . "\n" .
$this->getChildHtml('date_option_type');

return $templates;
}

public function getOptionValues()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ protected function _getHeaderHtml($element)

protected function _getFooterHtml($element)
{
$html = '</tbody></table></fieldset>';
return $html;
return '</tbody></table></fieldset>';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery extends Varien_Da

public function getElementHtml()
{
$html = $this->getContentHtml();
//$html.= $this->getAfterElementHtml();
return $html;
return $this->getContentHtml();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ protected function _getTaxObservingCode($attribute)
{
$spanId = "dynamic-tax-{$attribute->getAttributeCode()}";

$html = "<script type='text/javascript'>if (dynamicTaxes == undefined) var dynamicTaxes = new Array(); dynamicTaxes[dynamicTaxes.length]='{$attribute->getAttributeCode()}'</script>";
return $html;
return "<script type='text/javascript'>if (dynamicTaxes == undefined) var dynamicTaxes = new Array(); dynamicTaxes[dynamicTaxes.length]='{$attribute->getAttributeCode()}'</script>";
}

public function getEscapedValue($index=null)
Expand Down
19 changes: 10 additions & 9 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ class Mage_Adminhtml_Block_Catalog_Search_Grid extends Mage_Adminhtml_Block_Widg
{
/**
* Init Grid default properties
*
*/
public function __construct()
{
parent::__construct();
$this->setId('catalog_search_grid');
$this->setDefaultSort('name');
$this->setDefaultDir('ASC');
$this->setDefaultSort('query_id');
$this->setDefaultDir('asc');
$this->setSaveParametersInSession(true);
}

/**
* Prepare collection for Grid
*
* @return $this
* @inheritDoc
* @throws Mage_Core_Exception
*/
protected function _prepareCollection()
{
Expand All @@ -57,15 +57,16 @@ protected function _prepareCollection()
/**
* Prepare Grid columns
*
* @return $this
* @inheritDoc
* @throws Exception
*/
protected function _prepareColumns()
{
/*$this->addColumn('query_id', array(
$this->addColumn('query_id', array(
'header' => Mage::helper('catalog')->__('ID'),
'width' => '50px',
'index' => 'query_id',
));*/
));

$this->addColumn('search_query', [
'header' => Mage::helper('catalog')->__('Search Query'),
Expand Down Expand Up @@ -143,7 +144,7 @@ protected function _prepareColumns()
/**
* Prepare grid massaction actions
*
* @return $this
* @inheritDoc
*/
protected function _prepareMassaction()
{
Expand All @@ -162,11 +163,11 @@ protected function _prepareMassaction()
/**
* Retrieve Row Click callback URL
*
* @param Mage_CatalogSearch_Model_Query $row
* @return string
*/
public function getRowUrl($row)
{
return $this->getUrl('*/*/edit', ['id' => $row->getId()]);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
public function getRowClickCallback()
{
$chooserJsObject = $this->getId();
$js = '
return '
function (grid, event) {
var trElement = Event.findElement(event, "tr");
var blockId = trElement.down("td").innerHTML.replace(/^\s+|\s+$/g,"");
Expand All @@ -90,7 +90,6 @@ function (grid, event) {
'.$chooserJsObject.'.close();
}
';
return $js;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
public function getRowClickCallback()
{
$chooserJsObject = $this->getId();
$js = '
return '
function (grid, event) {
var trElement = Event.findElement(event, "tr");
var pageTitle = trElement.down("td").next().innerHTML;
Expand All @@ -89,7 +89,6 @@ function (grid, event) {
'.$chooserJsObject.'.close();
}
';
return $js;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function __construct()
* Initialize form
*
* @return $this
* @throws Mage_Core_Exception
*/
public function initForm()
{
Expand Down Expand Up @@ -117,7 +118,9 @@ function(v, elem){

$prefixElement = $form->getElement('prefix');
if ($prefixElement) {
$prefixOptions = $this->helper('customer')->getNamePrefixOptions($customerStoreId);
/** @var Mage_Customer_Helper_Data $helper */
$helper = $this->helper('customer');
$prefixOptions = $helper->getNamePrefixOptions($customerStoreId);
if (!empty($prefixOptions)) {
$fieldset->removeField($prefixElement->getId());
$prefixField = $fieldset->addField($prefixElement->getId(),
Expand All @@ -135,7 +138,9 @@ function(v, elem){

$suffixElement = $form->getElement('suffix');
if ($suffixElement) {
$suffixOptions = $this->helper('customer')->getNameSuffixOptions($customerStoreId);
/** @var Mage_Customer_Helper_Data $helper */
$helper = $this->helper('customer');
$suffixOptions = $helper->getNameSuffixOptions($customerStoreId);
if (!empty($suffixOptions)) {
$fieldset->removeField($suffixElement->getId());
$suffixField = $fieldset->addField($suffixElement->getId(),
Expand Down
Loading

0 comments on commit f9a1a86

Please sign in to comment.