Skip to content

Commit

Permalink
Merge branch 'version/2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ToothpasteFeet committed May 13, 2019
2 parents b409e1c + 6927c8c commit b91c246
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ protected function _prepareCollection()
->addFieldToFilter('main_table.type', array('eq' => $this->getOperationType()))
->addFieldToFilter('main_table.entity', array('eq' => $this->getEntityType()));

$importLinesTable = Mage::getSingleton('core/resource')->getTableName('realtimedespatch_import_lines');
$requestsTable = Mage::getSingleton('core/resource')->getTableName('realtimedespatch_requests');
$importLinesTable = Mage::getSingleton('core/resource')->getTableName('realtimedespatch_import_lines');

$collection->getSelect()->join(
array('t2' => $importLinesTable),
$collection->getSelect()->join(
array('t2' => $importLinesTable),
'main_table.entity_id = t2.import_id'
);

$collection->getSelect()->join(
array('t3' => $requestsTable),
'main_table.request_id = t3.entity_id'
);

$collection->getSelect()->group(
'import_id'
);
Expand All @@ -65,7 +71,7 @@ protected function _prepareColumns()
$this->addColumn('message_id', array(
'header' => Mage::helper('realtimedespatch')->__('Message ID'),
'align' => 'left',
'index' => 'message_id',
'index' => 't3.message_id',
'renderer' => new SixBySix_RealTimeDespatch_Block_Adminhtml_Renderer_Request_Id(),
));

Expand Down Expand Up @@ -120,7 +126,7 @@ protected function _prepareColumns()
),
'filter' => false,
'sortable' => false,
));
));

Mage::dispatchEvent('adminhtml_orderflow_imports_grid_prepare_columns', array('block' => $this));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function _prepareColumns()
'Inventory' => Mage::helper('realtimedespatch')->__('Inventory'),
'Shipment' => Mage::helper('realtimedespatch')->__('Shipment')
),
'filter_index' => 'type',
'filter_index' => 'main_table.type',
));

$this->addColumn('Received', array(
Expand Down
8 changes: 3 additions & 5 deletions app/code/community/SixBySix/RealTimeDespatch/Model/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ public function getLines()
*/
public function getMessageId()
{
if ( ! parent::getMessageId()) {
return 'Unavailable';
}

return parent::getMessageId();
return Mage::getModel('realtimedespatch/request')
->load($this->getRequestId())
->getMessageId();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<SixBySix_RealTimeDespatch>
<version>1.0.0.39</version>
<version>2.0.0</version>
</SixBySix_RealTimeDespatch>
</modules>
<admin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

$installer = $this;
$installer->startSetup();

// Enable Symlinks

Mage::getConfig()->saveConfig('dev/template/allow_symlink', '1', 'default', 0);

// Apply Performance Indexes

$connection->addIndex(
$installer->getTable('realtimedespatch/request'),
$installer->getIdxName(
'realtimedespatch/request',
array('type'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('type'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
);

$connection->addIndex(
$installer->getTable('realtimedespatch/request'),
$installer->getIdxName(
'realtimedespatch/request',
array('message_id'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('message_id'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
);

$connection->addIndex(
$installer->getTable('realtimedespatch/request_line'),
$installer->getIdxName(
'realtimedespatch/request_line',
array('processed'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('processed'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
);

$connection->addIndex(
$installer->getTable('realtimedespatch/request_line'),
$installer->getIdxName(
'realtimedespatch/request_line',
array('created'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('created'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
);

$connection->addIndex(
$installer->getTable('realtimedespatch/request_line'),
$installer->getIdxName(
'realtimedespatch/request_line',
array('sequence_id', 'processed', 'type'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('sequence_id', 'processed', 'type'),
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
);

0 comments on commit b91c246

Please sign in to comment.