diff --git a/application/bootstrap.php b/application/bootstrap.php index 2b81d4e3..11edc392 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -130,8 +130,8 @@ Kohana::$config->attach(new Config_File); * Enable modules. Modules are referenced by a relative or absolute path. */ Kohana::modules(array( - 'lnapp' => MODPATH.'lnapp', // lnApp Base Application Tools 'oauth' => MODPATH.'oauth', // OAuth Module for External Authentication + 'lnapp' => MODPATH.'lnapp', // lnApp Base Application Tools 'auth' => SMDPATH.'auth', // Basic authentication 'cache' => SMDPATH.'cache', // Caching with multiple backends 'cron' => SMDPATH.'cron', // Kohana Cron Module diff --git a/application/classes/Controller/User/Welcome.php b/application/classes/Controller/User/Welcome.php index f0dd5285..52e18f9b 100644 --- a/application/classes/Controller/User/Welcome.php +++ b/application/classes/Controller/User/Welcome.php @@ -16,59 +16,7 @@ class Controller_User_Welcome extends Controller_Welcome { ); public function action_index() { - Block::factory() - ->title(sprintf('Active Service for Account: %s',$this->ao->accnum())) - ->title_icon('icon-info-sign') - ->span(6) - ->body(Table::factory() - ->data($this->ao->service->list_active()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); - - Block::factory() - ->title('Quick Shortcuts') - ->title_icon('icon-bookmark') - ->span(6) - ->body(View::factory('welcome/user/shortcuts')); - - Block::factory() - ->title(sprintf('Invoices Due Account: %s (%s)',$this->ao->accnum(),$this->ao->invoice->list_due_total(TRUE))) - ->title_icon('icon-info-sign') - ->span(6) - ->body(Table::factory() - ->data($this->ao->invoice->list_due()) - ->columns(array( - 'id'=>'ID', - 'due_date'=>'Date Due', - 'total(TRUE)'=>'Invoice Total', - 'due(TRUE)'=>'Amount Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); - - Block::factory() - ->title(sprintf('Services Expiring for Account: %s',$this->ao->accnum())) - ->title_icon('icon-info-sign') - ->span(6) - ->body(Table::factory() - ->data($this->ao->service->list_expiring()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - 'expire(TRUE)'=>'Date', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + $this->template->content = View::factory('welcome/user/view')->set('o',$this->ao); } } ?> diff --git a/application/classes/Database.php b/application/classes/Database.php deleted file mode 100644 index eaa6264e..00000000 --- a/application/classes/Database.php +++ /dev/null @@ -1,18 +0,0 @@ -_config['caching']) ? $this->_config['caching'] : FALSE; - } -} -?> diff --git a/application/classes/ORM/OSB.php b/application/classes/ORM/OSB.php index f7ddc572..3316f44a 100644 --- a/application/classes/ORM/OSB.php +++ b/application/classes/ORM/OSB.php @@ -8,92 +8,7 @@ * @author Deon George * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html + * @deprecate */ abstract class ORM_OSB extends ORM { - /** - * @var string Database to connect to - */ - protected $_db = 'default'; - - // Rules to assist with site ID and getting next record ID for inserts. - public function rules() { - return array( - 'id'=>array( - array('ORM_OSB::get_next_id',array(':model',':field')), - ), - 'site_id'=>array( - array('ORM_OSB::set_site_id',array(':model',':field')), - ), - ); - } - - public function config($key) { - $mc = Config::instance()->module_config($this->_object_name); - - return empty($mc[$key]) ? '' : $mc[$key]; - } - - /** - * Get Next record id - * - * @param array Validate object - * @param string Primary Key - */ - final public static function get_next_id($model,$field) { - if (! is_null($model->$field)) - return TRUE; - - $model->_changed[$field] = $field; - - $ido = ORM::factory('Module') - ->where('name','=',$model->_table_name) - ->find(); - - if (! $ido->loaded()) - throw new Kohana_Exception('Problem getting record_id for :table',array(':table'=>$model->_table_name)); - - $model->$field = $ido->record_id->next_id($ido->id); - - return TRUE; - } - - public function keyget($column,$key=NULL) { - if (is_null($key) OR ! is_array($this->$column)) - return $this->$column; - else - return array_key_exists($key,$this->$column) ? $this->{$column}[$key] : NULL; - } - - final public function mid() { - return ORM::factory('Module',array('name'=>$this->_table_name)); - } - - /** - * Set the site ID attribute for each row update - */ - final public static function set_site_id($model,$field) { - if (! is_null($model->$field)) - return TRUE; - - $model->_changed[$field] = $field; - $model->$field = Company::instance()->site(); - - return TRUE; - } - - /** - * Function help to find records that are active - */ - public function list_active($active=TRUE) { - $x=($active ? $this->_where_active() : $this); - - return $x->find_all(); - } - - public function list_count($active=TRUE) { - $x=($active ? $this->_where_active() : $this); - - return $x->find_all()->count(); - } } -?> diff --git a/application/config/database.php b/application/config/database.php index 392c2260..896a3e43 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -36,6 +36,7 @@ return array 'table_prefix' => 'ab_', 'charset' => 'utf8', 'caching' => FALSE, + 'compress' => FALSE, 'profiling' => TRUE, ), ); diff --git a/includes/kohana b/includes/kohana index 53873600..0a7e8b34 160000 --- a/includes/kohana +++ b/includes/kohana @@ -1 +1 @@ -Subproject commit 53873600c1b517628ed3a108c2d9316cf3be89b2 +Subproject commit 0a7e8b349df4e965b30b3de3af3c23b6bdee40b6 diff --git a/modules/invoice/views/invoice/user/list/due.php b/modules/invoice/views/invoice/user/list/due.php new file mode 100644 index 00000000..1e434d07 --- /dev/null +++ b/modules/invoice/views/invoice/user/list/due.php @@ -0,0 +1,18 @@ + +title(sprintf('Invoices Due Account: %s (%s)',$o->accnum(),$o->invoice->list_due_total(TRUE))) + ->title_icon('fa fa-money') + ->span(6) + ->body(Table::factory() + ->data($o->invoice->list_due()) + ->columns(array( + 'id'=>'ID', + 'due_date'=>'Date Due', + 'total(TRUE)'=>'Invoice Total', + 'due(TRUE)'=>'Amount Due', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','invoice/view/')), + )) + ); +?> diff --git a/modules/lnapp b/modules/lnapp index 05d132c4..6a33249a 160000 --- a/modules/lnapp +++ b/modules/lnapp @@ -1 +1 @@ -Subproject commit 05d132c4be583a31642d2f03dec1e149f194f6f4 +Subproject commit 6a33249a95ea484dd60470edc3b38f85ff5e1340 diff --git a/modules/payment/classes/Model/Payment.php b/modules/payment/classes/Model/Payment.php index 0f7a6e62..a5c848d7 100644 --- a/modules/payment/classes/Model/Payment.php +++ b/modules/payment/classes/Model/Payment.php @@ -107,7 +107,7 @@ class Model_Payment extends ORM_OSB { */ public function subitems($type='ALL') { if (! $this->_sub_items_sorted) { - Sort::MAsort($this->_sub_items,'invoice_id'); + Sort::MAsort($this->_sub_items,array('invoice_id')); $this->_sub_items_sorted = TRUE; } diff --git a/modules/service/views/service/user/list.php b/modules/service/views/service/user/list.php new file mode 100644 index 00000000..87e087b7 --- /dev/null +++ b/modules/service/views/service/user/list.php @@ -0,0 +1,16 @@ + +title(sprintf('Active Service for Account: %s',$o->accnum())) + ->title_icon('fa-server') + ->span(6) + ->body(Table::factory() + ->data($o->service->list_active()) + ->columns(array( + 'id'=>'ID', + 'service_name()'=>'Service', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )) + ); +?> diff --git a/modules/service/views/service/user/list/expiring.php b/modules/service/views/service/user/list/expiring.php new file mode 100644 index 00000000..621e9371 --- /dev/null +++ b/modules/service/views/service/user/list/expiring.php @@ -0,0 +1,17 @@ + +title(sprintf('Services Expiring for Account: %s',$o->accnum())) + ->title_icon('fa fa-level-down') + ->span(6) + ->body(Table::factory() + ->data($o->service->list_expiring()) + ->columns(array( + 'id'=>'ID', + 'service_name(60)'=>'Service', + 'expire(TRUE)'=>'Date', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )) + ); +?>