Clean up add and edit for SSL and adsl
This commit is contained in:
@@ -53,28 +53,6 @@ class Controller_Admin_Service extends Controller_Service {
|
||||
if (! $so->loaded())
|
||||
HTTP::redirect('welcome/index');
|
||||
|
||||
Script::factory()
|
||||
->type('stdin')
|
||||
->data('
|
||||
$(document).ready(function() {
|
||||
$("#service_connect_date_label").datepicker({
|
||||
autoclose : true,
|
||||
format : "dd-M-yyyy",
|
||||
todayBtn : true,
|
||||
}).on("hide",function(ev) {
|
||||
$("input[id=service_connect_date]").val(ev.date.valueOf()/1000);
|
||||
});
|
||||
|
||||
$("#service_contract_date_label").datepicker({
|
||||
autoclose : true,
|
||||
format : "dd-M-yyyy",
|
||||
todayBtn : true,
|
||||
}).on("hide",function(ev) {
|
||||
$("input[id=service_contract_date]").val(ev.date.valueOf()/1000);
|
||||
});
|
||||
});
|
||||
');
|
||||
|
||||
Block::factory()
|
||||
->type('form-horizontal')
|
||||
->title(sprintf('%s: %s %s',_('Update Service'),$id,$so->name()))
|
||||
@@ -88,7 +66,7 @@ $(document).ready(function() {
|
||||
|
||||
public function action_listdomainservicesbydnshost() {
|
||||
$svs = ORM::factory('Service')->list_bylistgroup('DOMAIN');
|
||||
Sort::MAsort($svs,'plugin()->host,name()');
|
||||
Sort::MAsort($svs,array('plugin()->host','name()'));
|
||||
|
||||
$list = array();
|
||||
|
||||
@@ -103,7 +81,7 @@ $(document).ready(function() {
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
|
||||
'service_name()'=>array('label'=>'Details'),
|
||||
'name()'=>array('label'=>'Details'),
|
||||
'plugin()->registrar->id'=>array('label'=>'SID'),
|
||||
'plugin()->registrar->name'=>array('label'=>'Supplier'),
|
||||
'display("date_next_invoice")'=>array('label'=>'Next Invoice'),
|
||||
@@ -118,7 +96,7 @@ $(document).ready(function() {
|
||||
|
||||
public function action_listhostservicesbysupplier() {
|
||||
$svs = ORM::factory('Service')->list_bylistgroup('HOST');
|
||||
Sort::MAsort($svs,'plugin()->host,name()');
|
||||
Sort::MAsort($svs,array('plugin()->host','name()'));
|
||||
|
||||
$list = array();
|
||||
|
||||
@@ -133,11 +111,11 @@ $(document).ready(function() {
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
|
||||
'service_name()'=>array('label'=>'Details'),
|
||||
'name()'=>array('label'=>'Details'),
|
||||
'plugin()->display("host_expire")'=>array('label'=>'Expire'),
|
||||
'recur_schedule'=>array('label'=>'Billing'),
|
||||
'price(TRUE,TRUE)'=>array('label'=>'Price','class'=>'right'),
|
||||
'account->accnum()'=>array('label'=>'Cust ID'),
|
||||
'account->refnum()'=>array('label'=>'Cust ID'),
|
||||
'account->name()'=>array('label'=>'Customer'),
|
||||
'display("date_next_invoice")'=>array('label'=>'Next Invoice'),
|
||||
),
|
||||
@@ -179,9 +157,9 @@ $(document).ready(function() {
|
||||
if (is_null($bt))
|
||||
$bt = $iio->date_start;
|
||||
|
||||
$a = ($iio->invoice_id > 4000 OR $iio->product->prod_plugin_file == 'ADSL') ? FALSE : TRUE;
|
||||
$a = ($iio->invoice_id > 4000 OR $iio->service->product->prod_plugin_file == 'ADSL') ? FALSE : TRUE;
|
||||
|
||||
$pdata = Period::details($iio->recurring_schedule,$a ? NULL : $iio->product->price_recurr_weekday,$bt,TRUE,$iio->product->price_recurr_strict);
|
||||
$pdata = Period::details($iio->recurring_schedule,$a ? NULL : $iio->service->product->price_recurr_weekday,$bt,TRUE,$iio->service->product->price_recurr_strict);
|
||||
|
||||
switch ($iio->recurring_schedule) {
|
||||
case 1:
|
||||
@@ -214,7 +192,7 @@ $(document).ready(function() {
|
||||
$iio->save();
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['go']))
|
||||
if ($this->request->query('go'))
|
||||
HTTP::redirect(URL::link('admin','service/view/'.$so->id));
|
||||
|
||||
Block::add(array(
|
||||
@@ -239,7 +217,7 @@ $(document).ready(function() {
|
||||
private function add_edit($id=NULL,$output='') {
|
||||
$so = ORM::factory('Service',$id);
|
||||
|
||||
if ($_POST) {
|
||||
if ($this->request->post()) {
|
||||
if ($so->values($this->request->post())->changed() AND ! ($this->save($so)))
|
||||
$so->reload();
|
||||
|
||||
|
Reference in New Issue
Block a user