Overhauled export, and other minor updates

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

View File

@@ -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;
}
}
?>