Changed use of active to status
This commit is contained in:
@@ -26,9 +26,6 @@ class Model_Product extends ORMOSB {
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'active'=>array(
|
||||
array('StaticList_YesNo::display',array(':value')),
|
||||
),
|
||||
'price_base'=>array(
|
||||
array('Tax::add',array(':value')),
|
||||
array('Currency::display',array(':value')),
|
||||
@@ -36,6 +33,9 @@ class Model_Product extends ORMOSB {
|
||||
'price_type'=>array(
|
||||
array('StaticList_PriceType::display',array(':value')),
|
||||
),
|
||||
'status'=>array(
|
||||
array('StaticList_YesNo::display',array(':value')),
|
||||
),
|
||||
'taxable'=>array(
|
||||
array('StaticList_YesNo::display',array(':value')),
|
||||
),
|
||||
@@ -173,6 +173,20 @@ class Model_Product extends ORMOSB {
|
||||
return array('price_base','price_setup');
|
||||
}
|
||||
|
||||
/**
|
||||
* List the number of services using this product
|
||||
*/
|
||||
public function count_services() {
|
||||
return $this->service->list_count(TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* List the number of invoices using this product
|
||||
*/
|
||||
public function count_invoices() {
|
||||
return $this->invoice->list_count(TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the price for the particle group and price option for the period
|
||||
*/
|
||||
@@ -182,20 +196,6 @@ class Model_Product extends ORMOSB {
|
||||
return isset($x[$grp][$option]) ? $x[$grp][$option] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* List the number of services using this product
|
||||
*/
|
||||
public function services_count() {
|
||||
return $this->service->where('active','=',1)->find_all()->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* List the number of invoices using this product
|
||||
*/
|
||||
public function invoices_count() {
|
||||
return $this->invoice->where('status','=',1)->find_all()->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the products for a given category
|
||||
* @todo This shouldnt be here.
|
||||
@@ -203,10 +203,7 @@ class Model_Product extends ORMOSB {
|
||||
public function list_category($cat,$active=TRUE) {
|
||||
$results = array();
|
||||
|
||||
if ($active)
|
||||
$cats = $this->where('active','=',TRUE);
|
||||
else
|
||||
$cats = $this;
|
||||
$cats = $active ? $this->_where_active() : $this;
|
||||
|
||||
foreach ($cats->find_all() as $po) {
|
||||
if ($c = unserialize($po->avail_category) AND in_array($cat,$c))
|
||||
|
@@ -30,10 +30,6 @@ class Model_Product_Category extends ORMOSB {
|
||||
return ($a=$this->product_category_translate->where('language_id','=',$ao->language_id)->find()->description) ? $a : _('No Description');
|
||||
}
|
||||
|
||||
public function list_active() {
|
||||
return $this->where('status','=',1);
|
||||
}
|
||||
|
||||
public function list_bylistgroup($cat) {
|
||||
$result = array();
|
||||
|
||||
|
Reference in New Issue
Block a user