Overhauled export, and other minor updates

This commit is contained in:
Deon George
2013-05-14 23:53:04 +10:00
parent e81eb7a446
commit 684b46f585
33 changed files with 690 additions and 652 deletions

View File

@@ -0,0 +1,42 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports OSB exporting.
*
* @package Export
* @category Model
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Export_Module extends ORM_OSB {
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
// Relationships
protected $_belongs_to = array(
'export' => array(),
'module' => array(),
);
protected $_has_many = array(
'export_item' => array('far_key'=>'id'),
);
protected $_nullifempty = array(
'display',
);
public function list_export() {
$o = $this->module->module();
return $o
->select(array($this->export_item->table_name().'.date_orig','exported'))
->join($this->export_item->table_name(),'LEFT OUTER')
->on($this->export_item->table_name().'.site_id','=',$o->table_name().'.site_id') // @todo This should be automatic
->on($this->export_item->table_name().'.item_id','=',$o->table_name().'.id')
->on('export_module_id','=',$this->id)
->where($o->table_name().'.date_orig','>=',time()-86400*90)
->find_all();
}
}
?>