Added Tasks to KH
This commit is contained in:
70
application/classes/controller/admin/welcome.php
Normal file
70
application/classes/controller/admin/welcome.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* OSB Admin Main home page
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Page/Home
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
protected $auth_required = TRUE;
|
||||
public $secure_actions = array(
|
||||
'index'=>TRUE,
|
||||
);
|
||||
|
||||
public function action_index() {
|
||||
$ao = ORM::factory('account',Auth::instance()->get_user()->id);
|
||||
$t = time();
|
||||
|
||||
// Show outstanding invoices
|
||||
$o = ORM::factory('invoice');
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Overdue',
|
||||
'body'=>Table::limit(
|
||||
$o->list_overdue($t),
|
||||
30,
|
||||
array('Due Date'=>'display("due_date")','Account'=>'account->name()','Active'=>'account->display("status")','ID'=>'id()','Amount Due'=>'due(TRUE)'),
|
||||
'due()'),
|
||||
'position'=>1,
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Due',
|
||||
'body'=>Table::limit(
|
||||
$o->list_due($t),
|
||||
30,
|
||||
array('Due Date'=>'display("due_date")','Account'=>'account->name()','Active'=>'account->display("status")','ID'=>'id()','Amount Due'=>'due(TRUE)'),
|
||||
'due()'),
|
||||
'position'=>2,
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
// Show un-applied payments
|
||||
$o = ORM::factory('payment');
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Unapplied Payments',
|
||||
'body'=>Table::limit(
|
||||
$o->list_unapplied(),
|
||||
30,
|
||||
array('ID'=>'id','Account'=>'account->name()','Total'=>'display("total_amt")','Balance'=>'balance(TRUE)'),
|
||||
'balance(TRUE)'),
|
||||
'position'=>3,
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s %s',$ao->accnum(),$ao->first_name,$ao->last_name),
|
||||
'subtitle'=>_('Administrator Overview'),
|
||||
'body'=>(string)Block_Sub::factory(),
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
21
application/classes/controller/lnapp/task.php
Normal file
21
application/classes/controller/lnapp/task.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides the default controller for tasks.
|
||||
*
|
||||
* @package lnApp
|
||||
* @subpackage Task
|
||||
* @category Abstract/Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class Controller_lnApp_Task extends Controller {
|
||||
public function before() {
|
||||
if (! Kohana::$is_cli)
|
||||
throw new Kohana_Exception('Cant run :method, it must be run by the CLI',array(':method'=>$this->request->action()));
|
||||
|
||||
parent::before();
|
||||
}
|
||||
}
|
||||
?>
|
4
application/classes/controller/task.php
Normal file
4
application/classes/controller/task.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Controller_Task extends Controller_lnApp_Task {}
|
||||
?>
|
@@ -14,7 +14,7 @@ class Controller_User_Welcome extends Controller_TemplateDefault {
|
||||
protected $auth_required = TRUE;
|
||||
|
||||
public function action_index() {
|
||||
$ao = ORM::factory('account',Auth::instance()->get_user()->id);
|
||||
$ao = ORM::factory('account',Auth::instance()->get_user()->id);
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s %s',$ao->accnum(),$ao->first_name,$ao->last_name),
|
||||
|
Reference in New Issue
Block a user