Consistency updates for use of viewpath()
This commit is contained in:
parent
a40ce27a16
commit
a893527d77
@ -262,6 +262,29 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
|
|||||||
return sprintf('© %s',Config::SiteName());
|
return sprintf('© %s',Config::SiteName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a view path to help View::factory() calls
|
||||||
|
*
|
||||||
|
* The purpose of this method is to ensure that we have a consistant
|
||||||
|
* layout for our view files, including those that are needed by
|
||||||
|
* plugins
|
||||||
|
*
|
||||||
|
* @param string Plugin Name (optional)
|
||||||
|
*/
|
||||||
|
public function viewpath($plugin='') {
|
||||||
|
$request = Request::current();
|
||||||
|
|
||||||
|
$path = '';
|
||||||
|
$path .= $request->controller();
|
||||||
|
if ($request->directory())
|
||||||
|
$path .= ($path ? '/' : '').$request->directory();
|
||||||
|
if ($plugin)
|
||||||
|
$path .= ($path ? '/' : '').$plugin;
|
||||||
|
$path .= ($path ? '/' : '').$request->action();;
|
||||||
|
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This action will render all the media related files for a page
|
* This action will render all the media related files for a page
|
||||||
* @return void
|
* @return void
|
||||||
|
@ -57,7 +57,7 @@ class Controller_User_Account extends Controller_TemplateDefault_User {
|
|||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>_('Password Reset'),
|
'title'=>_('Password Reset'),
|
||||||
'body'=>View::factory('account/password_reset')
|
'body'=>View::factory($this->viewpath())
|
||||||
->set('record',$this->ao),
|
->set('record',$this->ao),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ class Controller_User_Account extends Controller_TemplateDefault_User {
|
|||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>sprintf('%s: %s - %s',_('Account Edit'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
'title'=>sprintf('%s: %s - %s',_('Account Edit'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
||||||
'body'=>View::factory('account/user/edit')
|
'body'=>View::factory($this->viewpath())
|
||||||
->set('record',$this->ao),
|
->set('record',$this->ao),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -253,17 +253,25 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function page($key) {
|
public static function page($key) {
|
||||||
if ($ids = Session::instance()->get('page_table_view'.$key)) {
|
// We have preference for parameters passed to the action.
|
||||||
$pag = new Pagination(array(
|
if (is_null($id = Request::current()->param('id'))) {
|
||||||
'total_items'=>count($ids),
|
|
||||||
'items_per_page'=>1,
|
|
||||||
));
|
|
||||||
|
|
||||||
return array($ids[$pag->current_first_item()-1],(string)$pag);
|
if (isset($_POST['id']) AND is_array($_POST['id']))
|
||||||
|
Table::post($key,'id');
|
||||||
|
|
||||||
|
if ($ids = Session::instance()->get('page_table_view'.$key)) {
|
||||||
|
$pag = new Pagination(array(
|
||||||
|
'total_items'=>count($ids),
|
||||||
|
'items_per_page'=>1,
|
||||||
|
));
|
||||||
|
|
||||||
|
return array($ids[$pag->current_first_item()-1],(string)$pag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// If we get here, then there is no previous data to retrieve.
|
// If we get here, then there is no previous data to retrieve.
|
||||||
} else
|
return array($id,'');
|
||||||
return array(NULL,'');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -53,11 +53,11 @@ class Model_Account extends Model_Auth_UserDefault {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function currency($name) {
|
public function currency($name) {
|
||||||
return StaticListModule::form($name,'currency',$this->currency_id,'id','name',array());
|
return StaticList_Module::form($name,'currency',$this->currency_id,'id','name',array('status'=>'=:1'),FALSE,array('class'=>'form_button'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function country($name) {
|
public function country($name) {
|
||||||
return StaticListModule::form($name,'country',$this->country_id,'id','name',array());
|
return StaticList_Module::form($name,'country',$this->country_id,'id','name',array('active'=>'=:1'),FALSE,array('class'=>'form_button'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function language($name) {
|
public function language($name) {
|
||||||
|
@ -104,21 +104,6 @@ abstract class ORMOSB extends ORM {
|
|||||||
$model->$field = serialize($value);
|
$model->$field = serialize($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a view path to help View::factory() calls
|
|
||||||
*
|
|
||||||
* The purpose of this method is to ensure that we have a consistant
|
|
||||||
* layout for our view files, including those that are needed by
|
|
||||||
* plugins
|
|
||||||
*
|
|
||||||
* @param string Plugin Name (optional)
|
|
||||||
*/
|
|
||||||
public function viewpath($plugin='') {
|
|
||||||
$request = Request::current();
|
|
||||||
|
|
||||||
return $plugin ? sprintf('%s/%s/%s/%s',$request->controller(),$request->directory(),$plugin,$request->action()) : sprintf('%s/%s/%s',$request->controller(),$request->directory(),$request->action());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function changed() {
|
public function changed() {
|
||||||
return $this->_changed;
|
return $this->_changed;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class Controller_Admin_Charge extends Controller_TemplateDefault_Admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output .= Form::open();
|
$output .= Form::open();
|
||||||
$output .= View::factory('charge/admin/add');
|
$output .= View::factory($this->viewpath());
|
||||||
$output .= Form::submit('submit','submit');
|
$output .= Form::submit('submit','submit');
|
||||||
$output .= Form::close();
|
$output .= Form::close();
|
||||||
|
|
||||||
|
@ -50,12 +50,13 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
|
|||||||
$eto = ORM::factory('email_template');
|
$eto = ORM::factory('email_template');
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
$output .= View::factory('email/admin/template/list_head');
|
// @todo Change this to use Table::
|
||||||
|
$output .= View::factory($this->viewpath().'/head');
|
||||||
foreach ($eto->find_all() as $et) {
|
foreach ($eto->find_all() as $et) {
|
||||||
$output .= View::factory('email/admin/template/list_body')
|
$output .= View::factory($this->viewpath().'/body')
|
||||||
->set('template',$et);
|
->set('template',$et);
|
||||||
}
|
}
|
||||||
$output .= View::factory('email/admin/template/list_foot');
|
$output .= View::factory($this->viewpath().'/foot');
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>_('Available Email Templates'),
|
'title'=>_('Available Email Templates'),
|
||||||
@ -85,8 +86,8 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output .= Form::open();
|
$output .= Form::open();
|
||||||
$output .= View::factory('email/admin/template/add');
|
$output .= View::factory($this->viewpath());
|
||||||
$output .= View::factory('email/admin/template/translate/add');
|
$output .= View::factory($this->viewpath().'/translate');
|
||||||
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
|
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
|
||||||
$output .= Form::close();
|
$output .= Form::close();
|
||||||
|
|
||||||
@ -99,6 +100,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Template Definition
|
* Edit Template Definition
|
||||||
|
* @todo Change this into an add_view function like payment()
|
||||||
*/
|
*/
|
||||||
public function action_templateedit($id) {
|
public function action_templateedit($id) {
|
||||||
$eto = ORM::factory('email_template',$id);
|
$eto = ORM::factory('email_template',$id);
|
||||||
@ -122,11 +124,11 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
|
|||||||
|
|
||||||
$output .= Form::open();
|
$output .= Form::open();
|
||||||
|
|
||||||
$output .= View::factory('email/admin/template/edit')
|
$output .= View::factory($this->viewpath())
|
||||||
->set('template',$eto);
|
->set('template',$eto);
|
||||||
|
|
||||||
foreach ($eto->email_template_translate->find_all() as $to) {
|
foreach ($eto->email_template_translate->find_all() as $to) {
|
||||||
$output .= View::factory('email/admin/template/translate/edit')
|
$output .= View::factory($this->viewpath().'/translate')
|
||||||
->set('translate',$to);
|
->set('translate',$to);
|
||||||
|
|
||||||
SystemMessage::add(array(
|
SystemMessage::add(array(
|
||||||
|
@ -39,17 +39,7 @@ class Controller_User_Email extends Controller_TemplateDefault_User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function action_view() {
|
public function action_view() {
|
||||||
$output = '';
|
list($id,$output) = Table::page(__METHOD__);
|
||||||
|
|
||||||
if (! $id = $this->request->param('id')) {
|
|
||||||
if (isset($_POST['id']) AND is_array($_POST['id']))
|
|
||||||
Table::post('email_view','id');
|
|
||||||
|
|
||||||
list($id,$output) = Table::page('email_view');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$id = $this->request->param('id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$elo = ORM::factory('email_log',$id);
|
$elo = ORM::factory('email_log',$id);
|
||||||
|
|
||||||
@ -58,7 +48,7 @@ class Controller_User_Email extends Controller_TemplateDefault_User {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= View::factory('email/user/view')
|
$output .= View::factory($this->viewpath())
|
||||||
->set('elo',$elo);
|
->set('elo',$elo);
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
|
@ -39,7 +39,7 @@ class Controller_Admin_Export extends Controller_TemplateDefault_Admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output .= Form::open();
|
$output .= Form::open();
|
||||||
$output .= View::factory('export/admin/map/add')
|
$output .= View::factory($this->viewpath())
|
||||||
->set('eo',$eo);
|
->set('eo',$eo);
|
||||||
|
|
||||||
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
|
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
|
||||||
|
@ -47,17 +47,7 @@ class Controller_User_Invoice extends Controller_TemplateDefault_User {
|
|||||||
* View an Invoice
|
* View an Invoice
|
||||||
*/
|
*/
|
||||||
public function action_view() {
|
public function action_view() {
|
||||||
$output = '';
|
list($id,$output) = Table::page(__METHOD__);
|
||||||
|
|
||||||
if (! $id = $this->request->param('id')) {
|
|
||||||
if (isset($_POST['id']) AND is_array($_POST['id']))
|
|
||||||
Table::post('invoice_view','id');
|
|
||||||
|
|
||||||
list($id,$output) = Table::page('invoice_view');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$id = $this->request->param('id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$io = ORM::factory('invoice',$id);
|
$io = ORM::factory('invoice',$id);
|
||||||
|
|
||||||
@ -66,7 +56,7 @@ class Controller_User_Invoice extends Controller_TemplateDefault_User {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= View::factory('invoice/user/view')
|
$output .= View::factory($this->viewpath())
|
||||||
->set('mediapath',Route::get('default/media'))
|
->set('mediapath',Route::get('default/media'))
|
||||||
->set('io',$io);
|
->set('io',$io);
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ class Model_Invoice extends ORMOSB {
|
|||||||
$css .= 'tr.even { background-color: #F6F6F8; }';
|
$css .= 'tr.even { background-color: #F6F6F8; }';
|
||||||
$css .= '</style>';
|
$css .= '</style>';
|
||||||
|
|
||||||
$output = View::factory('invoice/user/email')
|
$output = View::factory($this->viwepath())
|
||||||
->set('mediapath',Route::get('default/media'))
|
->set('mediapath',Route::get('default/media'))
|
||||||
->set('io',$this);
|
->set('io',$this);
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
protected $secure_actions = array(
|
protected $secure_actions = array(
|
||||||
'add'=>TRUE,
|
'add'=>TRUE,
|
||||||
'list'=>TRUE,
|
'list'=>TRUE,
|
||||||
|
'view'=>TRUE,
|
||||||
'autocomplete'=>FALSE,
|
'autocomplete'=>FALSE,
|
||||||
'autoitemlist'=>FALSE,
|
'autoitemlist'=>FALSE,
|
||||||
);
|
);
|
||||||
@ -40,24 +41,24 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
if (! Request::current()->is_ajax() OR ! isset($_REQUEST['key']) OR ! trim($_REQUEST['key']))
|
if (! Request::current()->is_ajax() OR ! isset($_REQUEST['key']) OR ! trim($_REQUEST['key']))
|
||||||
die();
|
die();
|
||||||
|
|
||||||
$output = View::factory('payment/admin/item/list_head');
|
$output = View::factory($this->viewpath().'/head');
|
||||||
$this->auto_render = FALSE;
|
$this->auto_render = FALSE;
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if (isset($_REQUEST['pid']))
|
if (isset($_REQUEST['pid']))
|
||||||
foreach (ORM::factory('payment_item')->where('payment_id','=',$_REQUEST['pid'])->find_all() as $pio)
|
foreach (ORM::factory('payment_item')->where('payment_id','=',$_REQUEST['pid'])->find_all() as $pio)
|
||||||
$output .= View::factory('payment/admin/item/list_body')
|
$output .= View::factory($this->viewpath().'/body')
|
||||||
->set('trc',$i++%2 ? 'odd' : 'even')
|
->set('trc',$i++%2 ? 'odd' : 'even')
|
||||||
->set('pio',$pio)
|
->set('pio',$pio)
|
||||||
->set('io',$pio->invoice);
|
->set('io',$pio->invoice);
|
||||||
|
|
||||||
foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io)
|
foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io)
|
||||||
$output .= View::factory('payment/admin/item/list_body')
|
$output .= View::factory($this->viewpath().'/body')
|
||||||
->set('trc',$i++%2 ? 'odd' : 'even')
|
->set('trc',$i++%2 ? 'odd' : 'even')
|
||||||
->set('io',$io);
|
->set('io',$io);
|
||||||
|
|
||||||
// @todo Need the JS to add up the payment allocation before submission
|
// @todo Need the JS to add up the payment allocation before submission
|
||||||
$output .= View::factory('payment/admin/item/list_foot')
|
$output .= View::factory($this->viewpath().'/foot')
|
||||||
->set('trc',$i++%2 ? 'odd' : 'even');
|
->set('trc',$i++%2 ? 'odd' : 'even');
|
||||||
|
|
||||||
$this->response->body($output);
|
$this->response->body($output);
|
||||||
@ -73,7 +74,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
ORM::factory('payment')->find_all(),
|
ORM::factory('payment')->find_all(),
|
||||||
25,
|
25,
|
||||||
array(
|
array(
|
||||||
'id'=>array('label'=>'ID','url'=>'admin/payment/add/'),
|
'id'=>array('label'=>'ID','url'=>'admin/payment/view/'),
|
||||||
'date_payment'=>array('label'=>'Date'),
|
'date_payment'=>array('label'=>'Date'),
|
||||||
'account->accnum()'=>array('class'=>'right'),
|
'account->accnum()'=>array('class'=>'right'),
|
||||||
'account->name()'=>array('label'=>'Account'),
|
'account->name()'=>array('label'=>'Account'),
|
||||||
@ -85,24 +86,12 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
array(
|
array(
|
||||||
'page'=>TRUE,
|
'page'=>TRUE,
|
||||||
'type'=>'select',
|
'type'=>'select',
|
||||||
'form'=>'admin/payment/add',
|
'form'=>'admin/payment/view',
|
||||||
)),
|
)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function action_add() {
|
private function add_view($id=NULL,$output='') {
|
||||||
$output = '';
|
|
||||||
|
|
||||||
if (! $id = $this->request->param('id')) {
|
|
||||||
if (isset($_POST['id']) AND is_array($_POST['id']))
|
|
||||||
Table::post('payment_view','id');
|
|
||||||
|
|
||||||
list($id,$output) = Table::page('payment_view');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$id = $this->request->param('id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$po = ORM::factory('payment',$id);
|
$po = ORM::factory('payment',$id);
|
||||||
|
|
||||||
if ($_POST) {
|
if ($_POST) {
|
||||||
@ -122,13 +111,13 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
SystemMessage::add(array(
|
SystemMessage::add(array(
|
||||||
'title'=>'Payment Recorded',
|
'title'=>'Payment Recorded',
|
||||||
'type'=>'info',
|
'type'=>'info',
|
||||||
'body'=>'Payment successfully recorded.',
|
'body'=>'Payment successfully recorded.',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= Form::open();
|
$output .= Form::open();
|
||||||
$output .= View::factory('payment/admin/add')
|
$output .= View::factory('payment/admin/add_view')
|
||||||
->set('po',$po);;
|
->set('po',$po);;
|
||||||
$output .= Form::submit('submit','submit',array('class'=>'form_button'));
|
$output .= Form::submit('submit','submit',array('class'=>'form_button'));
|
||||||
$output .= Form::close();
|
$output .= Form::close();
|
||||||
@ -195,9 +184,22 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action_add() {
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>_('Add Payments Received'),
|
'title'=>_('Add Payments Received'),
|
||||||
'body'=>$output,
|
'body'=>$this->add_view(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action_view() {
|
||||||
|
list($id,$output) = Table::page(__METHOD__);
|
||||||
|
|
||||||
|
Block::add(array(
|
||||||
|
'title'=>sprintf('%s: %s',_('View Payments Received'),$id),
|
||||||
|
'body'=>$this->add_view($id,$output),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class Controller_Product extends Controller_TemplateDefault {
|
|||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>sprintf('%s: %s',_('Category'),$cat->name),
|
'title'=>sprintf('%s: %s',_('Category'),$cat->name),
|
||||||
'body'=>View::factory('product/category/view')
|
'body'=>View::factory($this->viewpath().'/view')
|
||||||
->set('results',$this->_get_category($cat->id))
|
->set('results',$this->_get_category($cat->id))
|
||||||
->set('cat',$cat->id),
|
->set('cat',$cat->id),
|
||||||
));
|
));
|
||||||
@ -63,7 +63,7 @@ class Controller_Product extends Controller_TemplateDefault {
|
|||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>$po->product_translate->find()->description_short,
|
'title'=>$po->product_translate->find()->description_short,
|
||||||
'body'=>View::factory('product/view')
|
'body'=>View::factory($this->viewpath())
|
||||||
->set('record',$po),
|
->set('record',$po),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,10 @@ class Controller_Product_Category extends Controller_TemplateDefault {
|
|||||||
* By default show a menu of available categories
|
* By default show a menu of available categories
|
||||||
*/
|
*/
|
||||||
public function action_index() {
|
public function action_index() {
|
||||||
|
Request::current()->redirect('product_category/list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action_list() {
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>_('Product Categories'),
|
'title'=>_('Product Categories'),
|
||||||
'body'=>View::factory('product/category/list')
|
'body'=>View::factory('product/category/list')
|
||||||
|
@ -62,7 +62,7 @@ echo Form::open('cart/add');
|
|||||||
<!-- @todo If CURRENCY's value is not active in the DB, then the wrong flag is shown, as StaticList_Module::form() only returns active values -->
|
<!-- @todo If CURRENCY's value is not active in the DB, then the wrong flag is shown, as StaticList_Module::form() only returns active values -->
|
||||||
<!-- @todo Currency is not used in the cart? -->
|
<!-- @todo Currency is not used in the cart? -->
|
||||||
<?php $CURRENCY_ISO='AUD'; $CURRENCY=6; $COUNTRY=61?>
|
<?php $CURRENCY_ISO='AUD'; $CURRENCY=6; $COUNTRY=61?>
|
||||||
<td class="body"><?php echo StaticList_Module::form('currency','currency',$CURRENCY,'id','name',array('status'=>'=:1'));?> <?php echo Country::icon($COUNTRY);?></td>
|
<td class="body"><?php echo StaticList_Module::form('currency','currency',$CURRENCY,'id','name',array('status'=>'=:1'),FALSE,array('class'=>'form_button'));?> <?php echo Country::icon($COUNTRY);?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body"><b>Price Type</b></td>
|
<td class="body"><b>Price Type</b></td>
|
||||||
|
@ -360,7 +360,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
|||||||
$i = $j = 0;
|
$i = $j = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$summary = '';
|
$summary = '';
|
||||||
$output = View::factory('service/admin/list/adslbilling_head');
|
$output = View::factory($this->viewpath().'/head');
|
||||||
$output .= '<table class="box-left">';
|
$output .= '<table class="box-left">';
|
||||||
foreach ($aso->services(TRUE) as $so) {
|
foreach ($aso->services(TRUE) as $so) {
|
||||||
$po = $so->plugin()->product();
|
$po = $so->plugin()->product();
|
||||||
@ -377,7 +377,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
|||||||
|
|
||||||
// Record the the exception if the cost is not expected
|
// Record the the exception if the cost is not expected
|
||||||
if (round($po->adsl_supplier_plan->base_cost+$po->adsl_supplier_plan->tax(),2) != $uploaded['amount']) {
|
if (round($po->adsl_supplier_plan->base_cost+$po->adsl_supplier_plan->tax(),2) != $uploaded['amount']) {
|
||||||
$summary .= View::factory('service/admin/list/adslbilling_summary')
|
$summary .= View::factory($this->viewpath().'/summary')
|
||||||
->set('service',$so)
|
->set('service',$so)
|
||||||
->set('plan',$po)
|
->set('plan',$po)
|
||||||
->set('planoverride',$so->plugin()->provided_adsl_plan_id ? TRUE : FALSE)
|
->set('planoverride',$so->plugin()->provided_adsl_plan_id ? TRUE : FALSE)
|
||||||
@ -398,7 +398,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
|||||||
|
|
||||||
$total += $uploaded['amount'];
|
$total += $uploaded['amount'];
|
||||||
|
|
||||||
$output .= View::factory('service/admin/list/adslbilling_body')
|
$output .= View::factory($this->viewpath().'/body')
|
||||||
->set('service',$so)
|
->set('service',$so)
|
||||||
->set('plan',$po)
|
->set('plan',$po)
|
||||||
->set('planoverride',$so->plugin()->provided_adsl_plan_id ? TRUE : FALSE)
|
->set('planoverride',$so->plugin()->provided_adsl_plan_id ? TRUE : FALSE)
|
||||||
@ -409,7 +409,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
|||||||
->set('i',$i++%2);
|
->set('i',$i++%2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= View::factory('service/admin/list/adslbilling_foot')
|
$output .= View::factory($this->viewpath().'/foot')
|
||||||
->set('total',$total);
|
->set('total',$total);
|
||||||
|
|
||||||
$output .= '</table>';
|
$output .= '</table>';
|
||||||
@ -417,7 +417,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
|||||||
// Summary Report of remaining CSV items.
|
// Summary Report of remaining CSV items.
|
||||||
if (! empty($csv))
|
if (! empty($csv))
|
||||||
foreach ($csv as $service => $item) {
|
foreach ($csv as $service => $item) {
|
||||||
$summary .= View::factory('service/admin/list/adslbilling_summary_exception')
|
$summary .= View::factory($this->viewpath().'/summary_exception')
|
||||||
->set('service',$service)
|
->set('service',$service)
|
||||||
->set('item',$item)
|
->set('item',$item)
|
||||||
->set('i',$j++%2);
|
->set('i',$j++%2);
|
||||||
|
@ -41,18 +41,7 @@ class Controller_User_Service extends Controller_TemplateDefault_User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function action_view() {
|
public function action_view() {
|
||||||
$output = '';
|
list($id,$output) = Table::page(__METHOD__);
|
||||||
|
|
||||||
// Check if we are a table view
|
|
||||||
if (! $id = $this->request->param('id')) {
|
|
||||||
if (isset($_POST['id']) AND is_array($_POST['id']))
|
|
||||||
Table::post('service_view','id');
|
|
||||||
|
|
||||||
list($id,$output) = Table::page('service_view');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$id = $this->request->param('id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$so = ORM::factory('service',$id);
|
$so = ORM::factory('service',$id);
|
||||||
|
|
||||||
@ -61,7 +50,7 @@ class Controller_User_Service extends Controller_TemplateDefault_User {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= View::factory('service/user/view')
|
$output .= View::factory($this->viewpath())
|
||||||
->set('so',$so);
|
->set('so',$so);
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
|
@ -37,7 +37,8 @@ class Controller_Admin_SSL extends Controller_TemplateDefault_Admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function action_update() {
|
public function action_update() {
|
||||||
$id = $this->request->param('id');
|
list($id,$output) = Table::page(__METHOD__);
|
||||||
|
|
||||||
$so = ORM::factory('ssl_ca',$id);
|
$so = ORM::factory('ssl_ca',$id);
|
||||||
|
|
||||||
if (! $so->loaded())
|
if (! $so->loaded())
|
||||||
@ -48,11 +49,13 @@ class Controller_Admin_SSL extends Controller_TemplateDefault_Admin {
|
|||||||
throw new Kohana_Exception('Failed to save updates to plugin data for record :record',array(':record'=>$so->id()));
|
throw new Kohana_Exception('Failed to save updates to plugin data for record :record',array(':record'=>$so->id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output .= View::factory($this->viewpath())
|
||||||
|
->set('so',$so)
|
||||||
|
->set('mediapath',Route::get('default/media'));
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>sprintf('%s %s:%s',_('Update SSL Service'),$so->id,$so->display('sign_cert')),
|
'title'=>sprintf('%s %s:%s',_('Update SSL Service'),$so->id,$so->display('sign_cert')),
|
||||||
'body'=>View::factory('ssl/admin/update')
|
'body'=>$output,
|
||||||
->set('so',$so)
|
|
||||||
->set('mediapath',Route::get('default/media'))
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class Controller_User_Statement extends Controller_TemplateDefault_User {
|
|||||||
));
|
));
|
||||||
|
|
||||||
$output = (string)$pag;
|
$output = (string)$pag;
|
||||||
$output .= View::factory('statement/user/show_head');
|
$output .= View::factory($this->viewpath().'/head');
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($ta as $k => $v) {
|
foreach ($ta as $k => $v) {
|
||||||
@ -68,12 +68,12 @@ class Controller_User_Statement extends Controller_TemplateDefault_User {
|
|||||||
elseif ($i > $pag->current_last_item())
|
elseif ($i > $pag->current_last_item())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
$output .= View::factory('statement/user/show_body')
|
$output .= View::factory($this->viewpath().'/body')
|
||||||
->set('o',$v)
|
->set('o',$v)
|
||||||
->set('trc',$i%2 ? 'odd' : 'even');
|
->set('trc',$i%2 ? 'odd' : 'even');
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= View::factory('statement/user/show_foot');
|
$output .= View::factory($this->viewpath().'/foot');
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>sprintf('%s: %s - %s',_('Transactions For'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
'title'=>sprintf('%s: %s - %s',_('Transactions For'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
||||||
|
@ -25,7 +25,7 @@ class Controller_StaticPage extends Controller_TemplateDefault {
|
|||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>$sp->staticpage_translate->find()->title,
|
'title'=>$sp->staticpage_translate->find()->title,
|
||||||
'body'=>View::factory('staticpage/view')
|
'body'=>View::factory($this->viewpath())
|
||||||
->set('record',$sp),
|
->set('record',$sp),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,10 @@ class Controller_StaticPage_Category extends Controller_TemplateDefault {
|
|||||||
* By default show a menu of available categories
|
* By default show a menu of available categories
|
||||||
*/
|
*/
|
||||||
public function action_index() {
|
public function action_index() {
|
||||||
|
Request::current()->redirect('staticpage_category/list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action_list() {
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>_('Site Index Categories'),
|
'title'=>_('Site Index Categories'),
|
||||||
'body'=>View::factory('staticpage/category/list')
|
'body'=>View::factory('staticpage/category/list')
|
||||||
|
Reference in New Issue
Block a user