Removed redundant functions, some Standardisation work

This commit is contained in:
Deon George
2016-08-15 21:23:18 +10:00
parent 24bb4a701b
commit 07de13f678
82 changed files with 367 additions and 590 deletions

View File

@@ -69,7 +69,7 @@ class Controller_Admin_Module_Method extends Controller_Admin_Module {
foreach (ORM::factory('Group')->find_all() as $go) {
// If the group was defined and no longer
if ($mmo->has('group',$go) AND (! $this->request->post('groups')) OR ! in_array($go->id,$this->request->post('groups'))) {
if ($mmo->has('group',$go) AND (! $this->request->post('groups') OR ! in_array($go->id,$this->request->post('groups')))) {
$gmo = ORM::factory('Group_Method',array('method_id'=>$mmo->id,'group_id'=>$go->id));
if (! $gmo->delete())

View File

@@ -12,17 +12,6 @@
abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault {
protected $auth_required = TRUE;
// @todo To rework
public function after() {
$dc = URL::link('user','welcome/index');
$m = sprintf('%s/%s',Request::current()->directory(),Request::current()->controller());
BreadCrumb::URL(Request::current()->directory(),sprintf('%s/%s',Request::current()->directory(),$dc),FALSE);
BreadCrumb::URL($m,method_exists($this,'action_menu') ? $m.'/menu' : sprintf('%s/%s',Request::current()->directory(),$dc),FALSE);
parent::after();
}
protected function save(Model $o) {
try {
return $o->save();
@@ -48,7 +37,7 @@ abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefau
if ($config_items) {
Block::factory()
->title('Update Module Configuration')
->title_icon('icon-wrench')
->title_icon('fa fa-wrench')
->type('form-horizontal')
->body(View::factory('setup/admin/module')->set('o',Company::instance()->so())->set('mid',$mo->id));
}

View File

@@ -44,21 +44,7 @@ class Model_Account extends lnApp_Model_Account {
/** REQUIRED ABSTRACT METHODS **/
/**
* Returns the company name if it exists, otherwise the persons name
*/
public function name($variable=NULL) {
return $this->isCompany() ? $this->company : $this->namesub();
}
/*
* Returns the persons name
*/
public function namesub($variable=NULL) {
return trim(sprintf('%s %s',$this->first_name,$this->last_name));
}
/** OTHER METHODS **/
/** LOCAL METHODS **/
public function activated() {
return $this->has('group');
@@ -115,6 +101,20 @@ class Model_Account extends lnApp_Model_Account {
return $this->RTM->loaded();
}
/**
* Returns the company name if it exists, otherwise the persons name
*/
public function name($variable=NULL) {
return $this->isCompany() ? $this->company : $this->namesub();
}
/*
* Returns the persons name
*/
public function namesub($variable=NULL) {
return trim(sprintf('%s %s',$this->first_name,$this->last_name));
}
/**
* The key we use to sort entries of this model type
*/

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Account_Log extends ORM_OSB {
class Model_Account_Log extends ORM {
protected $_belongs_to = array(
'account'=>array(),
);

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Country extends ORM_OSB {
class Model_Country extends ORM {
protected $_has_one = array(
'currency'=>array('far_key'=>'id'),
);

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Currency extends ORM_OSB {
class Model_Currency extends ORM {
protected $_sorting = array(
'name'=>'ASC',
);

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Group_Method extends ORM_OSB {
class Model_Group_Method extends ORM {
// Relationships
protected $_has_one = array(
'record_id'=>array(),

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Language extends ORM_OSB {
class Model_Language extends ORM {
protected $_sorting = array(
'name'=>'ASC',
);

View File

@@ -9,6 +9,6 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Log_Error extends ORM_OSB {
class Model_Log_Error extends ORM {
}
?>

View File

@@ -12,7 +12,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Module extends ORM_OSB {
class Model_Module extends ORM {
// Relationships
protected $_has_one = array(
'record_id'=>array('model'=>'Record_ID','far_key'=>'id'),

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Module_Method extends ORM_OSB {
class Model_Module_Method extends ORM {
// This module doesnt keep track of column updates automatically
protected $_created_column = FALSE;
protected $_updated_column = FALSE;

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Module_Method_Token extends ORM_OSB {
class Model_Module_Method_Token extends ORM {
// This module doesnt keep track of column updates automatically
protected $_updated_column = FALSE;

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_RTM extends ORM_OSB {
class Model_RTM extends ORM {
protected $_belongs_to = array(
'account' => array(),
);

View File

@@ -8,7 +8,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Record_ID extends ORM_OSB {
class Model_Record_ID extends ORM {
protected $_primary_key = 'module_id';
// This module doesnt keep track of column updates automatically

View File

@@ -12,7 +12,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Setup extends ORM_OSB {
class Model_Setup extends ORM {
// Setup doesnt use the update column
protected $_updated_column = FALSE;

View File

@@ -1,14 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends Kohana's [ORM] class to create defaults for OSB.
*
* @package OSB
* @category Helpers
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
* @deprecate
*/
abstract class ORM_OSB extends ORM {
}