diff --git a/includes/kohana/modules/cron/classes/cron.php b/includes/kohana/modules/cron/classes/Cron.php similarity index 100% rename from includes/kohana/modules/cron/classes/cron.php rename to includes/kohana/modules/cron/classes/Cron.php diff --git a/includes/kohana/modules/cron/classes/kohana/cron.php b/includes/kohana/modules/cron/classes/Kohana/Cron.php similarity index 100% rename from includes/kohana/modules/cron/classes/kohana/cron.php rename to includes/kohana/modules/cron/classes/Kohana/Cron.php diff --git a/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php b/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php index 13c1de66..4a1196b6 100644 --- a/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php +++ b/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php @@ -92,7 +92,7 @@ class Kohana_Minion_CLI { { foreach ($values as $opt => $value) { - if ( ! in_array($opt, $options)) + if ( ! in_array($opt, $options, TRUE)) { // Set the given value unset($values[$opt]); diff --git a/modules/adsl/classes/Model/Service/Plugin/ADSL.php b/modules/adsl/classes/Model/Service/Plugin/ADSL.php index 6e221d21..a7e9765b 100644 --- a/modules/adsl/classes/Model/Service/Plugin/ADSL.php +++ b/modules/adsl/classes/Model/Service/Plugin/ADSL.php @@ -246,11 +246,11 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin { ->title(sprintf('DSL traffic usage as at %s',Config::date($date))); foreach ($traffic_data as $k => $details) - $google->data(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); + $google->sdata(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); // Work out comulative numbers foreach ($traffic_data as $k => $details) - $google->data(array('yr'=>($x=isset($friendly['cumulative'.$k]) ? $friendly['cumulative'.$k] : 'cumulative'.$k)),array($x=>$this->cumulative($traffic_data[$k]))); + $google->sdata(array('yr'=>($x=isset($friendly['cumulative'.$k]) ? $friendly['cumulative'.$k] : 'cumulative'.$k)),array($x=>$this->cumulative($traffic_data[$k]))); foreach ($array as $item) { switch ($item) { @@ -371,10 +371,10 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin { $traffic_data = $this->get_traffic_data_daily(strtotime($_POST['month'].'-01')); foreach ($traffic_data as $k => $details) - $google->data(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); + $google->sdata(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); foreach ($traffic_data as $k => $details) - $google->data(array('yr'=>($x=isset($friendly['cumulative'.$k]) ? $friendly['cumulative'.$k] : 'cumulative'.$k)),array($x=>$this->cumulative($traffic_data[$k]))); + $google->sdata(array('yr'=>($x=isset($friendly['cumulative'.$k]) ? $friendly['cumulative'.$k] : 'cumulative'.$k)),array($x=>$this->cumulative($traffic_data[$k]))); } else { // @todo Change the date to the last record date @@ -382,7 +382,7 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin { $traffic_data = $this->get_traffic_data_monthly(); foreach ($traffic_data as $k => $details) - $google->data(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); + $google->sdata(array('yl'=>($x=isset($friendly[$k]) ? $friendly[$k] : $k)),array($x=>$traffic_data[$k])); } return (string)$google; diff --git a/modules/domain/classes/Model/Service/Plugin/DOMAIN.php b/modules/domain/classes/Model/Service/Plugin/DOMAIN.php index 5d4e9b1f..7daba177 100644 --- a/modules/domain/classes/Model/Service/Plugin/DOMAIN.php +++ b/modules/domain/classes/Model/Service/Plugin/DOMAIN.php @@ -81,7 +81,7 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin { } public function manage_dns_button() { - return $this->service_plugin_host->manage_button('service_plugin_host'); + return $this->service_plugin_HOST->manage_button('service_plugin_host'); } } ?> diff --git a/modules/gchart/classes/GoogleChart.php b/modules/gchart/classes/GoogleChart.php index 5227948a..3353f769 100644 --- a/modules/gchart/classes/GoogleChart.php +++ b/modules/gchart/classes/GoogleChart.php @@ -19,7 +19,7 @@ abstract class GoogleChart implements Iterator,Countable { // Chart title protected $_title = ''; protected $_dataurl = ''; - protected $_divname = ''; + protected $_divname = 'gchart'; // Default chart size. protected $_height = '200'; protected $_width = '700'; diff --git a/modules/gchart/classes/GoogleChart/ComboChart.php b/modules/gchart/classes/GoogleChart/ComboChart.php index 25c68d1b..56675b9d 100644 --- a/modules/gchart/classes/GoogleChart/ComboChart.php +++ b/modules/gchart/classes/GoogleChart/ComboChart.php @@ -99,36 +99,51 @@ class GoogleChart_ComboChart extends GoogleChart { Script::add(array( 'type'=>'stdin', 'data'=>" -function drawChart".$this->_divname."() { - var jsonData = $.ajax({ - url: '".$this->_dataurl."', - dataType:'json', - async: false, - }).responseText; +function drawChart_".$this->_divname."() { + div = document.getElementById('".$this->_divname."'); - var x = JSON.parse(jsonData); - for(var key in x) { - if (key == 'data') - data = x[key]; - else if (key == 'options') - options = x[key]; - else - alert('UNKNOWN Key: '+key); + if (! div) { + alert(\"Unable to render chart, DIV ['".$this->_divname."'] doesnt exist.\"); + return; } - // Create our data table out of JSON data loaded from server. - var data = new google.visualization.DataTable(data); + $.ajax({ + url: '".$this->_dataurl."', + dataType: 'json', + async: true, + timeout: 10000, + success: function(jsonData) { + for(var key in jsonData) { + if (key == 'data') + data = jsonData[key]; + else if (key == 'options') + options = jsonData[key]; + else + alert('UNKNOWN Key: '+key); + } - // Instantiate and draw our chart, passing in some options. - var chart = new google.visualization.ComboChart(document.getElementById('".$this->_divname."')); - chart.draw(data, options); + // Create our data table out of JSON data loaded from server. + var x = new google.visualization.DataTable(data); + + // Instantiate and draw our chart, passing in some options. + var chart = new google.visualization.ComboChart(document.getElementById('".$this->_divname."')); + chart.draw(x, options); + }, + error: function(x, t, m) { + if (t==='timeout') { + alert('got timeout'); + } else { + alert('t is: '+t+', X: '+x+', M: '+m); + } + } + }); } ", )); Script::add(array( 'type'=>'stdin', - 'data'=>'google.setOnLoadCallback(drawChart'.$this->_divname.');', + 'data'=>'$(document).ready(function() {google.setOnLoadCallback(drawChart_'.$this->_divname.'); });', )); return sprintf('
',$this->_divname,$this->_width,$this->_height); diff --git a/modules/invoice/classes/Controller/User/Invoice.php b/modules/invoice/classes/Controller/User/Invoice.php index ff32c318..b50a2da4 100644 --- a/modules/invoice/classes/Controller/User/Invoice.php +++ b/modules/invoice/classes/Controller/User/Invoice.php @@ -105,8 +105,8 @@ class Controller_User_Invoice extends Controller_TemplateDefault_User { height: 100%; margin: 0; z-index: 1; - left:350px; - top:-200px; + left:250px; + top:-20px; } ')); diff --git a/modules/service/classes/Controller/Admin/Service.php b/modules/service/classes/Controller/Admin/Service.php index 9b92c1ed..2aacaadd 100644 --- a/modules/service/classes/Controller/Admin/Service.php +++ b/modules/service/classes/Controller/Admin/Service.php @@ -54,9 +54,9 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { $google = GoogleChart::factory('ComboChart'); foreach ($data['data'] as $key => $values) - $google->data(array('yl'=>$key),array($key=>$values)); + $google->sdata(array('yl'=>$key),array($key=>$values)); - $google->data(array('yr'=>'services'),array('services'=>$data['svs'])); + $google->sdata(array('yr'=>'services'),array('services'=>$data['svs'])); $this->auto_render = FALSE; $this->response->headers('Content-Type','application/json'); @@ -195,16 +195,11 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { public function action_listadslservices() { $svs = ORM::factory('Service')->list_bylistgroup('ADSL'); - $data = $this->consoltraffic($svs,time()); $google = GoogleChart::factory('ComboChart') + ->dataurl(URL::site('admin/service/ajaxjson_traffic')) ->title(sprintf('ADSL traffic as at %s',date('Y-m-d',strtotime('yesterday')))); - foreach ($data['data'] as $key => $values) - $google->data(array('yl'=>$key),array($key=>$values)); - - $google->data(array('yr'=>'services'),array('services'=>$data['svs'])); - Block::add(array('body'=>(string)$google)); Block::add(array( diff --git a/modules/task/classes/Task/Task/ListActive.php b/modules/task/classes/Task/Task/Listactive.php similarity index 95% rename from modules/task/classes/Task/Task/ListActive.php rename to modules/task/classes/Task/Task/Listactive.php index fb3a5912..22d54a2b 100644 --- a/modules/task/classes/Task/Task/ListActive.php +++ b/modules/task/classes/Task/Task/Listactive.php @@ -10,7 +10,7 @@ * @copyright (c) 2010 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Task_Task_ListActive extends Task { +class Task_Task_Listactive extends Task { protected function _execute(array $params) { $output = '';