Major work to domain and hosting
Minor updates for ADSL services Updates to Sort::MAsort() Move core OSB items under application/ Moved ACCOUNT functions under application Minor updates to task
This commit is contained in:
16
application/classes/controller/account.php
Normal file
16
application/classes/controller/account.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides account management
|
||||
*
|
||||
* @package lnApp
|
||||
* @subpackage Page/Account
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
* @also [logout]
|
||||
*/
|
||||
class Controller_Account extends Controller_TemplateDefault {
|
||||
}
|
||||
?>
|
@@ -32,7 +32,8 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
'due_date'=>array('label'=>'Due Date'),
|
||||
'account->name()'=>array('label'=>'Account'),
|
||||
'account->display("status")'=>array('label'=>'Active'),
|
||||
'id()'=>array('label'=>'ID'),
|
||||
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
|
||||
'total_amt'=>array('label'=>'Total','class'=>'right'),
|
||||
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
|
||||
),
|
||||
array('page'=>TRUE)),
|
||||
@@ -49,7 +50,8 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
'due_date'=>array('label'=>'Due Date'),
|
||||
'account->name()'=>array('label'=>'Account'),
|
||||
'account->display("status")'=>array('label'=>'Active'),
|
||||
'id()'=>array('label'=>'ID'),
|
||||
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
|
||||
'total_amt'=>array('label'=>'Total','class'=>'right'),
|
||||
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
|
||||
),
|
||||
array('page'=>TRUE)),
|
||||
@@ -60,13 +62,14 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Due',
|
||||
'body'=>Table::display(
|
||||
$o->list_due($t),
|
||||
$o->list_due(),
|
||||
25,
|
||||
array(
|
||||
'due_date'=>array('label'=>'Due Date'),
|
||||
'account->name()'=>array('label'),
|
||||
'account->display("status")'=>array('label'=>'Active'),
|
||||
'id()'=>array('label'=>'ID'),
|
||||
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
|
||||
'total_amt'=>array('label'=>'Total','class'=>'right'),
|
||||
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
|
||||
),
|
||||
array('show_other'=>'due()')),
|
||||
@@ -83,9 +86,10 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
$o->list_unapplied(),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID'),
|
||||
'date_payment'=>array('label'=>'Pay Date'),
|
||||
'account->name()'=>array('label'=>'Account'),
|
||||
'account->display("status")'=>array('label'=>'Active'),
|
||||
'id'=>array('label'=>'ID','url'=>'user/payment/view/'),
|
||||
'total_amt'=>array('label'=>'Total','class'=>'right'),
|
||||
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
|
||||
),
|
||||
|
@@ -152,6 +152,15 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
|
||||
$this->meta->title = Kohana::Config('config.appname');
|
||||
$this->template->title = '';
|
||||
|
||||
// Language
|
||||
$this->meta->language = Config::instance()->so->language_id;
|
||||
|
||||
// Copyright
|
||||
$this->meta->copywrite = Config::instance()->so->site_name;
|
||||
|
||||
// Copyright
|
||||
$this->meta->description = sprintf('%s::%s',$this->request->controller(),$this->request->action());
|
||||
|
||||
// Style Sheets Properties
|
||||
$this->meta->styles = Style::factory();
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class Controller_TemplateDefault extends Controller_lnApp_TemplateDefault {
|
||||
}
|
||||
|
||||
private function _cart() {
|
||||
if (! class_exists('cart') OR ! Cart::instance()->contents()->reset(FALSE)->count_all())
|
||||
if (! Config::moduleexist('cart') OR ! class_exists('cart') OR ! Cart::instance()->contents()->reset(FALSE)->count_all())
|
||||
return '';
|
||||
|
||||
return Cart::instance()->cart_block();
|
||||
|
@@ -11,5 +11,20 @@
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_TemplateDefault_Affiliate extends Controller_TemplateDefault_User {
|
||||
/**
|
||||
* This will filter a search query to only return the affiliates
|
||||
*/
|
||||
protected function filter($o,$af,$sort='account->name()',$afid='affiliate_id') {
|
||||
$result = array();
|
||||
|
||||
foreach ($o as $x)
|
||||
if ($x->$afid == $af)
|
||||
array_push($result,$x);
|
||||
|
||||
if ($sort)
|
||||
Sort::MAsort($result,$sort);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -35,7 +35,7 @@ class Controller_Tree extends Controller_lnApp_Tree {
|
||||
if ($mmo->menu_display AND empty($modules[$mmo->module_id]))
|
||||
$modules[$mmo->module_id] = $mmo->module;
|
||||
|
||||
Sort::masort($modules,'name');
|
||||
Sort::MAsort($modules,'name');
|
||||
|
||||
foreach ($modules as $id => $mo)
|
||||
if (! $mo->parent_id)
|
||||
@@ -52,7 +52,7 @@ class Controller_Tree extends Controller_lnApp_Tree {
|
||||
if ($user->has_any('group',$gmo->list_childgrps(TRUE)))
|
||||
$methods[$mmo->id] = $mmo;
|
||||
|
||||
Sort::masort($modules,'name');
|
||||
Sort::MASort($modules,'name');
|
||||
|
||||
foreach ($methods as $id => $mmo) {
|
||||
if (preg_match('/_/',$mmo->name)) {
|
||||
|
111
application/classes/controller/user/account.php
Normal file
111
application/classes/controller/user/account.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides User Account Update functions
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Account
|
||||
* @category Controllers/User
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_User_Account extends Controller_TemplateDefault_User {
|
||||
protected $secure_actions = array(
|
||||
'edit'=>TRUE,
|
||||
'resetpassword'=>TRUE,
|
||||
);
|
||||
|
||||
public function action_resetpassword() {
|
||||
// @todo Fix this next logic, since matches_ifset is not being called when the value is on the form, but empty
|
||||
if (empty($_POST['password_confirm']))
|
||||
$_POST['password_confirm'] = ' ';
|
||||
|
||||
// Store our new values
|
||||
$this->ao->values($_POST);
|
||||
|
||||
// Run validation and save
|
||||
if ($this->ao->changed())
|
||||
if ($this->ao->check()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record updated'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Your account record has been updated.')
|
||||
));
|
||||
|
||||
$this->ao->save();
|
||||
|
||||
// Log the password reset
|
||||
$this->ao->log('Password reset');
|
||||
|
||||
Request::current()->redirect('login');
|
||||
|
||||
} else {
|
||||
$output = '';
|
||||
foreach ($this->ao->validation()->errors('forms/login') as $field => $error)
|
||||
$output .= sprintf('<li><b>%s</b> %s</li>',$field,$error);
|
||||
|
||||
if ($output)
|
||||
$output = sprintf('<ul>%s</ul>',$output);
|
||||
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record NOT updated'),
|
||||
'type'=>'error',
|
||||
'body'=>_('Your updates didnt pass validation.').'<br/>'.$output,
|
||||
));
|
||||
}
|
||||
else
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record NOT updated'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Your account has NOT been updated.')
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Password Reset'),
|
||||
'body'=>View::factory('account/password_reset')
|
||||
->set('record',$this->ao),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a product
|
||||
*/
|
||||
public function action_edit() {
|
||||
// Store our new values
|
||||
$this->ao->values($_POST);
|
||||
|
||||
// Run validation and save
|
||||
if ($this->ao->changed())
|
||||
if ($this->ao->check()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record updated'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Your account record has been updated.')
|
||||
));
|
||||
|
||||
$this->ao->save();
|
||||
|
||||
} else {
|
||||
$output = '';
|
||||
foreach ($this->ao->validation()->errors('forms/login') as $field => $error)
|
||||
$output .= sprintf('<li><b>%s</b> %s</li>',$field,$error);
|
||||
|
||||
if ($output)
|
||||
$output = sprintf('<ul>%s</ul>',$output);
|
||||
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record NOT updated'),
|
||||
'type'=>'error',
|
||||
'body'=>_('Your updates didnt pass validation.').'<br/>'.$output,
|
||||
));
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s - %s',_('Account Edit'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
||||
'body'=>View::factory('account/user/edit')
|
||||
->set('record',$this->ao),
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user