Index: admin_templates/js/script.js =================================================================== --- admin_templates/js/script.js (revision 12950) +++ admin_templates/js/script.js (working copy) @@ -625,12 +625,12 @@ function std_edit_temp_item(prefix_special, edit_template, $onAfterOpenPopup) { - if (use_popups(prefix_special, '')) { - open_popup(prefix_special, '', edit_template, null, $onAfterOpenPopup); + if (use_popups(prefix_special, 'OnStoreSelected')) { + open_popup(prefix_special, 'OnStoreSelected', edit_template, null, $onAfterOpenPopup); } else { opener_action('d'); - submit_event(prefix_special,'',edit_template); + submit_event(prefix_special,'OnStoreSelected',edit_template); } } Index: kernel/db/db_event_handler.php =================================================================== --- kernel/db/db_event_handler.php (revision 12950) +++ kernel/db/db_event_handler.php (working copy) @@ -133,6 +133,7 @@ 'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnProcessSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), + 'OnStoreSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnSelectUser' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnMassApprove' => Array('self' => 'advanced:approve|edit', 'subitem' => 'advanced:approve|add|edit'), @@ -347,6 +348,23 @@ } /** + * Stores IDs, selected in grid in session + * + * @param kEvent $event + */ + function OnStoreSelected(&$event) + { + $this->StoreSelectedIDs($event); + + $id = $this->Application->GetVar($event->getPrefixSpecial() . '_id'); + + if ($id !== false) { + $event->SetRedirectParam($event->getPrefixSpecial() . '_id', $id); + $event->SetRedirectParam('pass', 'all,' . $event->getPrefixSpecial()); + } + } + + /** * Returs associative array of submitted fields for current item * Could be used while creating/editing single item - * meaning on any edit form, except grid edit