Standardisation work, changed accnum() to refnum()

This commit is contained in:
Deon George
2016-07-29 23:04:34 +10:00
parent e0b45be758
commit 85f08bbb0a
52 changed files with 361 additions and 514 deletions

View File

@@ -10,5 +10,6 @@
* @license http://dev.osbill.net/license.html
*/
class Controller_Email extends Controller_TemplateDefault {
protected $icon = 'fa fa-envelope';
}
?>

View File

@@ -18,29 +18,12 @@ class Controller_Reseller_Email extends Controller_Email {
* Show a list of emails
*/
public function action_list() {
$this->meta->title = 'Emails Sent';
$this->meta->title = 'R|Emails Sent';
Block::factory()
->title(_('Emails Sent'))
->title_icon('fa fa-envelope')
->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),
))
);
->title_icon($this->icon)
->body(View::factory('email/list')->set('o',ORM::factory('Email_Log')->where_authorised($this->ao)->find_all()));
}
}
?>

View File

@@ -21,7 +21,10 @@ class Controller_User_Email extends Controller_Email {
public function action_list() {
$this->meta->title = 'Email List';
$this->template->content = View::factory('email/user/list');
Block::factory()
->title(sprintf(_('System Emails Sent for %s: %s'),$this->ao->refnum(),$this->ao->name(TRUE)))
->title_icon($this->icon)
->body(View::factory('email/user/list')->set('o',$this->ao->email_log->find_all()));
}
public function action_view() {

View File

@@ -0,0 +1,19 @@
<!-- o = Array of Model_Email -->
<?php echo Table::factory()
->page_items(25)
->data($o)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'email'=>'To',
'resolve("subject")'=>'Subject',
'account->refnum()'=>'Cust ID',
'account->name()'=>'Customer',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>60),
));
?>

View File

@@ -1,19 +1,16 @@
<?php $o = Auth::instance()->get_user();
echo Block::factory()
->title(sprintf(_('System Emails Sent for %s: %s'),$o->accnum(),$o->name(TRUE)))
->title_icon('fa fa-list')
->body(Table::factory()
->page_items(25)
->data($o->email_log->find_all())
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'resolve("subject")'=>'Subject',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>60),
))
);
<!-- o = Array of Model_Email -->
<?php echo Table::factory()
->page_items(25)
->data($o)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'resolve("subject")'=>'Subject',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>60),
));
?>