Index: branches/5.2.x/core/units/email_events/email_events_event_handler.php =================================================================== diff -u -N -r15012 -r15065 --- branches/5.2.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 15012) +++ branches/5.2.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 15065) @@ -1,6 +1,6 @@ Special != 'module') { + if ( $event->Special != 'module' ) { parent::OnSelectUser($event); - return ; + return; } - if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; - return ; + return; } $items_info = $this->Application->GetVar('u'); - if ($items_info) { - $user_id = array_shift( array_keys($items_info) ); + if ( $items_info ) { + $user_id = array_shift(array_keys($items_info)); $selected_ids = $this->getSelectedIDs($event, true); - $ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids'); + $ids = $this->Application->RecallVar($event->getPrefixSpecial() . '_selected_ids'); $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.' - WHERE '.$id_field.' IN ('.$ids.')'; + + $sql = 'UPDATE ' . $table_name . ' + SET ' . $this->Application->RecallVar('dst_field') . ' = ' . $user_id . ' + WHERE ' . $id_field . ' IN (' . $ids . ')'; $this->Conn->Query($sql); } @@ -935,8 +939,10 @@ * with items selected in the grid * * @param kEvent $event + * @return void + * @access protected */ - function OnEdit(&$event) + protected function OnEdit(kEvent &$event) { parent::OnEdit($event); @@ -951,7 +957,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(&$event) + protected function OnAfterItemLoad(kEvent &$event) { parent::OnAfterItemLoad($event); @@ -1094,7 +1100,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(&$event) + protected function OnBeforeItemCreate(kEvent &$event) { parent::OnBeforeItemCreate($event); @@ -1108,7 +1114,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(&$event) + protected function OnBeforeItemUpdate(kEvent &$event) { parent::OnBeforeItemUpdate($event);