Overhauled export, and other minor updates
This commit is contained in:
@@ -1,31 +1,34 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports OSB exporting by rending the exportable items.
|
||||
* This class supports OSB exporting.
|
||||
*
|
||||
* @package Export
|
||||
* @category Helpers
|
||||
* @category Model
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Export extends ORM_OSB {
|
||||
protected $_serialize_column = array(
|
||||
'map_data',
|
||||
// Relationships
|
||||
protected $_has_many = array(
|
||||
'export_module' => array('far_key'=>'id','xforeign_key'=>'x'),
|
||||
);
|
||||
|
||||
public function list_itemsnoexport() {
|
||||
$result = array();
|
||||
protected $_form = array('id'=>'id','value'=>'name');
|
||||
|
||||
$mo = ORM::factory('Module',array('name'=>'product'));
|
||||
$p = ORM::factory('Product')
|
||||
->order_by('id');
|
||||
/**
|
||||
* Return the object of the product plugin
|
||||
*/
|
||||
public function plugin(Model_Export_Module $emo,$type='') {
|
||||
$c = Kohana::classname('Export_Plugin_'.$this->plugin);
|
||||
|
||||
foreach ($p->find_all() as $po)
|
||||
if (! ORM::factory('Export')->where('module_id','=',$mo->id)->where('item_id','=',$po->id)->find()->loaded())
|
||||
$result[$po->id] = $po;
|
||||
if (! $this->plugin OR ! class_exists($c))
|
||||
return NULL;
|
||||
|
||||
return $result;
|
||||
$o = new $c($emo);
|
||||
|
||||
return $type ? $o->$type : $o;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user