Index: branches/5.2.x/units/gateways/gw_tag_processor.php =================================================================== diff -u -N -r14625 -r14957 --- branches/5.2.x/units/gateways/gw_tag_processor.php (.../gw_tag_processor.php) (revision 14625) +++ branches/5.2.x/units/gateways/gw_tag_processor.php (.../gw_tag_processor.php) (revision 14957) @@ -1,6 +1,6 @@ Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); + $object =& $this->getObject($params); + /* @var $object kDBItem */ + $id = $object->GetID(); $value = isset($this->ConfigValues[$id]) ? $this->ConfigValues[$id] : ''; - if (!array_key_exists('no_special', $params) || !$params['no_special']) { + if ( !array_key_exists('no_special', $params) || !$params['no_special'] ) { $value = htmlspecialchars($value); } - if ( getArrayValue($params,'checked') ) { + if ( getArrayValue($params, 'checked') ) { $value = ($value == 1) ? 'checked' : ''; } Index: branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php =================================================================== diff -u -N -r14702 -r14957 --- branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 14702) +++ branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 14957) @@ -1,6 +1,6 @@ getObject( Array('skip_autoload' => true) ); + /* @var $object kDBItem */ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); if($items_info) Index: branches/5.2.x/units/addresses/addresses_tag_processor.php =================================================================== diff -u -N -r14258 -r14957 --- branches/5.2.x/units/addresses/addresses_tag_processor.php (.../addresses_tag_processor.php) (revision 14258) +++ branches/5.2.x/units/addresses/addresses_tag_processor.php (.../addresses_tag_processor.php) (revision 14957) @@ -1,6 +1,6 @@ PrintList2($params); - if (!$ret){ - $block_params = array('name' => $params['empty_myaddresses_render_as']); + if ( !$ret ) { + $block_params = array ('name' => $params['empty_myaddresses_render_as']); $ret = $this->Application->ParseBlock($block_params); } @@ -29,26 +30,29 @@ * Print location using only filled in fields * * @param Array $params - * @access public + * @return string + * @access protected */ - function PrintLocation($params) + protected function PrintLocation($params) { - $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params); + $object =& $this->getObject($params); + /* @var $object kDBItem */ - $fields = Array('City','State','Zip','Country'); - $ret = ''; - foreach($fields as $field) - { + $fields = Array ('City', 'State', 'Zip', 'Country'); + + foreach ($fields as $field) { $value = $object->GetField($field); - if ($field == 'Country' && $value) { + if ( $field == 'Country' && $value ) { $ret .= '
'; } - if ($value) { - $ret .= $value.', '; + + if ( $value ) { + $ret .= $value . ', '; } } - return rtrim($ret,', '); + + return rtrim($ret, ', '); } function EditLink($params) @@ -73,17 +77,19 @@ function IsProfileAddress($params) { $object =& $this->getObject($params); + /* @var $object kDBItem */ + return $object->GetDBField('IsProfileAddress'); } function BuildListSpecial($params) { - if ($this->Special != '') { + if ( $this->Special != '' ) { return $this->Special; } $list_unique_key = $this->getUniqueListKey($params); - if ($list_unique_key == '') { + if ( $list_unique_key == '' ) { return parent::BuildListSpecial($params); } Index: branches/5.2.x/units/order_items/order_items_event_handler.php =================================================================== diff -u -N -r14679 -r14957 --- branches/5.2.x/units/order_items/order_items_event_handler.php (.../order_items_event_handler.php) (revision 14679) +++ branches/5.2.x/units/order_items/order_items_event_handler.php (.../order_items_event_handler.php) (revision 14957) @@ -1,6 +1,6 @@ Order Edit" in Admin * * @param kEvent $event + * @return void * @access protected */ - protected function OnUpdate(&$event) + protected function OnUpdate(kEvent &$event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); Index: branches/5.2.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r14918 -r14957 --- branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14918) +++ branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14957) @@ -1,6 +1,6 @@ setBillingAddress($event); Index: branches/5.2.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r14918 -r14957 --- branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14918) +++ branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14957) @@ -1,6 +1,6 @@ Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); + $object =& $this->getObject($params); + /* @var $object kDBItem */ - if (!$object->GetDBField('InventoryStatus')) return true; + if ( !$object->GetDBField('InventoryStatus') ) { + return true; + } $backordering = $this->Application->ConfigValue('Comm_Enable_Backordering'); - if ($object->GetDBField('InventoryStatus') == 2) { + if ( $object->GetDBField('InventoryStatus') == 2 ) { $poc_table = $this->Application->getUnitOption('poc', 'TableName'); - $sql = 'SELECT SUM(IF(QtyInStock > '.$object->GetDBField('QtyInStockMin').', 1, 0)) - FROM '.$poc_table.' - WHERE (ProductId = '.$object->GetID().') AND (Availability = 1)'; + $sql = 'SELECT SUM(IF(QtyInStock > ' . $object->GetDBField('QtyInStockMin') . ', 1, 0)) + FROM ' . $poc_table . ' + WHERE (ProductId = ' . $object->GetID() . ') AND (Availability = 1)'; $stock_available = $this->Conn->GetOne($sql) > 0; // at least one option combination present } else { - $stock_available = $object->GetDBField('QtyInStock') > $object->GetDBField('QtyInStockMin'); + $stock_available = $object->GetDBField('QtyInStock') > $object->GetDBField('QtyInStockMin'); } $prod_backordering = $object->GetDBField('BackOrder'); - if ($stock_available) return true; + if ( $stock_available ) { + return true; + } // stock is NOT available: - if (!$backordering || $prod_backordering == 0) return false; // if backordering is generaly disabled or disabled for product (Never) + if ( !$backordering || $prod_backordering == 0 ) { + // if backordering is generaly disabled or disabled for product (Never) + return false; + } // backordering enabled; (auto or always mode) return true;