Index: branches/5.3.x/units/orders/orders_tag_processor.php =================================================================== diff -u -N -r15671 -r15695 --- branches/5.3.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 15671) +++ branches/5.3.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 15695) @@ -1,6 +1,6 @@ GetID(); - $oi_table = $this->Application->getUnitOption('orditems', 'TableName'); + $oi_table = $this->Application->getUnitConfig('orditems')->getTableName(); if ( $object->IsTempTable() ) { $oi_table = $this->Application->GetTempName($oi_table, 'prefix:' . $object->Prefix); @@ -532,7 +532,7 @@ $object->SetDBField('PaymentType', $pt); } - $pt_table = $this->Application->getUnitOption('pt','TableName'); + $pt_table = $this->Application->getUnitConfig('pt')->getTableName(); $sql = 'SELECT GatewayId FROM %s WHERE PaymentTypeId = %s'; $gw_id = $this->Conn->GetOne( sprintf( $sql, $pt_table, $pt ) ); @@ -614,8 +614,9 @@ */ function OrderEditable($params) { - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $config = $this->getUnitConfig(); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); if ($this->Application->IsTempMode($this->Prefix, $this->Special)) { $table_name = $this->Application->GetTempName($table_name, 'prefix:' . $this->Prefix); @@ -640,9 +641,11 @@ case ORDER_STATUS_PENDING: case ORDER_STATUS_BACKORDERS: + $config = $this->Application->getUnitConfig('pt'); + $sql = 'SELECT PlacedOrdersEdit - FROM ' . $this->Application->getUnitOption('pt', 'TableName') . ' - WHERE ' . $this->Application->getUnitOption('pt', 'IDField') . ' = ' . $order_data['PaymentType']; + FROM ' . $config->getTableName() . ' + WHERE ' . $config->getIDField() . ' = ' . $order_data['PaymentType']; $ret = $this->Conn->GetOne($sql); break; @@ -1402,9 +1405,12 @@ function UserHasPendingOrders($params) { - $sql = 'SELECT OrderId FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').' - WHERE PortalUserId = '.$this->Application->RecallVar('user_id').' - AND Status = '.ORDER_STATUS_PENDING; + $user_id = $this->Application->RecallVar('user_id'); + + $sql = 'SELECT OrderId + FROM '.$this->getUnitConfig()->getTableName().' + WHERE PortalUserId = '. $user_id .' AND Status = '.ORDER_STATUS_PENDING; + return $this->Conn->GetOne($sql) ? 1 : 0; }