Ensure site_id is included in ORM::add(), fixed payment revendering, start product category work
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
class DB extends Kohana_DB {
|
||||
// Add the site_id to the delete query
|
||||
public static function delete($table = NULL)
|
||||
final public static function delete($table = NULL)
|
||||
{
|
||||
$db = new Database_Query_Builder_Delete($table);
|
||||
|
||||
|
23
application/classes/Database/Query/Builder/Insert.php
Normal file
23
application/classes/Database/Query/Builder/Insert.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class extends Kohana's [Database_Query_Builder_Insert] to ensure that we have a site_id included in the values
|
||||
*
|
||||
* @package OSB
|
||||
* @category Helpers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
|
||||
class Database_Query_Builder_Insert extends Kohana_Database_Query_Builder_Insert {
|
||||
public function compile($db = NULL) {
|
||||
$this->_columns = Arr::Merge($this->_columns,['site_id']);
|
||||
|
||||
foreach ($this->_values as $k=>$v)
|
||||
$this->_values[$k] = Arr::Merge($this->_values[$k],[Site::id()]);
|
||||
|
||||
return parent::compile($db);
|
||||
}
|
||||
}
|
||||
?>
|
@@ -23,19 +23,19 @@ class URL extends lnApp_URL {
|
||||
|
||||
foreach (array_reverse(self::$method_directory) as $k=>$v)
|
||||
switch ($k) {
|
||||
case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'icon-globe');
|
||||
case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'fa-globe');
|
||||
break;
|
||||
|
||||
case 'affiliate':
|
||||
case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'icon-th-list');
|
||||
case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'fa-dashboard');
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
if (is_object(Auth::instance()->get_user()))
|
||||
$result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'icon-user');
|
||||
$result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'fa-user');
|
||||
break;
|
||||
|
||||
default: $result[$k] = array('name'=>$k,'icon'=>'icon-question-sign');
|
||||
default: $result[$k] = array('name'=>$k,'icon'=>'fa-question');
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user