Fixes to OSB to work with KH 3.3

This commit is contained in:
Deon George
2012-11-10 10:13:57 +11:00
parent ea36639638
commit 6db02ae77d
238 changed files with 813 additions and 938 deletions

View File

@@ -25,7 +25,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
Block::add(array(
'title'=>_('System Emails Sent'),
'body'=>Table::display(
ORM::factory('email_log')->find_all(),
ORM::factory('Email_Log')->find_all(),
25,
array(
'id'=>array('label'=>'ID','url'=>'user/email/view/'),
@@ -47,7 +47,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
* List our defined email templates
*/
public function action_templatelist() {
$eto = ORM::factory('email_template');
$eto = ORM::factory('Email_Template');
$output = '';
// @todo Change this to use Table::
@@ -68,7 +68,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
* Add a template
*/
public function action_templateadd() {
$eto = ORM::factory('email_template');
$eto = ORM::factory('Email_Template');
$output = '';
if ($_POST AND $eto->values($_POST)->check()) {
@@ -102,11 +102,13 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
* Edit Template Definition
* @todo Change this into an add_view function like payment()
*/
public function action_templateedit($id) {
$eto = ORM::factory('email_template',$id);
public function action_templateedit() {
$id = $this->request->param('id');
$eto = ORM::factory('Email_Template',$id);
if (! $eto->loaded())
Request::current()->redirect('email/admin/template/list');
HTTP::redirect('email/admin/template/list');
$output = '';

View File

@@ -41,7 +41,7 @@ class Controller_User_Email extends Controller_TemplateDefault_User {
public function action_view() {
list($id,$output) = Table::page(__METHOD__);
$elo = ORM::factory('email_log',$id);
$elo = ORM::factory('Email_Log',$id);
if (! $elo->loaded() OR ! Auth::instance()->authorised($elo->account_id)) {
$this->template->content = 'Unauthorised or doesnt exist?';

View File

@@ -20,7 +20,7 @@ class Email_Template {
private $components = array('subject','message_text','message_html');
public function __construct($template,$language_id=NULL) {
$this->template = ORM::factory('email_template',array('name'=>$template));
$this->template = ORM::factory('Email_Template',array('name'=>$template));
if (! $this->template->loaded())
throw new Kohana_Exception('Email template :template not defined in DB',array(':template'=>$template));
@@ -75,7 +75,7 @@ class Email_Template {
$list = array();
foreach ($this->email_data[$key]['account'] as $id) {
$ao = ORM::factory('account',$id);
$ao = ORM::factory('Account',$id);
if ($ao->loaded())
$list[$ao->email] = $ao->name();
}
@@ -111,7 +111,7 @@ class Email_Template {
public function send(array $admin=array()) {
$e = Email::connect();
$sm = Swift_Message::newInstance()
->setFrom(Kohana::config('config.email_from'));
->setFrom(Kohana::$config->load('config')->email_from);
foreach ($this->components as $component) {
if ($this->etto->loaded()) {
@@ -154,7 +154,7 @@ class Email_Template {
if ($result) {
// Store our email log.
$elo = ORM::factory('email_log');
$elo = ORM::factory('Email_Log');
foreach ($sa as $id) {
$elo->clear();