Improved service display

This commit is contained in:
Deon George
2011-07-14 19:09:03 +10:00
parent 46c3b9a075
commit 27cdab1fe4
37 changed files with 1319 additions and 1042 deletions

View File

@@ -195,7 +195,8 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
parent::after();
// Generate and check the ETag for this file
$this->response->check_cache(NULL,$this->request);
if (Kohana::$environment === Kohana::PRODUCTION)
$this->response->check_cache(NULL,$this->request);
}
/**

View File

@@ -16,10 +16,10 @@
class Model_Module extends ORMOSB {
// Relationships
protected $_has_many = array(
'module_method'=>array(),
'module_method'=>array('far_key'=>'id'),
);
protected $_has_one = array(
'record_id'=>array()
'record_id'=>array('far_key'=>'id'),
);
protected $_sorting = array(

View File

@@ -31,16 +31,6 @@ abstract class ORMOSB extends ORM {
);
}
/**
* Our child models should provide an invoice display, this is shown
* on printed invoices.
*
* @todo This is no longer used I think?
*/
public function invoice_display() {
throw new Kohana_Exception(':module has not configured an :method, but has made the call',array(':module'=>get_class($this),'method'=>__METHOD__));
}
/**
* This function will enhance the [Validate::filter], since it always passes
* the value as the first argument and sometimes functions need that to not
@@ -101,5 +91,20 @@ abstract class ORMOSB extends ORM {
return TRUE;
}
/**
* 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());
}
}
?>

View File

@@ -36,7 +36,7 @@ class StaticList_RecurSchedule extends StaticList {
*
* @uses product
*/
public static function form($name,$product='',$addblank=FALSE) {
public static function form($name,$product='',$default='',$addblank=FALSE) {
if (empty($product))
throw new Kohana_Exception('Product is a required field for :method',array(':method'=>__METHOD__));
@@ -50,7 +50,7 @@ class StaticList_RecurSchedule extends StaticList {
$x[$term] .= sprintf(' + %s %s',Currency::display($price['price_setup']),_('Setup'));
}
return Form::select($name,$x,$product->price_recurr_default);
return Form::select($name,$x,$default);
}
}
?>

View File

@@ -0,0 +1,29 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This is class renders Recurring Schedule Types on responses and forms.
*
* @package OSB
* @subpackage Utilities
* @category Helpers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class StaticList_RecurType extends StaticList {
protected function table() {
return array(
0=>_('Bill on Aniversary Date of Subscription'),
1=>_('Bill on Fixed Schedule'),
);
}
public static function factory() {
return new StaticList_RecurType;
}
public static function display($value) {
return static::_display($value);
}
}
?>