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

@@ -32,9 +32,6 @@ class Model_Service extends ORMOSB {
* Filters used to format the display of values into friendlier values
*/
protected $_display_filters = array(
'active'=>array(
array('StaticList_YesNo::display',array(':value')),
),
'date_last_invoice'=>array(
array('Config::date',array(':value')),
),
@@ -44,6 +41,9 @@ class Model_Service extends ORMOSB {
'recur_schedule'=>array(
array('StaticList_RecurSchedule::display',array(':value')),
),
'status'=>array(
array('StaticList_YesNo::display',array(':value')),
),
);
/**
@@ -143,14 +143,6 @@ class Model_Service extends ORMOSB {
/** LIST FUNCTIONS **/
private function _list_active() {
return $this->where('active','=',1);
}
public function list_active() {
return $this->_list_active()->find_all();
}
public function list_bylistgroup($cat) {
$result = array();
@@ -174,7 +166,7 @@ class Model_Service extends ORMOSB {
* @param $days int Additional number of days to add to the query, above the module config.
*/
public function list_invoicesoon($days=0) {
return $this->_list_active()
return $this->_where_active()
->where_open()->where('suspend_billing','IS',NULL)->or_where('suspend_billing','=','0')->where_close()
->where('date_next_invoice','<',time()+(ORM::factory('invoice')->config('GEN_DAYS')+$days)*86400)
->find_all();
@@ -184,7 +176,7 @@ class Model_Service extends ORMOSB {
* List services that need to be provisioned
*/
public function list_provision() {
return $this->_list_active()->where('queue','=','PROVISION');
return $this->_where_active()->where('queue','=','PROVISION');
}
}
?>