Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r15445 -r15541 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 15445) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 15541) @@ -1,6 +1,6 @@ StoreSelectedIDs($event); if ( $ids ) { + $status_field = $object->getStatusField(); $propagate_category_status = $this->Application->GetVar('propagate_category_status'); - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); foreach ($ids as $id) { $object->Load($id); Index: branches/5.2.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -N -r15454 -r15541 --- branches/5.2.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 15454) +++ branches/5.2.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 15541) @@ -1,6 +1,6 @@ Application->getUnitOption($this->Prefix,'StatusField') ); - if ($new_status != $this->GetDBField($status_field)) { + $status_field = $this->getStatusField(); + + if ( $new_status != $this->GetDBField($status_field) ) { // status was changed $this->sendEmailEvents($new_status, $pending_editing); } + $this->SetDBField($status_field, $new_status); return $this->Update(); Index: branches/5.2.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r15370 -r15541 --- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15370) +++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15541) @@ -1,6 +1,6 @@ Load($id); - $status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField')); + $status_field = $user_dummy->getStatusField(); if ( $user_dummy->GetDBField($status_field) != STATUS_ACTIVE ) { // not active user is not allowed to update his record (he could not activate himself manually) @@ -1198,7 +1198,7 @@ /* @var $user_dummy kDBItem */ $user_dummy->Load($id); - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); + $status_field = $user_dummy->getStatusField(); if ( $user_dummy->GetDBField($status_field) != STATUS_ACTIVE ) { // not active user is not allowed to update his record (he could not activate himself manually) @@ -1669,15 +1669,15 @@ $this->clearSelectedIDs($event); $dst_field = $this->Application->RecallVar('dst_field'); - if ($dst_field != 'PrimaryGroupId') { - return ; + if ( $dst_field != 'PrimaryGroupId' ) { + return; } - $group_ids = $this->Application->GetVar('g'); - $primary_group_id = $group_ids ? array_shift( array_keys($group_ids) ) : false; + $group_ids = array_keys($this->Application->GetVar('g')); + $primary_group_id = $group_ids ? array_shift($group_ids) : false; - if (!$user_ids || !$primary_group_id) { - return ; + if ( !$user_ids || !$primary_group_id ) { + return; } $table_name = $this->Application->getUnitOption('ug', 'TableName'); Index: branches/5.2.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r15539 -r15541 --- branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15539) +++ branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15541) @@ -1,6 +1,6 @@ SelectParam($params, 'name,render_as,block'); $params['section_name'] = $section_name; - $template = $section_data['url']['t']; - unset($section_data['url']['t']); + $url_params = $section_data['url']; + unset($url_params['t']); - $section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']); + $section_data['section_url'] = $this->Application->HREF($section_data['url']['t'], '', $url_params); $ret = $this->Application->ParseBlock( array_merge($params, $section_data) ); return $ret; Index: branches/5.2.x/core/kernel/db/dbitem.php =================================================================== diff -u -N -r15474 -r15541 --- branches/5.2.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 15474) +++ branches/5.2.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 15541) @@ -1,6 +1,6 @@ Loaded = $is_loaded; } + /** + * Returns item's first status field + * + * @return string + * @access public + */ + public function getStatusField() + { + $status_fields = $this->Application->getUnitOption($this->Prefix, 'StatusField'); + + return array_shift($status_fields); + } + } \ No newline at end of file Index: branches/5.2.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r15474 -r15541 --- branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15474) +++ branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15541) @@ -1,6 +1,6 @@ StoreSelectedIDs($event); if ( $ids ) { - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); + $status_field = $object->getStatusField(); $order_field = $this->Application->getUnitOption($event->Prefix, 'OrderField'); if ( !$order_field ) { @@ -2899,8 +2899,7 @@ $items_info = $this->Application->GetVar('u'); if ( $items_info ) { - $user_id = array_shift(array_keys($items_info)); - + list ($user_id, ) = each($items_info); $this->RemoveRequiredFields($object); $is_new = !$object->isLoaded(); Index: branches/5.2.x/core/admin_templates/incs/form_blocks.tpl =================================================================== diff -u -N -r15446 -r15541 --- branches/5.2.x/core/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 15446) +++ branches/5.2.x/core/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 15541) @@ -513,7 +513,7 @@ - +