Added Service Add, some internal consistency updates

This commit is contained in:
Deon George
2013-11-27 11:22:20 +11:00
parent c18d5a3881
commit 0ed5e5163d
29 changed files with 372 additions and 179 deletions

View File

@@ -12,7 +12,6 @@
class Controller_Admin_Email extends Controller_Email {
protected $secure_actions = array(
'ajaxtemplatetranslate'=>TRUE,
'list'=>TRUE,
'templateadd'=>TRUE,
'templateedit'=>TRUE,
'templatelist'=>TRUE,
@@ -34,33 +33,6 @@ class Controller_Admin_Email extends Controller_Email {
$this->template->content = $output;
}
/**
* Show a list of emails
*/
public function action_list() {
Block::factory()
->title(_('System Emails Sent'))
->title_icon('icon-th')
->body(Table::factory()
->page_items(25)
->data(ORM::factory('Email_Log')->find_all())
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'email'=>'To',
'resolve("subject")'=>'Subject',
'account->accnum()'=>'Cust ID',
'account->name()'=>'Customer',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>60),
))
);
}
/**
* Add a template
*/
@@ -119,6 +91,7 @@ class Controller_Admin_Email extends Controller_Email {
$eto->reload();
}
// @todo With tinymce, if the user reselects a different language, we loose the editor?
Script::factory()
->type('stdin')
->data('
@@ -139,7 +112,7 @@ $(document).ready(function() {
alert("Failed to submit");
},
success: function(data) {
$("div[id=translate]").replaceWith(data);
$("div[id=translate]").empty().append(data);
}
});
});

View File

@@ -0,0 +1,44 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Reseller Email management
*
* @package Email
* @category Controllers/Reseller
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Reseller_Email extends Controller_Email {
protected $secure_actions = array(
'list'=>TRUE,
);
/**
* Show a list of emails
*/
public function action_list() {
Block::factory()
->title(_('System Emails Sent'))
->title_icon('icon-th')
->body(Table::factory()
->page_items(25)
->data(ORM::factory('Email_Log')->where_authorised($this->ao)->find_all())
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'email'=>'To',
'resolve("subject")'=>'Subject',
'account->accnum()'=>'Cust ID',
'account->name()'=>'Customer',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>60),
))
);
}
}
?>