Misc fixes and new function service_change

This commit is contained in:
Deon George
2013-01-23 22:17:22 +11:00
parent 47fa9993be
commit 1b7aa6b1a7
8 changed files with 79 additions and 7 deletions

View File

@@ -27,6 +27,9 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
'service_connect_date'=>array(
array('Config::date',array(':value')),
),
'service_contract_date'=>array(
array('Config::date',array(':value')),
),
);
// Required abstract functions
@@ -76,11 +79,11 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
}
public function contract_date_start() {
return Config::date($this->service_connect_date);
return Config::date($this->service_contract_date);
}
public function contract_date_end() {
return Config::date(strtotime(sprintf('+%s months',$this->contract_term),$this->service_connect_date));
return Config::date(strtotime(sprintf('+%s months',$this->contract_term),$this->service_contract_date));
}
public function hasOffpeak() {

View File

@@ -21,6 +21,16 @@
<script type="text/javascript">defaults['service_connect_date'] = '%s';</script>
</td>
</tr>
<tr>
<td>Service Contract Date</td>
<td class="data">
<?php echo Form::input('plugin[service_contract]',$so->service_contract_date,array('id'=>'service_contract_date')); ?>
<?php echo HTML::anchor('#',
HTML::image($mediapath->uri(array('file'=>'img/calendar.png')),array('alt'=>_('Calendar'),'style'=>'cursor: pointer;')),
array('title'=>'Click to popup a dialog to select a date graphically','onclick'=>"dateSelector('service_contract_date')")); ?>
<script type="text/javascript">defaults['service_contract_date'] = '%s';</script>
</td>
</tr>
<tr>
<td>Service Username</td>
<td class="data"><?php echo Form::input('plugin[service_username]',$so->service_username); ?></td>