Index: branches/5.2.x/units/zones/zones_event_handler.php =================================================================== diff -u -N -r14986 -r15061 --- branches/5.2.x/units/zones/zones_event_handler.php (.../zones_event_handler.php) (revision 14986) +++ branches/5.2.x/units/zones/zones_event_handler.php (.../zones_event_handler.php) (revision 15061) @@ -1,6 +1,6 @@ getObject(); /* @var $zone_object kDBItem */ - switch ( $type ) { + switch ($type) { case 'before': if ( $event->Name == 'OnCreate' ) { $zone_object->SetDBField('ShippingTypeID', $this->Application->GetVar('s_id')); @@ -239,16 +239,16 @@ * @return void * @access protected */ - function OnCancel(&$event) + protected function OnCancel(kEvent &$event) { parent::OnCancel($event); $dst_object = &$this->Application->recallObject('dst'); /* @var $dst_object kDBItem */ - $delete_zones_sql = ' DELETE FROM ' . $dst_object->TableName . ' - WHERE ShippingZoneId = 0'; - $this->Conn->Query($delete_zones_sql); + $sql = 'DELETE FROM ' . $dst_object->TableName . ' + WHERE ShippingZoneId = 0'; + $this->Conn->Query($sql); // if cancelling after create if ( $this->Application->RecallVar('zone_mode' . $this->Application->GetVar('m_wid')) == 'create' ) { @@ -259,10 +259,18 @@ } } - function OnNew(&$event) + /** + * Prepares new kDBItem object + * + * @param kEvent $event + * @return void + * @access protected + */ + protected function OnNew(kEvent &$event) { parent::OnNew($event); - $this->Application->StoreVar('zone_mode'.$this->Application->GetVar('m_wid'), 'create'); + + $this->Application->StoreVar('zone_mode' . $this->Application->GetVar('m_wid'), 'create'); } } \ No newline at end of file