Fixes to OSB to work with KH 3.3
This commit is contained in:
42
modules/product/classes/Model/Product/Category.php
Normal file
42
modules/product/classes/Model/Product/Category.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports OSB listing products by category.
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Product_Category extends ORM_OSB {
|
||||
protected $_table_name = 'product_cat';
|
||||
|
||||
protected $_has_many = array(
|
||||
'product_category_translate'=>array('foreign_key'=>'product_cat_id','far_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
'name'=>'asc',
|
||||
);
|
||||
|
||||
public function description() {
|
||||
// If the user is not logged in, show the site default language
|
||||
// @todo This needs to change to the session language.
|
||||
if (! $ao=Auth::instance()->get_user())
|
||||
$ao=Config::instance()->so;
|
||||
|
||||
return ($a=$this->product_category_translate->where('language_id','=',$ao->language_id)->find()->description) ? $a : _('No Description');
|
||||
}
|
||||
|
||||
public function list_bylistgroup($cat) {
|
||||
$result = array();
|
||||
|
||||
foreach ($this->where('list_group','=',$cat)->find_all() as $pco)
|
||||
$result[$pco->id] = $pco;
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
20
modules/product/classes/Model/Product/Category/Translate.php
Normal file
20
modules/product/classes/Model/Product/Category/Translate.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class product access to product category translation.
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Product_Category_Translate extends ORM_OSB {
|
||||
protected $_table_name = 'product_cat_translate';
|
||||
|
||||
protected $_belongs_to = array(
|
||||
'product_category'=>array(),
|
||||
);
|
||||
}
|
||||
?>
|
29
modules/product/classes/Model/Product/Plugin.php
Normal file
29
modules/product/classes/Model/Product/Plugin.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports Product Plugins.
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product/Plugin
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
abstract class Model_Product_Plugin extends ORM_OSB {
|
||||
// Reset any sorting that may be defined in our parent
|
||||
protected $_sorting = array();
|
||||
|
||||
/**
|
||||
* The admin_update should be implemented in plugins.
|
||||
* It is used to update the plugin specific product information
|
||||
*/
|
||||
abstract public function admin_update();
|
||||
|
||||
/**
|
||||
* The feature summary should be implemented in plugins.
|
||||
* It is displayed on the product overview page, as a summary of the products features.
|
||||
*/
|
||||
abstract public function feature_summary();
|
||||
}
|
||||
?>
|
20
modules/product/classes/Model/Product/Translate.php
Normal file
20
modules/product/classes/Model/Product/Translate.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class product access to product translation.
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Product_Translate extends ORM_OSB {
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
protected $_belongs_to = array(
|
||||
'product'=>array(),
|
||||
);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user