Consistent use of return , payment refund handling

This commit is contained in:
Deon George
2013-04-05 23:50:08 +11:00
parent 43dfd88bce
commit 52d9005b64
30 changed files with 255 additions and 210 deletions

View File

@@ -81,27 +81,27 @@ class Model_Task extends ORM_OSB {
/** LIST FUNCTIONS **/
public function list_active() {
$return = array();
$result = array();
foreach ($this->_where_active()->find_all() as $to) {
$ct = sprintf('%s %s %s %s %s',$to->int_min,$to->int_hour,$to->int_month_day,$to->int_month,$to->int_week_day);
$c = new Cron($ct,$to->command);
$return[$to->id]['task'] = $to;
$return[$to->id]['next'] = $c->next($to->date_run);
$result[$to->id]['task'] = $to;
$result[$to->id]['next'] = $c->next($to->date_run);
}
return $return;
return $result;
}
public function list_next() {
$return = array();
$result = array();
foreach ($this->list_active() as $v)
if ((! $return OR $v['next']<$return['next']) AND ! $v['task']->running)
$return = $v;
if ((! $result OR $v['next']<$result['next']) AND ! $v['task']->running)
$result = $v;
return array($return['task']->id=>$return);
return array($result['task']->id=>$result);
}
}
?>