Index: branches/5.3.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r15671 -r15695 --- branches/5.3.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 15671) +++ branches/5.3.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 15695) @@ -1,6 +1,6 @@ Application->ConfigValue('Comm_Enable_Backordering'); if ( $object->GetDBField('InventoryStatus') == 2 ) { - $poc_table = $this->Application->getUnitOption('poc', 'TableName'); + $poc_table = $this->Application->getUnitConfig('poc')->getTableName(); + $sql = 'SELECT SUM(IF(QtyInStock > ' . $object->GetDBField('QtyInStockMin') . ', 1, 0)) FROM ' . $poc_table . ' WHERE (ProductId = ' . $object->GetID() . ') AND (Availability = 1)'; @@ -553,8 +554,10 @@ function HasFiles($params) { - $sql = 'SELECT COUNT(FileId) FROM '.$this->Application->getUnitOption('file', 'TableName').' + $sql = 'SELECT COUNT(FileId) + FROM '.$this->Application->getUnitConfig('file')->getTableName().' WHERE ProductId = '.$this->Application->GetVar('p_id').' AND Status = 1'; + return $this->Conn->GetOne($sql) ? 1 : 0; } @@ -570,15 +573,13 @@ { $file_id = $this->Application->GetVar('file.downl_id'); $product_id = $file_id ? $this->Conn->GetOne('SELECT ProductId - FROM '.$this->Application->getUnitOption('file', 'TableName').' + FROM '.$this->Application->getUnitConfig('file')->getTableName().' WHERE FileId = '.$file_id) : $this->Application->GetVar($this->getPrefixSpecial().'_id'); - $download_helper_class = $this->Application->getUnitOption($this->Prefix, 'DownloadHelperClass'); + $download_helper_class = $this->getUnitConfig()->getDownloadHelperClass('DownloadHelper'); - if (!$download_helper_class) { - $download_helper_class = 'DownloadHelper'; - } + $download_helper = $this->Application->recallObject($download_helper_class); if (!$download_helper->CheckAccess($file_id, $product_id)) { $this->Application->ApplicationDie('File Access permission check failed!'); @@ -730,8 +731,8 @@ */ function ModifyUnitConfig($params) { - $edit_tab_presets = $this->Application->getUnitOption($this->Prefix, 'EditTabPresets'); - $edit_tab_preset = $edit_tab_presets['Default']; + $config = $this->getUnitConfig(); + $edit_tab_preset = $config->getEditTabPresetByName('Default'); $object = $this->getObject($params); /* @var $object kDBItem */ @@ -764,8 +765,7 @@ unset($edit_tab_preset['package_content']); } - $edit_tab_presets['Default'] = $edit_tab_preset; - $this->Application->setUnitOption($this->Prefix, 'EditTabPresets', $edit_tab_presets); + $config->addEditTabPresets($edit_tab_preset, 'Default'); } /**