Password Reset Validation, Removal of unnessary files, Service display updates

This commit is contained in:
Deon George
2013-06-06 00:03:55 +10:00
parent 0efd99f194
commit 66ea9babf4
12 changed files with 94 additions and 163 deletions

View File

@@ -1,18 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports affiliates
*
* @package Affiliate
* @category Models
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Affiliate extends ORM_OSB {
// Relationships
protected $_belongs_to = array(
'host_server_affiliate'=>array('far_key'=>'affiliate_id','foreign_key'=>'id'),
);
}
?>

View File

@@ -90,7 +90,7 @@ class Model_Service extends ORM_OSB {
$expire = (is_null($plugin=$this->plugin()) ? NULL : $plugin->expire());
// If $expire is NULL, we'll use the next invoice date
$expire = is_null($expire) ? $this->date_next_invoice-86400 : $expire;
$expire = is_null($expire) ? $this->paid_to() : $expire;
return $format ? Config::date($expire) : $expire;
}
@@ -128,6 +128,15 @@ class Model_Service extends ORM_OSB {
return $result;
}
/**
* Show the date we are invoiced to
*/
public function invoiced_to($format=FALSE) {
$x = $this->invoice_item->order_by('date_stop','DESC')->limit(1)->find();
return $format ? $x->display('date_stop') : $x->date_stop;
}
/**
* Display the service product name
*/
@@ -136,7 +145,22 @@ class Model_Service extends ORM_OSB {
}
/**
* Returns TRUE of this service has a planend change
* Returns the date that an item has been paid to
*/
public function paid_to($format=FALSE) {
$x = NULL;
foreach ($this->invoice_item->order_by('date_stop','DESC')->order_by('date_orig','DESC')->find_all() as $iio)
if ($iio->invoice->due() == 0) {
$x = $iio;
break;
}
return $format ? ($x ? $x->display('date_stop') : '&nbsp;') : ($x ? $x->date_stop : NULL);
}
/**
* Returns TRUE of this service has a planned change
*/
public function pending_change() {
return $this->service_change()->loaded() ? TRUE : FALSE;
@@ -219,18 +243,13 @@ class Model_Service extends ORM_OSB {
return $this->invoice_item->order_by('date_start,date_stop');
}
// @todo To implement
public function charges_new() {
return $this->charges();
}
/** LIST FUNCTIONS **/
/**
* Search for services matching a term
*/
public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) {
// We only show invoice numbers.
// We only show service numbers.
if (! is_numeric($term))
return array();

View File

@@ -21,6 +21,12 @@
<dd><?php echo HTML::anchor('product/view/'.$o->product_id,$o->product->title()); ?></dd>
<?php endif ?>
<dt>Invoiced To</dt>
<dd><?php echo $o->invoiced_to(TRUE); ?></dd>
<dt>Paid To</dt>
<dd><?php echo $o->paid_to(TRUE); ?></dd>
<dt>Date Next Invoice</dt>
<dd><?php echo $o->display('date_next_invoice'); ?></dd>

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_SSL_Renew extends Task {
class Task_SSL_Renew extends Minion_Task {
/**
* Renew a certificate
*/