Index: branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php =================================================================== diff -u -r5820 -r5833 --- branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5820) +++ branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5833) @@ -1587,41 +1587,6 @@ } /** - * Saves selected category as new import category - * - * @param kEvent $event - */ - function OnSelectItems(&$event) - { - $dst_field = $this->Application->RecallVar('dst_field'); - $items_info = $this->Application->GetVar('c'); - if ($items_info) { - $category_id = array_shift( array_keys($items_info) ); - $sql = 'SELECT CategoryId - FROM '.TABLE_PREFIX.'Category - WHERE ResourceId = '.$category_id; - $category_id = $this->Conn->GetOne($sql); - } - else { - $category_id = 0; - } - - if ($dst_field == 'ImportCategory') { - $this->Application->StoreVar('ImportCategory', $category_id); - $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh - - $this->Application->SetVar($event->getPrefixSpecial().'_id', 0); - $this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin'); - - $passed = $this->Application->GetVar('passed'); - $this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial()); - $event->setEventParam('pass_events', true); - } - - $this->finalizePopup($event); - } - - /** * Process items selected in item_selector * * @param kEvent $event @@ -1633,13 +1598,27 @@ $dst_field = $this->Application->RecallVar('dst_field'); if ($dst_field == 'ItemCategory') { + // Item Edit -> Categories Tab -> New Categories $object =& $event->getObject(); $category_ids = explode(',', $selected_ids['c']); foreach ($category_ids as $category_id) { $object->assignToCategory($category_id); } } + + if ($dst_field == 'ImportCategory') { + // Tools -> Import -> Item Import -> Select Import Category + $this->Application->StoreVar('ImportCategory', $selected_ids['c']); + $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh + $this->Application->SetVar($event->getPrefixSpecial().'_id', 0); + $this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin'); + + $passed = $this->Application->GetVar('passed'); + $this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial()); + $event->setEventParam('pass_events', true); + } + $this->finalizePopup($event); }