Index: core/kernel/db/db_event_handler.php
===================================================================
--- core/kernel/db/db_event_handler.php
+++ core/kernel/db/db_event_handler.php
@@ -2952,13 +2952,8 @@
$this->Application->LinkVar('export_finish_t');
$this->Application->LinkVar('export_progress_t');
- $this->Application->StoreVar('export_oroginal_special', $event->Special);
-
- $export_helper = $this->Application->recallObject('CatItemExportHelper');
-
- /*list ($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'));
- $finish_url = $this->Application->BaseURL('/admin') . $index_file . '?' . ENV_VAR_NAME . '=' . $env;
- $this->Application->StoreVar('export_finish_url', $finish_url);*/
+ $this->Application->StoreVar('export_special', $event->Special);
+ $this->Application->StoreVar('export_grid', $this->Application->GetVar('grid', 'Default'));
$redirect_params = Array (
$this->Prefix . '.export_event' => 'OnNew',
Index: core/units/helpers/cat_dbitem_export_helper.php
===================================================================
--- core/units/helpers/cat_dbitem_export_helper.php
+++ core/units/helpers/cat_dbitem_export_helper.php
@@ -460,8 +460,12 @@
$sql = $this->exportOptions['ForceSelectSQL'];
}
else {
- $items_list = $this->Application->recallObject($this->curItem->Prefix . '.export-items-list', $this->curItem->Prefix . '_List');
- /* @var $items_list kDBList */
+ /** @var kDBList $items_list */
+ $items_list = $this->Application->recallObject(
+ $this->curItem->Prefix . '.' . $this->exportOptions['export_special'],
+ $this->curItem->Prefix . '_List',
+ array('grid' => $this->exportOptions['export_grid'])
+ );
$items_list->SetPerPage(-1);
@@ -1467,6 +1471,8 @@
// used for multistep export
$field_values['export_ids'] = $export_ids ? explode(',', $export_ids) : false;
$field_values['export_cats_ids'] = $export_cats_ids ? explode(',', $export_cats_ids) : Array ($this->Application->GetVar('m_cat_id'));
+ $field_values['export_special'] = $this->Application->RecallVar('export_special');
+ $field_values['export_grid'] = $this->Application->RecallVar('export_grid');
}
$field_values['ExportColumns'] = $field_values['ExportColumns'] ? explode('|', substr($field_values['ExportColumns'], 1, -1) ) : Array();
@@ -1574,4 +1580,4 @@
$object->setRequired($required_fields);
}
- }
\ No newline at end of file
+ }
Index: modules/in-commerce/admin_templates/orders/orders_search_list.tpl
===================================================================
--- modules/in-commerce/admin_templates/orders/orders_search_list.tpl
+++ modules/in-commerce/admin_templates/orders/orders_search_list.tpl
@@ -29,6 +29,7 @@
a_toolbar.AddButton( new ToolBarButton('export', '', function() {
set_hidden_field('export_finish_t', 'in-commerce/orders/export/export_finish');
set_hidden_field('export_progress_t', 'in-commerce/orders/export/export_progress');
+ set_hidden_field('grid', 'Search');
open_popup('ord.search', 'OnExport', 'in-commerce/orders/export/export');
}
) );
@@ -68,4 +69,4 @@
\ No newline at end of file
+
Index: modules/in-commerce/units/orders/orders_event_handler.php
===================================================================
--- modules/in-commerce/units/orders/orders_event_handler.php
+++ modules/in-commerce/units/orders/orders_event_handler.php
@@ -3737,24 +3737,8 @@
{
parent::OnBeforeExportBegin($event);
- $options = $event->getEventParam('options');
-
- $items_list = $this->Application->recallObject($event->Prefix . '.' . $this->Application->RecallVar('export_oroginal_special'), $event->Prefix . '_List');
- /* @var $items_list kDBList */
-
- $items_list->SetPerPage(-1);
-
- if ( $options['export_ids'] != '' ) {
- $items_list->AddFilter('export_ids', $items_list->TableName . '.' . $items_list->IDField . ' IN (' . implode(',', $options['export_ids']) . ')');
- }
-
- $options['ForceCountSQL'] = $items_list->getCountSQL($items_list->GetSelectSQL(true, false));
- $options['ForceSelectSQL'] = $items_list->GetSelectSQL();
-
- $event->setEventParam('options', $options);
-
+ /** @var kDBItem $object */
$object = $this->Application->recallObject($event->Prefix . '.export');
- /* @var $object kDBItem */
$object->SetField('Number', 999999);
$object->SetField('SubNumber', 999);