More minor fixes

This commit is contained in:
Deon George 2012-03-31 14:33:13 +11:00
parent 6807b6ab52
commit d2bc1bd451
8 changed files with 103 additions and 36 deletions

View File

@ -155,6 +155,9 @@ abstract class lnApp_Controller_TemplateDefault extends Controller_Template {
if ($this->auto_render) {
// Application Title
if ($mo=ORM::factory('module',array('name'=>Request::current()->controller())) AND $mo->loaded())
$this->meta->title = sprintf('%s: %s',Kohana::Config('config.appname'),$mo->display('name'));
else
$this->meta->title = Kohana::Config('config.appname');
$this->template->title = '';

View File

@ -18,7 +18,7 @@
.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-classic.jstree-focused { background:#FCFCFE; }
/* .jstree-classic.jstree-focused { background:#FCFCFE; } */
.jstree-classic .jstree-no-dots li,
.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }

View File

@ -134,4 +134,12 @@ input#mailformformtype_mail{margin-left:11.1em}
#category ul li p {padding:0;margin:0;}
#category ul li a {color:#111;text-decoration:none}
#category ul li a:focus, #category ul li a:hover, #category ul li a:active {color:#811;text-decoration:none;}
.list-box-left { border: 1px solid #AAAACC; margin-right: auto; }
.list-box-left tr.list-head { background-color: #E1E1E3; }
.list-box-left tr.list-sub-head { background-color: #EDEDEF; }
.list-box-left tr th { font-style: bold; }
.list-box-left tr .id { width: 25px; text-align: right; }
.list-box-left tr.list-data:nth-child(even) { background-color: #FCFCFE; }
.list-box-left tr.list-data:nth-child(odd) { background-color: #F6F6F8; }
.list-box-left tr.list-data .right { text-align: right; }
}

View File

@ -16,6 +16,7 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
}
// Our required abstract methods
public function admin_update() {}
public function feature_summary() {}
// @todo This is not used, but should be.

View File

@ -605,16 +605,74 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
return FALSE;
}
$loutput = '';
$doutput = $loutput = '';
$loutput .= View::factory($this->viewpath())
->set('so',$so);
// Validate the transactions
$bt = NULL;
$save = (isset($_REQUEST['go']) && $_REQUEST['go']=1) ? 1 : 0;
$xsid=197;
foreach ($so->transactions()->where('item_type','=',0)->find_all() as $iio) {
if ($iio->service_id == $xsid AND $iio->invoice_id < 3070) continue;
if ($iio->quantity < 0 OR $iio->price_base < 0)
continue;
if (in_array($iio->id,array(960)))
continue;
if ($iio->invoice_id > 4000 OR $iio->product->prod_plugin_file=="ADSL")
$a = FALSE;
else
$a = TRUE;
if (is_null($bt))
$bt = $iio->date_start;
// $doutput .= sprintf('%s: BT is: %s [%s]<br/>',$iio->id,Config::date($bt),$bt);
$pdata = Period::details($iio->recurring_schedule,$a ? NULL : $iio->product->price_recurr_weekday,$bt,TRUE);
switch ($iio->recurring_schedule) {
case 1:
case 2:
case 4:
case 5:
if ($iio->date_start != $pdata['start_time']) {
$doutput .= sprintf('%s: Set start_time: %s [%s]<br/>',$iio->id,Config::date($pdata['start_time']),$pdata['start_time']);
$iio->date_start=$pdata['start_time'];
}
if ($iio->date_stop != $pdata['end_time']) {
$doutput .= sprintf('%s: Set end_time: %s [%s] <br/>',$iio->id,Config::date($pdata['end_time']),$pdata['end_time']);
$iio->date_stop=$pdata['end_time'];
}
$bt = $pdata['end_time']+86400;
//$doutput .= sprintf('%s: BT now: %s (%s) [%s]<br/>',$iio->id,Config::date($bt),Config::date($pdata['end_time']),$bt);
break;
default:
$doutput .= sprintf('%s: %s Not handled',$iio->id,$iio->recurring_schedule);
}
//$doutput .= '<br/>';
if ($save) {
$iio->save();
}
}
if (isset($_REQUEST['go']))
$this->request->redirect('admin/service/view/'.$so->id);
Block::add(array(
'title'=>sprintf('Transaction History for %s: %s',$so->id(),$so->name()),
'body'=>$loutput,
));
Block::add(array(
'title'=>sprintf('Transaction Debug for %s: %s',$so->id(),$so->name()),
'body'=>$doutput,
));
$output .= View::factory('service/user/view')
->set('so',$so);

View File

@ -131,7 +131,7 @@ class Model_Service extends ORMOSB {
}
public function transactions() {
return $this->invoice_item->order_by('date_start,date_stop')->find_all();
return $this->invoice_item->order_by('date_start,date_stop');
}
// @todo To implement

View File

@ -1,41 +1,36 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<table class="box-left" width="100%">
<tr>
<td class="head" colspan="2">Transactions for this service</td>
<table class="list-box-left">
<tr class="list-head">
<th>ID</th>
<th>Invoice</th>
<th>Product</th>
<th>IT</th>
<th>RS</th>
<th>Start</th>
<th>Stop</th>
<th>Desc</th>
<th>Quantity</th>
<th>Charge</th>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>ID</td>
<td>Invoice</td>
<td>Product</td>
<td>IT</td>
<td>RS</td>
<td>Start</td>
<td>Stop</td>
<td>Desc</td>
<td>Charge</td>
<td>Quantity</td>
</tr>
<?php $lp=NULL;$i=0; foreach ($so->transactions() as $iio) { ?>
<?php $lp=NULL; foreach ($so->transactions()->find_all() as $iio) { ?>
<?php if (! is_null($iio->product_id) AND $lp != $iio->product_id) {
$lp = $iio->product_id; ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="head" colspan="10"><?php echo sprintf('%s: %s',$iio->product_id,$iio->product->name()); ?></td>
<tr class="list-sub-head">
<th class="id"><?php echo $iio->product_id; ?></th>
<th colspan="9"><?php echo $iio->product->name(); ?></th>
</tr>
<?php } ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="icon" width="20px"><?php echo $iio->id; ?></td>
<td class="data"><?php echo HTML::anchor('/user/invoice/view/'.$iio->invoice_id,$iio->invoice_id); ?></td>
<td class="data"><?php echo $iio->display('product_id'); ?></td>
<td class="data"><?php echo $iio->display('item_type'); ?></td>
<td class="data"><?php echo $iio->display('recurring_schedule'); ?></td>
<td class="data"><?php echo $iio->display('date_start'); ?></td>
<td class="data"><?php echo $iio->display('date_stop'); ?></td>
<td class="data"><?php echo $iio->display('product_name'); ?></td>
<td class="data"><?php echo $iio->display('price_base'); ?></td>
<td class="data"><?php echo $iio->display('quantity'); ?></td>
<tr class="list-data">
<td class="id"><?php echo $iio->id; ?></td>
<td><?php echo HTML::anchor('/user/invoice/view/'.$iio->invoice_id,$iio->invoice_id); ?></td>
<td><?php echo $iio->display('product_id'); ?></td>
<td><?php echo $iio->display('item_type'); ?></td>
<td><?php echo $iio->display('recurring_schedule'); ?></td>
<td><?php echo $iio->display('date_start'); ?></td>
<td><?php echo $iio->display('date_stop'); ?></td>
<td><?php echo $iio->display('product_name'); ?></td>
<td><?php echo $iio->display('quantity'); ?></td>
<td class="right"><?php echo $iio->display('price_base'); ?></td>
</tr>
<?php } ?>
</table>

View File

@ -14,6 +14,8 @@ class Model_Product_Plugin_SSL extends Model_Product_Plugin {
protected $_table_name = 'ssl';
// Our required abstract methods
public function admin_update() {}
public function feature_summary() {
// @todo This view should render based on the the results of this::allowance();
return View::factory('product/plugin/ssl/feature_summary')