Show externally billed domains

This commit is contained in:
Deon George 2014-01-24 00:20:48 +11:00
parent ec88eb6926
commit ae98efa84e
8 changed files with 51 additions and 32 deletions

View File

@ -1,7 +1,7 @@
<?php defined('SYSPATH') or die('No direct access allowed.'); <?php defined('SYSPATH') or die('No direct access allowed.');
/** /**
* lnApp Main home page * OSB Main home page
* *
* @package OSB * @package OSB
* @category Controllers/User * @category Controllers/User

View File

@ -50,9 +50,9 @@ class Menu {
$output = $sub ? '<ul class="dropdown-menu">' : '<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">'; $output = $sub ? '<ul class="dropdown-menu">' : '<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">';
foreach ($result as $k => $v) foreach ($result as $k => $v)
if (is_array($v)) { if (is_array($v))
$output .= sprintf('<li class="dropdown-submenu">%s%s',HTML::anchor('#',$k,array('nocg'=>TRUE)),self::ul($v,NULL,TRUE).'</li>'); $output .= sprintf('<li class="dropdown-submenu">%s%s',HTML::anchor('#',$k,array('nocg'=>TRUE)),self::ul($v,NULL,TRUE).'</li>');
} else else
$output .= '<li>'.HTML::anchor($v->url(),$v->menu_display(),array('tabindex'=>-1,'nocg'=>TRUE)).'</li>'; $output .= '<li>'.HTML::anchor($v->url(),$v->menu_display(),array('tabindex'=>-1,'nocg'=>TRUE)).'</li>';

View File

@ -84,7 +84,7 @@ abstract class ORM extends Kohana_ORM {
* Overrides Kohana cache so that it can be globally disabled. * Overrides Kohana cache so that it can be globally disabled.
*/ */
public function cached($lifetime=NULL) { public function cached($lifetime=NULL) {
return $this->_db->caching() ? parent::cached($lifetime) : $this; return $this->_db->caching($this->_table_name) ? parent::cached($lifetime) : $this;
} }
public function clear() { public function clear() {

View File

@ -6,11 +6,13 @@
<dt>Domain Name</dt> <dt>Domain Name</dt>
<dd><?php echo $o->name(); ?></dd> <dd><?php echo $o->name(); ?></dd>
<dt>Domain Expire</dt> <?php if (! $o->service->external_billing) : ?>
<dd><?php echo $o->display('domain_expire'); ?></dd> <dt>Domain Expire</dt>
<dd><?php echo $o->display('domain_expire'); ?></dd>
<dt>Domain Auth Password</dt> <dt>Domain Auth Password</dt>
<dd><?php echo ! $o->service->expiring() ? $o->display('registrar_auth_password') : 'EXPIRED'; ?></dd> <dd><?php echo ! $o->service->expiring() ? $o->display('registrar_auth_password') : 'EXPIRED'; ?></dd>
<?php endif ?>
<?php if ($x=$o->manage_button()) : ?> <?php if ($x=$o->manage_button()) : ?>
<dt>Registrar</dt> <dt>Registrar</dt>
@ -22,5 +24,13 @@
<dd><?php echo $x; ?></dd> <dd><?php echo $x; ?></dd>
<?php endif ?> <?php endif ?>
<?php if ($o->service->external_billing) : ?>
<dt>Provider</dt>
<dd><?php echo HTML::anchor($o->registrar->whitelabel_url,NULL); ?></dd>
<dt>Username</dt>
<dd><?php echo $o->registrar_username; ?></dd>
<dt>Password</dt>
<dd><?php echo $o->registrar_password; ?></dd>
<?php endif ?>
</div> <!-- dl-horizontal --> </div> <!-- dl-horizontal -->
</fieldset> </fieldset>

@ -1 +1 @@
Subproject commit bf3e9b1c78838c198368dc93cbb12b29356642d9 Subproject commit 6d49edd8a1a8debec29ee0f3984926c672317198

View File

@ -52,6 +52,9 @@ class Model_Service extends ORM_OSB {
'date_next_invoice'=>array( 'date_next_invoice'=>array(
array('Config::date',array(':value')), array('Config::date',array(':value')),
), ),
'external_billing'=>array(
array('StaticList_YesNo::get',array(':value',TRUE)),
),
'price_override'=>array( 'price_override'=>array(
array('Currency::display',array(':value')), array('Currency::display',array(':value')),
), ),

View File

@ -38,7 +38,7 @@ abstract class Model_Service_Plugin extends ORM_OSB {
*/ */
protected function manage() { protected function manage() {
// Dont show the manage button for expired or inactive services // Dont show the manage button for expired or inactive services
if (! $this->service->status OR $this->service->expiring()) if (! $this->service->status OR $this->service->expiring() OR $this->service->external_billing)
return FALSE; return FALSE;
static $x = ''; static $x = '';

View File

@ -6,32 +6,38 @@
<dt>Account</dt> <dt>Account</dt>
<dd><?php printf('%s (%s)',$o->account->name(),$o->account->accnum()); ?></dd> <dd><?php printf('%s (%s)',$o->account->name(),$o->account->accnum()); ?></dd>
<dt>Service Active</dt> <?php if ($o->external_billing) : ?>
<dd><?php echo $o->display('status'); ?></dd> <dt>External Billed</dt>
<dd><?php echo $o->display('external_billing'); ?></dd>
<dt>Billing Period</dt> <?php else : ?>
<dd><?php echo $o->display('recur_schedule');?></dd> <dt>Service Active</dt>
<dd><?php echo $o->display('status'); ?></dd>
<dt>Cost</dt> <dt>Billing Period</dt>
<dd><?php echo (! is_null($o->price_override) ? sprintf('<strike>%s</strike> ',$o->price(TRUE,TRUE,TRUE)) : ''). $o->price(TRUE,TRUE); if ($o->pending_change()) echo ' *'; ?></dd> <dd><?php echo $o->display('recur_schedule');?></dd>
<dt>Cost</dt>
<dd><?php echo (! is_null($o->price_override) ? sprintf('<strike>%s</strike> ',$o->price(TRUE,TRUE,TRUE)) : ''). $o->price(TRUE,TRUE); if ($o->pending_change()) echo ' *'; ?></dd>
<!-- @todo --> <!-- @todo -->
<?php if (is_null($o->price) OR ($o->price<=$o->product->price($o->price_group,$o->recur_schedule,'base'))) : ?> <?php if (is_null($o->price) OR ($o->price<=$o->product->price($o->price_group,$o->recur_schedule,'base'))) : ?>
<dt>Service</dt> <dt>Service</dt>
<dd><?php echo HTML::anchor('product/view/'.$o->product_id,$o->product->title()); ?></dd> <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 printf($o->suspend_billing ? '<strike>%s</strike>' : '%s',$o->display('date_next_invoice')); ?></dd>
<dt>Current Invoices Due</dt>
<dd><?php echo $o->due(TRUE); ?></dd>
<?php endif ?> <?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 printf($o->suspend_billing ? '<strike>%s</strike>' : '%s',$o->display('date_next_invoice')); ?></dd>
<dt>Current Invoices Due</dt>
<dd><?php echo $o->due(TRUE); ?></dd>
</div> <!-- /dl-horizontal --> </div> <!-- /dl-horizontal -->
</fieldset> </fieldset>
@ -71,7 +77,7 @@
</div> <!-- /span --> </div> <!-- /span -->
<?php endif ?> <?php endif ?>
<?php if ($o->status) : ?> <?php if ($o->status AND ! $o->external_billing) : ?>
<div class="span5"> <div class="span5">
<fieldset> <fieldset>
<legend>Next Invoice Charges</legend> <legend>Next Invoice Charges</legend>