Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r6625 -r7391 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 6625) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 7391) @@ -55,7 +55,7 @@ $selected_ids = implode(',', $this->StoreSelectedIDs($event)); } else { - $selected_ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids'); + $selected_ids = implode(',', $this->getSelectedIDs($event, true)); } $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); @@ -319,7 +319,7 @@ } // add permission filter - if ($this->Application->GetVar('u_id') == -1) { + if ($this->Application->RecallVar('user_id') == -1) { // for "root" CATEGORY.VIEW permission is checked for items lists too $view_perm = 1; } @@ -418,7 +418,7 @@ { case 'favorites': $fav_table = $this->Application->getUnitOption('fav','TableName'); - $user_id =& $this->Application->GetVar('u_id'); + $user_id =& $this->Application->RecallVar('user_id'); $sql = 'SELECT DISTINCT f.ResourceId FROM '.$fav_table.' f @@ -731,8 +731,7 @@ { unset($field_list[$key]); continue; // ignoring having type clauses in simple search - /*$user_object =& $this->Application->recallObject('u'); - $user_groups = $this->Application->RecallVar('UserGroups'); + /*$user_groups = $this->Application->RecallVar('UserGroups'); $having_list[$key] = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]); $join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $search_config[$field]['JoinClause']); $join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause); @@ -901,7 +900,6 @@ $lang = $this->Application->GetVar('m_lang'); $object =& $event->getObject(); $object->SetPage(1); - $user_object =& $this->Application->recallObject('u'); $product_table = $this->Application->getUnitOption('p', 'TableName'); $search_keywords = $this->Application->GetVar('value'); // will not be changed @@ -1343,8 +1341,7 @@ $selected_ids = $this->Application->GetVar($selector_name); } else { - $this->StoreSelectedIDs($event); - $selected_ids = $this->getSelectedIDs($event); + $selected_ids = $this->StoreSelectedIDs($event); if (implode(',', $selected_ids) == '') { // K4 fix when no ids found bad selected ids array is formed @@ -1486,7 +1483,7 @@ 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->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'); @@ -1607,9 +1604,10 @@ // 5. substitute id of item being cloned with clone id $this->Application->SetVar($event->getPrefixSpecial().'_id', $cloned_ids[0]); - $selected_ids = explode(',', $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids')); + + $selected_ids = $this->getSelectedIDs($event, true); $selected_ids[ array_search($object->GetID(), $selected_ids) ] = $cloned_ids[0]; - $this->Application->StoreVar($event->getPrefixSpecial().'_selected_ids', implode(',', $selected_ids)); + $this->StoreSelectedIDs($event, $selected_ids); // 6. delete original item from temp table $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($object->GetID())); @@ -1628,7 +1626,7 @@ if ($event->status == erSUCCESS) { $object =& $event->getObject(); - $object->SetDBField('CreatedById', $this->Application->GetVar('u_id')); + $object->SetDBField('CreatedById', $this->Application->RecallVar('user_id')); } }