diff --git a/application/bootstrap.php b/application/bootstrap.php index c1a74319..bb024a19 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -109,7 +109,7 @@ Kohana::$config->attach(new Config_File); * Enable modules. Modules are referenced by a relative or absolute path. */ Kohana::modules(array( - 'lnapp' => MODPATH.'lnApp', + 'lnapp' => MODPATH.'lnApp', // lnApp Base Application Tools 'oauth' => MODPATH.'oauth', // OAuth Module for External Authentication 'auth' => SMDPATH.'auth', // Basic authentication 'cache' => SMDPATH.'cache', // Caching with multiple backends diff --git a/application/classes/Config.php b/application/classes/Config.php index 525cbe11..1a78e8a4 100644 --- a/application/classes/Config.php +++ b/application/classes/Config.php @@ -64,17 +64,20 @@ class Config extends Kohana_Config { return Company::instance()->country(); } + /** + * Show a date using a site configured format + */ public static function date($date) { return is_null($date) ? '' : date(Company::instance()->date_format(),$date); } /** - * Show a date using a site configured format + * Show a date using a site configured format * @note We need this function here, since we call static:: methods, which need to resolve to the child class. - */ - public static function datetime($date) { - return sprintf('%s %s',static::date($date),static::time($date)); - } + */ + public static function datetime($date) { + return sprintf('%s %s',static::date($date),static::time($date)); + } public static function language() { return Company::instance()->language(); @@ -138,6 +141,9 @@ class Config extends Kohana_Config { return array_key_exists(strtolower($module),static::modules()) ? TRUE : FALSE; } + /** + * Work out our site ID for multiehosting + */ public static function siteid($format=FALSE) { return Company::instance()->site($format); } @@ -173,6 +179,9 @@ class Config extends Kohana_Config { return 'theme/'.(URL::admin_url() ? Kohana::$config->load('config')->theme_admin : Kohana::$config->load('config')->theme); } + /** + * Show a date using a site configured format + */ public static function time($date) { return date(Company::instance()->time_format(),($date ? $date : time())); } diff --git a/application/classes/Controller/TemplateDefault.php b/application/classes/Controller/TemplateDefault.php index 5cb93a8c..2103ad3a 100644 --- a/application/classes/Controller/TemplateDefault.php +++ b/application/classes/Controller/TemplateDefault.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault { +abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault { protected $auth_required = TRUE; // Our acccount object diff --git a/application/classes/Minion/Task.php b/application/classes/Minion/Task.php index e4ba6028..30a9dce9 100644 --- a/application/classes/Minion/Task.php +++ b/application/classes/Minion/Task.php @@ -17,9 +17,9 @@ abstract class Minion_Task extends Kohana_Minion_Task { /** * Override our __construct so that we can specify options in each class file */ - protected function __construct() { - // Populate $_accepted_options based on keys from $_options - $this->_accepted_options = array_keys(Arr::merge($this->_sysoptions,$this->_options)); - } + protected function __construct() { + // Populate $_accepted_options based on keys from $_options + $this->_accepted_options = array_keys(Arr::merge($this->_sysoptions,$this->_options)); + } } ?> diff --git a/modules/adsl/classes/Task/Adsl/Trafficcharge.php b/modules/adsl/classes/Task/Adsl/Trafficcharge.php index d77f447b..9ee75983 100644 --- a/modules/adsl/classes/Task/Adsl/Trafficcharge.php +++ b/modules/adsl/classes/Task/Adsl/Trafficcharge.php @@ -10,6 +10,10 @@ * @license http://dev.osbill.net/license.html */ class Task_Adsl_Trafficcharge extends Task_Adsl_Trafficget { + protected $_options = array( + 'verbose'=>FALSE, + ); + protected function _execute(array $params) { foreach ($this->_traffic_suppliers(TRUE) as $aso) { if ($params['verbose']) diff --git a/modules/email/classes/Model/Email/Template.php b/modules/email/classes/Model/Email/Template.php index bb2774a4..de015a4f 100644 --- a/modules/email/classes/Model/Email/Template.php +++ b/modules/email/classes/Model/Email/Template.php @@ -26,5 +26,9 @@ class Model_Email_Template extends ORM_OSB { array('StaticList_YesNo::get',array(':value')), ), ); + + public function name() { + return ! is_null($this->description) ? $this->description : $this->name; + } } ?> diff --git a/modules/invoice/classes/Model/Invoice.php b/modules/invoice/classes/Model/Invoice.php index ab2ad844..cf26b47c 100644 --- a/modules/invoice/classes/Model/Invoice.php +++ b/modules/invoice/classes/Model/Invoice.php @@ -121,6 +121,27 @@ class Model_Invoice extends ORM_OSB implements Cartable { return $result; } + /** + * Returns the array of Email Template Objects + */ + public function reminders($key=NULL,$format=FALSE) { + $prefix = 'task_invoice_'; + + if (is_null($key)) { + $result = array(); + + foreach ($this->reminders as $k=>$v) + array_push($result,ORM::factory('Email_Template',array('name'=>$prefix.$k))); + + return $result; + + } else { + $key = preg_replace("/^$prefix/",'',$key); + + return isset($this->reminders[$key]) ? ($format ? Config::date($this->reminders[$key]) : $this->reminders[$key]) : NULL; + } + } + /** * Return the service items on an invoice relating to an invoice_item * IE: item_type == 0 diff --git a/modules/invoice/views/invoice/user/view.php b/modules/invoice/views/invoice/user/view.php index 62bb2ebf..c0737554 100644 --- a/modules/invoice/views/invoice/user/view.php +++ b/modules/invoice/views/invoice/user/view.php @@ -53,6 +53,15 @@
+
+
Reminder Details
+
+ reminders() as $eto) : ?> +
reminders($eto->name,TRUE); ?>
+
name(); ?>
+ +
+