Fixes to OSB to work with KH 3.3

This commit is contained in:
Deon George
2012-11-10 10:13:57 +11:00
parent ea36639638
commit 6db02ae77d
238 changed files with 813 additions and 938 deletions

View File

@@ -21,11 +21,11 @@ class Controller_Admin_Export extends Controller_TemplateDefault_Admin {
* Add Export Maping items
*/
public function action_add() {
$eo = ORM::factory('export');
$eo = ORM::factory('Export');
$output = '';
if ($_POST AND $eo->values($_POST)->check()) {
$eo->module_id = ORM::factory('module',array('name'=>'product'))->id; // @todo This probably should be in the form.
$eo->module_id = ORM::factory('Module',array('name'=>'product'))->id; // @todo This probably should be in the form.
$eo->plugin_name = 'quicken'; // @todo This should be in the form.
// Entry updated
if (! $eo->save())

View File

@@ -24,7 +24,7 @@ class Controller_Affiliate_Export extends Controller_TemplateDefault_Affiliate {
if (empty($_POST['plugin']))
$this->request->redirect('affiliate/export/index');
$sc = sprintf('Export_%s',$_POST['plugin']);
$sc = sprintf('Export_%s',ucfirst($_POST['plugin']));
if (! class_exists($sc))
throw new Kohana_Exception('Export Class doesnt exist for :plugin',array(':plugin'=>$_POST['plugin']));
else
@@ -43,7 +43,7 @@ class Controller_Affiliate_Export extends Controller_TemplateDefault_Affiliate {
$TBRexportplugins = array('quicken'=>'Export to Quicken');
// @todo: Need to limit this to affiliate acounts
$p = ORM::factory('payment');
$p = ORM::factory('Payment');
if ($p->find_all()->count()) {
Block::add(array(
@@ -80,7 +80,7 @@ class Controller_Affiliate_Export extends Controller_TemplateDefault_Affiliate {
'title'=>_('No payments to export'),
'type'=>'info',
'body'=>sprintf(_('There are no payments within the last %s days (since %s) to show.'),
$daysago,date(Kohana::config('osb')->get('date_format'),$daysago*86400+time())),
$daysago,date(Kohana::$config->load('osb')->date_format,$daysago*86400+time())),
));
}
}

View File

@@ -16,7 +16,7 @@ class Export_Quicken extends Export {
$qo = new Quicken;
foreach ($_POST['id'] as $pid) {
$po = ORM::factory('payment',$pid);
$po = ORM::factory('Payment',$pid);
if ($po->loaded()) {
$invoice_ids = array();
@@ -85,9 +85,9 @@ class Export_Quicken extends Export {
$daterange = '';
if ($iio->product_id) {
$mo = ORM::factory('module',array('name'=>'product'));
$eo = ORM::factory('export')
->where('plugin_name','=',$this->plugin)
$mo = ORM::factory('Module',array('name'=>'product'));
$eo = ORM::factory('Export')
->where('plugin_name','=',strtolower($this->plugin))
->and_where('module_id','=',$mo->id)
->and_where('item_id','=',$iio->product_id)
->find();

View File

@@ -18,12 +18,12 @@ class Model_Export extends ORM_OSB {
public function list_itemsnoexport() {
$result = array();
$mo = ORM::factory('module',array('name'=>'product'));
$p = ORM::factory('product')
$mo = ORM::factory('Module',array('name'=>'product'));
$p = ORM::factory('Product')
->order_by('id');
foreach ($p->find_all() as $po)
if (! ORM::factory('export')->where('module_id','=',$mo->id)->where('item_id','=',$po->id)->find()->loaded())
if (! ORM::factory('Export')->where('module_id','=',$mo->id)->where('item_id','=',$po->id)->find()->loaded())
$result[$po->id] = $po;
return $result;