Index: branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine_event_handler.php =================================================================== diff -u -N -r14258 -r14625 --- branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine_event_handler.php (.../shipping_quote_engine_event_handler.php) (revision 14258) +++ branches/5.2.x/units/shipping_quote_engines/shipping_quote_engine_event_handler.php (.../shipping_quote_engine_event_handler.php) (revision 14625) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBItem */ - $engine =& $this->Application->recallObject( $object->GetDBField('ClassName') ); + $engine =& $this->Application->recallObject($object->GetDBField('ClassName')); /* @var $engine ShippingQuoteEngine */ $engine_fields = $engine->GetEngineFields(); $properties = $object->GetDBField('Properties'); $properties = $properties ? unserialize($properties) : Array (); // common fields for all shipping quote engines - if ($object->GetDBField('AccountPassword') != '') { + if ( $object->GetDBField('AccountPassword') != '' ) { // don't erase password by accident $engine_fields[] = 'AccountPassword'; } @@ -53,28 +55,28 @@ $from_country = $this->Application->ConfigValue('Comm_Shipping_Country'); $has_states = strlen($from_country) == 3 ? $cs_helper->CountryHasStates($from_country) : false; - $valid_address = $from_country && ($has_states && $this->Application->ConfigValue('Comm_Shipping_State') || !$has_states) && - $this->Application->ConfigValue('Comm_Shipping_City') && $this->Application->ConfigValue('Comm_Shipping_ZIP'); + $valid_address = $from_country && ($has_states && $this->Application->ConfigValue('Comm_Shipping_State') || !$has_states) && $this->Application->ConfigValue('Comm_Shipping_City') && $this->Application->ConfigValue('Comm_Shipping_ZIP'); - if (!function_exists('curl_init')) { + if ( !function_exists('curl_init') ) { $object->SetError('Status', 'curl_not_present'); } - elseif (($object->GetDBField('Status') == STATUS_ACTIVE) && !$valid_address) { + elseif ( ($object->GetDBField('Status') == STATUS_ACTIVE) && !$valid_address ) { $object->SetError('Status', 'from_info_not_filled_in'); } } /** - * Enter description here... + * Apply same processing to each item being selected in grid * * @param kEvent $event + * @return void + * @access protected */ - function iterateItems(&$event) + protected function iterateItems(&$event) { -// $event->setEventParam('SkipProcessing', 1); parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { + + if ( $event->Name == 'OnMassApprove' ) { $event->status = kEvent::erSUCCESS; $event->redirect = true; } @@ -84,8 +86,10 @@ * Sets virtual fields from serialized properties array * * @param kEvent $event + * @return void + * @access protected */ - function OnAfterItemLoad(&$event) + protected function OnAfterItemLoad(&$event) { parent::OnAfterItemLoad($event); @@ -94,17 +98,19 @@ $properties = $object->GetDBField('Properties'); - if ($properties) { - $object->SetDBFieldsFromHash( unserialize($properties) ); + if ( $properties ) { + $object->SetDBFieldsFromHash(unserialize($properties)); } } /** * Deletes cached shipping quotes on any setting change * * @param kEvent $event + * @return void + * @access protected */ - function OnAfterItemCreate(&$event) + protected function OnAfterItemCreate(&$event) { parent::OnAfterItemCreate($event);