Changed use of active to status

This commit is contained in:
Deon George
2012-08-01 22:43:33 +10:00
parent e4d600b8d0
commit 4220ade8ac
40 changed files with 123 additions and 145 deletions

View File

@@ -24,15 +24,15 @@ class Model_Account extends Model_Auth_UserDefault {
);
protected $_display_filters = array(
'active'=>array(
array('StaticList_YesNo::display',array(':value')),
),
'date_orig'=>array(
array('Config::date',array(':value')),
),
'date_last'=>array(
array('Config::date',array(':value')),
),
'status'=>array(
array('StaticList_YesNo::display',array(':value')),
),
);
/**
@@ -67,7 +67,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function country($name) {
return StaticList_Module::form($name,'country',$this->country_id,'id','name',array('active'=>'=:1'),FALSE,array('class'=>'form_button'));
return StaticList_Module::form($name,'country',$this->country_id,'id','name',array('status'=>'=:1'),FALSE,array('class'=>'form_button'));
}
/**
@@ -133,12 +133,12 @@ class Model_Account extends Model_Auth_UserDefault {
return $alo->saved();
}
private function _active() {
return $this->where('active','=',TRUE);
private function _where_active() {
return $this->where('status','=',TRUE);
}
public function list_active() {
return $this->_active()->order_by('company,last_name,first_name')->find_all();
return $this->_where_active()->order_by('company,last_name,first_name')->find_all();
}
public function list_affiliates() {
@@ -152,7 +152,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function count_services($active=TRUE,$afid=NULL) {
return count($this->list_services($active,$afid));
return $this->list_services($active,$afid)->count();
}
/**
@@ -200,7 +200,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function list_services($active=TRUE,$afid=NULL) {
$svs = $this->service->where('active','=',$active);
$svs = $this->service->where_active();
if ($afid)
$svs->where('affiliate_id','=',$afid);